/* ===========================
   FORMULARIO FISIO EN SUIZA - REDISEÑADO
   =========================== */

:root {
  /* Colores oficiales de la marca Suiza */
  --sz-rojo: #C4122F;
  --sz-rojo-dark: #8E0E22;
  --sz-gris: #374463;
  --sz-beige: #F3EDEA;
  --sz-blanco-calido: #FAF8F6;
  
  /* Variables de layout */
  --form-max-width: 580px;
  --form-field-width: 100%;
  --spacing-unit: 8px;
  
  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(196, 18, 47, 0.08);
  --shadow-md: 0 4px 16px rgba(196, 18, 47, 0.12);
  --shadow-lg: 0 8px 32px rgba(196, 18, 47, 0.15);
  
  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, var(--sz-beige) 0%, #faf7f5 100%);
  min-height: 100vh;
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #2c3e50;
}

/* ===========================
   LOGO MEJORADO
   =========================== */
.logo-top {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
  transition: all 0.3s ease;
}

.logo-top:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 12px rgba(196, 18, 47, 0.2));
}

.logo-top img {
  width: 85px;
  height: 85px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(196, 18, 47, 0.15);
}

/* ===========================
   CONTENEDOR DEL FORMULARIO
   =========================== */
.centered-form {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 120px 20px 40px;
}

#typeform-form {
  max-width: var(--form-max-width);
  width: 100%;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

/* Decoración eliminada para diseño más limpio */

/* ===========================
   PASOS DEL FORMULARIO
   =========================== */
.form-step {
  display: none;
  flex-direction: column;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.active {
  display: flex;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===========================
   ETIQUETAS
   =========================== */
label {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.35em;
  line-height: 1.4;
  color: var(--sz-gris);
  margin-bottom: 24px;
  display: block;
  letter-spacing: 0.02em;
}

/* ===========================
   CONTENEDOR DE CAMPOS
   =========================== */
.form-content-row {
  width: 100%;
  margin-bottom: 24px;
}

/* ===========================
   CAMPOS DE ENTRADA
   =========================== */
.form-content-row input[type="text"],
.form-content-row input[type="email"],
.form-content-row input[type="tel"],
.form-content-row input[type="number"],
.form-content-row select,
.form-content-row textarea,
#otra-nacionalidad,
#otro-miedo {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.05em;
  font-family: 'Roboto', sans-serif;
  color: #2c3e50;
  background: #f8fafb;
  border: 2px solid #e1e8ed;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  line-height: 1.5;
}

/* Remover apariencia nativa solo de inputs y textarea */
.form-content-row input,
.form-content-row textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Campo especial para textarea */
textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
  padding: 16px 18px;
}

/* Campos condicionales ocultos por defecto */
#otra-nacionalidad,
#otro-miedo {
  margin-top: 16px;
  display: none;
}

/* Estados de focus y hover */
.form-content-row input:hover,
.form-content-row select:hover,
.form-content-row textarea:hover {
  border-color: var(--sz-rojo);
  background: white;
}

.form-content-row input:focus,
.form-content-row select:focus,
.form-content-row textarea:focus,
#otra-nacionalidad:focus,
#otro-miedo:focus {
  outline: none;
  border-color: var(--sz-rojo-dark);
  background: white;
  box-shadow: 0 0 0 4px rgba(196, 18, 47, 0.1);
}

/* Placeholder mejorado */
::placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* ===========================
   SELECT - ESTILO SIMPLE
   =========================== */
.form-content-row select {
  cursor: pointer;
}

/* ===========================
   BOTONES
   =========================== */
.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  width: 100%;
}

.prev-step,
.next-step,
button[type="submit"] {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1em;
  padding: 13px 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
}

/* Botón Atrás */
.prev-step {
  background: #f1f5f9;
  color: var(--sz-gris);
  flex: 0 0 auto;
  min-width: 100px;
}

.prev-step:hover {
  background: var(--sz-beige);
  color: var(--sz-rojo-dark);
  transform: translateX(-2px);
}

/* Botón Siguiente y Enviar */
.next-step,
button[type="submit"] {
  background: linear-gradient(135deg, var(--sz-rojo) 0%, var(--sz-rojo-dark) 100%);
  color: white;
  flex: 1;
  box-shadow: 0 4px 12px rgba(196, 18, 47, 0.25);
}

.next-step:hover,
button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 18, 47, 0.35);
}

.next-step:active,
button[type="submit"]:active {
  transform: translateY(0);
}

/* Efecto de brillo al pasar el ratón */
.next-step::before,
button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.next-step:hover::before,
button[type="submit"]:hover::before {
  left: 100%;
}

/* ===========================
   BARRA DE PROGRESO
   =========================== */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #e8ecef;
  border-radius: 10px;
  margin-top: 40px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sz-rojo) 0%, var(--sz-rojo-dark) 100%);
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(196, 18, 47, 0.3);
}

/* ===========================
   CONTADOR DE PREGUNTAS
   =========================== */
.progress-counter {
  text-align: center;
  margin-top: 12px;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95em;
  color: var(--sz-gris);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.progress-counter #current-step {
  color: var(--sz-rojo-dark);
  font-weight: 700;
  font-size: 1.1em;
}

/* ===========================
   RECAPTCHA
   =========================== */
.formulario__div {
  margin-top: 24px;
  margin-bottom: 8px;
}

.g-recaptcha {
  display: inline-block;
  transform: scale(0.95);
  transform-origin: 0 0;
}

/* ===========================
   LOADER
   =========================== */
#form-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e8ecef;
  border-top-color: var(--sz-rojo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  margin-top: 20px;
  color: var(--sz-rojo-dark);
  font-weight: 600;
  font-size: 1.1em;
  font-family: 'Cinzel', serif;
}

/* ===========================
   MODAL
   =========================== */
.modal-mensaje {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(196, 18, 47, 0.35);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content img {
  max-width: 90px;
  margin-bottom: 24px;
  filter: drop-shadow(0 2px 8px rgba(196, 18, 47, 0.15));
}

.modal-content h2 {
  font-family: 'Cinzel', serif;
  color: var(--sz-rojo-dark);
  font-size: 1.8em;
  margin: 0 0 12px;
}

.modal-content p {
  color: #64748b;
  font-size: 1.05em;
  line-height: 1.6;
  margin: 0 0 24px;
}

#cerrar-modal {
  background: linear-gradient(135deg, var(--sz-rojo) 0%, var(--sz-rojo-dark) 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(196, 18, 47, 0.25);
}

#cerrar-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 18, 47, 0.35);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .logo-top {
    top: 12px;
    left: 12px;
  }
  
  .logo-top img {
    width: 70px;
    height: 70px;
  }
  
  .centered-form {
    padding: 100px 16px 32px;
  }
  
  #typeform-form {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
  }
  
  label {
    font-size: 1.2em;
    margin-bottom: 20px;
  }
  
  .form-content-row input,
  .form-content-row select,
  .form-content-row textarea,
  #otra-nacionalidad,
  #otro-miedo {
    font-size: 1em;
    padding: 12px 16px;
  }
  
  textarea {
    min-height: 100px;
  }
  
  .button-row {
    gap: 12px;
    margin-top: 24px;
  }
  
  .prev-step,
  .next-step,
  button[type="submit"] {
    font-size: 0.95em;
    padding: 12px 20px;
    min-width: 80px;
  }
  
  .progress-bar-container {
    margin-top: 32px;
  }
  
  .progress-counter {
    font-size: 0.9em;
    margin-top: 10px;
  }
  
  .modal-content {
    padding: 32px 24px;
    border-radius: var(--radius-md);
  }
  
  .modal-content h2 {
    font-size: 1.5em;
  }
  
  .modal-content p {
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .logo-top img {
    width: 60px;
    height: 60px;
  }
  
  #typeform-form {
    padding: 28px 20px;
  }
  
  label {
    font-size: 1.1em;
  }
  
  .prev-step {
    min-width: 70px;
    padding: 12px 16px;
  }
  
  .g-recaptcha {
    transform: scale(0.85);
  }
}