: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;
  padding: 60px 20px 0px 20px;
}

.fapp-box {
  width: 100%;
  max-width: 680px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: visible;
}

.fapp-scroll {
  overflow-y: auto;
  padding: 10px;
  flex-grow: 1;
}

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

.fapp-tab {
  background: var(--gray-light);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-main);
  border: 1px solid var(--gray-border);
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
  list-style: none;
}

.fapp-tab:hover {
  background: #e5e7eb;
}
.fapp-tab::after {
  content: '⌃';
  position: absolute;
  right: 20px;
  transition: transform 0.2s;
}
.fapp-step[open] .fapp-tab::after {
  transform: rotate(180deg);
}

/* 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;
}

/* FIX: quitar estilos nativos del summary */
.fapp-step summary::-webkit-details-marker {
  display: none;
}
.fapp-step summary {
  list-style: none;
  border: none;
  outline: none;
}

/* 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;
}

/* FOOTER BOTONES */
.fapp-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--gray-border);
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.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);
  overflow-y: auto;
  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;
}

.fapp-submit.enabled {
  background: var(--purple) !important;
  color: #fff !important;
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.fapp-submit:hover:enabled {
  background: #059669;
  opacity: 0.6 !important;
  
}



/* 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);
}

.fapp-radio-options-grid input[type='radio'] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-border);
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: border 0.2s;
}

.fapp-radio-options-grid input[type='radio']:checked {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px var(--purple);
}

.fapp-radio-options-grid input[type='radio']::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transform: scale(0);
  transition: transform 0.2s ease-in-out;
}

.fapp-radio-options-grid input[type='radio']:checked::before {
  transform: scale(1);
}
/* 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;
}