:root {
  --purple: #5353E9;
  --gray-light: rgb(247 247 248);
  --gray-dark: #4b5563;
  --gray-border: #e5e7eb;
  --gray-bg: #FFF;
  --text-main: #111827;
  --text-subtle: #6b7280;
  --radius: 8px;
}

/* GENERAL */
body, .fapp-form {
  font-family: 'Circular Back', sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--gray-bg);
  line-height: 1.6;
}

.fapp-form {
  display: flex;
  justify-content: center;
  /* Sin padding inferior para que la botonera no quede fuera de vista */
  padding: 20px 20px 0;
}

.fapp-box {
  width: 100%;
  max-width: 680px;
  height: 97vh;          /* llena todo el alto */
  display: flex;
  flex-direction: column;
  overflow: hidden;       /* evita que el contenido sobresalga */
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* Zona desplazable de los pasos */
.fapp-scroll {
  flex: 1 1 auto;         /* ocupa el espacio libre */
  overflow-y: auto;       /* scroll interno si es necesario */
  padding: 10px;
}

/* ACCORDION */
.fapp-step {
  margin-bottom: 10px;
  border: none;
}

/* Wrapper para separar visualmente el contenido */
.fapp-panel-wrapper {
  animation: fadeIn 0.2s ease-in;
}

/* PANEL BLANCO */
.fapp-panel {
  background: #ffffff;
  border-radius: var(--radius);
  /*border: 1px solid var(--gray-border);*/
  padding: 24px;
}

/* Compact policy list */
.fapp-policy-section .fapp-policy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  gap: 12px;
}

.fapp-policy-section .fapp-policy-item + .fapp-policy-item {
  border-top: none; /* no extra separators */
}

/* Divider under the master heading */
.fapp-policy-divider {
  height: 1px;
  background: var(--gray-border);
  margin: 6px 0 8px; /* tighter spacing under master */
}

/* Asegurar que el texto de la política ocupe el espacio disponible y el switch quede alineado a la derecha */
.fapp-policy-section .fapp-policy-item > div {
  flex: 1 1 auto;
}

.fapp-policy-section .fapp-policy-item strong {
  display: inline-block;
  font-size: 15px;
  line-height: 1.2;
}

/* Reducir espacio superior del bloque de políticas para que quede más compacto */
.fapp-policy-section {
  margin-top: 6px;
  margin-bottom: 6px;
}

/* LABELS E INPUTS */
.fapp-panel label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin: 5px 0 6px;
  color: var(--text-main);
}


.fapp-panel input[type='text'],
.fapp-panel input[type='email'],
.fapp-panel input[type='tel'],
.fapp-panel input[type='number'],
.fapp-panel textarea,
.fapp-panel select {
  border: 1px solid var(--gray-border) !important;
}

.fapp-panel input[type='text'],
.fapp-panel input[type='email'],
.fapp-panel input[type='tel'],
.fapp-panel input[type='number'],
.fapp-panel textarea,
.fapp-panel select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 6px;
}

.fapp-panel textarea {
  border: 1px solid var(--gray-border);
  background: #fff;
  box-shadow: none;
  outline: none;
}

.fapp-panel input:focus,
.fapp-panel select:focus,
.fapp-panel textarea:focus {
  border-color: var(--purple) !important; 
  box-shadow: 0 0 0 1px var(--purple);
  outline: none;
  background: #fff !important;
}
.fapp-panel textarea:not(:focus):not(:hover):not([disabled]) {
    border: 1px solid var(--gray-border) !important;
    background: #fff !important;
}


/* HINT TEXT */
.fapp-hint {
  font-size: 15px;
  color: rgb(108 108 137);
  margin-top: 4px;
  margin-bottom: 16px;
}

.link-interno {
    color: var(--purple) !important;
    font-weight: 400px !important;
}

/* Progreso + Botonera (ya existen, solo asegúrate de NO tener “margin-top:auto”) */
.fapp-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--gray-border);
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  /* NO margin-top:auto; */
  flex: 0 0 auto;
}

.fapp-footer button {
  font-size: 14px !important;
  font-weight: 500 !important;
  padding: 10px 20px;
  border-radius: var(--radius) !important;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.fapp-prev {
  background: #e5e7eb !important;
  color: #1f2937 !important;
}

.fapp-next {
  background: #e5e7eb !important;
  color: #1f2937 !important;
}
.fapp-next:hover {
  background: var(--purple) !important;
  color: #FFF !important;
}

.fapp-prev:hover {
  background: var(--purple) !important;
  color: #FFF !important;
}
/* RADIO TILES */
/* Diseño de tarjetas en 2 columnas responsivas */
.fapp-tile-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 24px;
  width: 100%;
}

/* Mejorado: radio tiles estilo LemonSqueezy */
.fapp-radio-tile {
  display: none;
}

/* Estilo mejorado para opciones tipo tarjeta (packs) */
.fapp-tile-group .fapp-radio-tile + label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--gray-border);
  background-color: #fff;
  font-size: 14px;
  gap: 0px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 transparent;
  min-width: 220px;
  max-width: 100%;
  font-weight: 400;
}

.fapp-radio-tile + label strong {
  font-weight: 600;
  color: var(--purple);
}

/* Refuerza el borde del seleccionado */
.fapp-tile-group .fapp-radio-tile:checked + label {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple);
}

/* Añadir ícono check visual como pseudo-elemento */
.fapp-tile-group .fapp-radio-tile:checked + label::after {
  content: '✔';
  color: white;
  background-color: var(--purple);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  top: 12px;
  right: 12px;
  box-shadow: 0 0 0 2px white;
}

/* Asegurar posicionamiento relativo */
.fapp-tile-group .fapp-radio-tile + label {
  position: relative;
}

/* DROPZONE UPLOAD */
.fapp-dropzone {
  border: 2px dashed var(--gray-border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 14px;
  background: #fafafa;
  transition: border 0.2s;
}

.fapp-dropzone:hover {
  border-color: var(--purple);
  background: #f3f4f6;
}

/* SWITCH TOGGLE */
.fapp-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.fapp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fapp-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  border-radius: 34px;
  transition: 0.3s;
}

.fapp-slider:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.fapp-switch input:checked + .fapp-slider {
  background-color: var(--purple);
}

.fapp-switch input:checked + .fapp-slider:before {
  transform: translateX(18px);
}

/* ANIMACIÓN SUAVE */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.iti {
  width: 100%;
}

input[type="tel"].iti__tel-input {
  padding-left: 52px !important;
}
/* Popup Slide de derecha a izquierda */
#form-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: flex-end;
  z-index: 9999;
}

#form-popup-container {
  width: 640px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 10px rgba(0,0,0,0.1);

  /* NUEVO: convierte el popup en un flex-box vertical */
  display: flex;
  flex-direction: column;

  /* NUEVO: que no haga scroll él mismo */
  overflow: hidden;

  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  position: relative;
}

#form-popup-overlay.active {
  display: flex;
}

#form-popup-container.active {
  transform: translateX(0);
}

#form-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #e5e7eb;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s;
  z-index: 10000;
  color: black;
}

#form-popup-close:hover {
  background: #d1d5db;
}


.fapp-submit {
  font-size: 14px !important;
  font-weight: 500 !important;
  padding: 10px 20px;
  border-radius: var(--radius) !important;
  border: none;
  cursor: pointer; /* changed from not-allowed */
  transition: background 0.2s;
  background: var(--gray-light) !important; /* verde */
  color: var(--gray-dark) !important; /* verde */;
  /* opacity: 0.6; */ /* commented out */
  /* pointer-events: none; */ /* commented out */
  transition: background 0.2s, opacity 0.2s;
}

button.fapp-submit.enabled,
.fapp-footer button.fapp-submit.enabled {
  background-color: var(--purple) !important;
  color: #fff !important;
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: background-color 0.3s ease;
}

.fapp-submit.enabled:hover {
  background: #3e3ebd !important; /* una versión más oscura del púrpura */
}



/* Checkbox grid para idiomas en dos columnas */
.fapp-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  align-items: start;
}

.fapp-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.fapp-checkbox-grid input[type="checkbox"] {
  margin: 0;
}

input[type="radio"] {
  accent-color: var(--purple) !important;
}

/* Limitar el tamaño de los radio buttons normales */
.fapp-panel input[type='radio'] {
  width: 16px;
  height: 16px;
}
.fapp-panel h2,
.fapp-panel h3,
.fapp-panel p {
  width: 100%;
}

/* Si los títulos están en un grid, forzarlos a ocupar toda la línea */
.fapp-tile-group + h2,
.fapp-tile-group + h3,
.fapp-tile-group + p {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin-top: 24px;
}
/* GRID DE RADIO OPTIONS (ANUAL / MENSUAL) */
.fapp-radio-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 24px;
  align-items: center;
}

.fapp-radio-options-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-main);
}

/* Reemplazo para que los radios tengan el mismo estilo simple que los de idiomas */
.fapp-radio-options-grid input[type='radio'] {
  accent-color: var(--purple);
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}

/* POLÍTICAS - estilo tipo Lemon Squeezy */
.fapp-policy-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.fapp-policy-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0px 0;
}

.fapp-policy-item-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 15px;
}

.fapp-policy-item-description {
  font-size: 14px;
  color: var(--text-subtle);
  margin-top: 4px;
}

.fapp-policy-item-text {
  display: flex;
  flex-direction: column;
}

.fapp-error {
  color: #e11d48;
  font-size: 13px;
  margin-top: 4px;
}

.invalid {
  border-color: #e11d48 !important;
  box-shadow: 0 0 0 1px #e11d48;
}

.required {
  color: #e11d48;
  margin-left: 4px;
}

/* Remove native browser outlines and enforce purple styling on focus */
input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  box-shadow: 0 0 0 1px var(--purple) !important;
}

/* Visually disable submit button when not enabled */
.fapp-submit {
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* Highlight radio button containers when invalid */
.fapp-radio-options-grid input[type='radio'].invalid {
  box-shadow: 0 0 0 2px #e11d48 !important;
  border-color: #e11d48 !important;
}

/* PROGRESS BAR */
.fapp-progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--gray-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 8px;
}

.fapp-progress-bar-fill {
  height: 100%;
  background-color: var(--purple);
  width: 0%;
  transition: width 0.3s ease;
}

.fapp-dropzone.file-attached {
  border-color: var(--purple);
  background-color: #f0f4ff;
}

.fapp-file-info {
  margin-top: 12px;
  font-size: 14px;
  color: var(--purple);
  font-weight: 500;
}

/* Estilo general del checkout */
#fapp-checkout-wrapper .woocommerce {
  font-family: 'Circular Back', sans-serif;
  font-size: 14px;
  color: var(--text-main);
}

/* Inputs del checkout */
#fapp-checkout-wrapper input[type="text"],
#fapp-checkout-wrapper input[type="email"],
#fapp-checkout-wrapper input[type="tel"],
#fapp-checkout-wrapper select,
#fapp-checkout-wrapper textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}

#fapp-checkout-wrapper input:focus,
#fapp-checkout-wrapper select:focus,
#fapp-checkout-wrapper textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
  outline: none;
}

/* Botón de finalizar compra */
#fapp-checkout-wrapper button.button {
  background-color: var(--purple) !important;
  color: #fff !important;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}

#fapp-checkout-wrapper button.button:hover {
  background-color: #3e3ebd !important;
}

/* Tablas de resumen de pedido */
#fapp-checkout-wrapper table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

#fapp-checkout-wrapper table.shop_table th,
#fapp-checkout-wrapper table.shop_table td {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
}

#fapp-checkout-wrapper table.shop_table th {
  background: #f9fafb;
  color: var(--text-main);
}

/* Método de pago */
#fapp-checkout-wrapper .woocommerce-checkout-payment {
  background: #fff;
  padding: 20px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  margin-top: 20px;
}