.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--devir-navy) url('../../images/figma/bg-wrapers.png') no-repeat center center fixed;
  background-size: cover;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden; /* Vuelo cualquier scroll horizontal loco */
}

/* ==========================================================================
   FLOATING CARDS - Animaciones elegantes (Desktop only)
   ========================================================================== */
.auth-wrapper {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.floating-cards {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-card {
  position: absolute;
  width: 280px;
  height: auto;
  opacity: 0.7;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform;
}

/* Card 4: Explorador (Atrás - Arriba Izquierda) */
.floating-card-4 {
  top: 8%;
  left: -2%;
  z-index: 2;
  transform: rotate(-10deg);
  animation: float-left-back 7s ease-in-out infinite;
}

/* Card 3: Hechicera (Adelante - Abajo Izquierda) */
.floating-card-3 {
  top: 40%;
  left: 4%;
  z-index: 4;
  transform: rotate(5deg);
  animation: float-left-front 6s ease-in-out infinite;
}

/* Card 1: Criatura (Atrás - Arriba Derecha) */
.floating-card-1 {
  top: 10%;
  right: -2%;
  z-index: 2;
  transform: rotate(8deg);
  animation: float-right-back 7.5s ease-in-out infinite;
}

/* Card 2: Pájaros (Adelante - Abajo Derecha) */
.floating-card-2 {
  top: 45%;
  right: 4%;
  z-index: 4;
  transform: rotate(-6deg);
  animation: float-right-front 6.5s ease-in-out infinite;
}

/* Animaciones personalizadas */
@keyframes float-left-back {
  0%, 100% { transform: translateY(0) rotate(-10deg); }
  50% { transform: translateY(-15px) rotate(-11deg); }
}

@keyframes float-left-front {
  0%, 100% { transform: translateY(0) rotate(5deg); }
  50% { transform: translateY(-20px) rotate(6deg); }
}

@keyframes float-right-back {
  0%, 100% { transform: translateY(0) rotate(8deg); }
  50% { transform: translateY(-15px) rotate(9deg); }
}

@keyframes float-right-front {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-20px) rotate(-7deg); }
}

/* Accesibilidad: Respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .floating-card {
    animation: none !important;
    opacity: 0.4;
  }
}

/* Tablet: Cards más pequeñas y menos opacas */
@media (min-width: 768px) and (max-width: 1199px) {
  .floating-card {
    width: 200px;
    opacity: 0.5;
  }
  .floating-card-4 { left: -5%; }
  .floating-card-1 { right: -5%; }
}

/* Mobile: Ocultar cards para performance y limpieza */
@media (max-width: 767px) {
  .floating-cards {
    display: none;
  }
}

.auth-page .auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 10; /* Por encima de floating cards */
}

.auth-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* Evita que los hijos rompan los bordes */
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--devir-navy);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.auth-header p {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2.5rem;
  background: #f8f9fa;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid #dee2e6;
}

.auth-tab {
  flex: 1;
  padding: 0.8rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: #6c757d;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-tab:hover {
  color: #3B5BA1;
  background: rgba(59, 91, 161, 0.05);
}

.auth-tab.active {
  color: #3B5BA1;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-form.active {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--devir-navy);
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group .required {
  color: #dc3545;
}

.form-control {
  width: 100%;
  height: 50px; /* Altura estandarizada */
  padding: 0 1.25rem;
  border: 2px solid #e9ecef;
  border-radius: 8px; /* Figma style */
  font-size: 1rem;
  color: var(--devir-navy);
  background: #fbfbfb;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #3B5BA1;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 91, 161, 0.1);
}

.form-control::placeholder {
  color: #adb5bd;
}

.form-control.error {
  border-color: #dc3545;
  background: #fff8f8;
}

.form-control.success {
  border-color: #28a745;
}

.form-control-wrapper {
  position: relative;
}

.form-help {
  font-size: 0.8rem;
  color: #6c757d; /* Corregido para fondo blanco */
  margin-top: 0.4rem;
  line-height: 1.4;
}

.form-help-warning {
  display: none;
  margin-top: 0.6rem;
  color: #664d03;
  background: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
}

.form-help-warning.show {
  display: block;
}

.form-error {
  font-size: 0.8rem;
  color: #dc3545;
  margin-top: 0.4rem;
  font-weight: 500;
  display: none;
}

.form-error.show {
  display: block;
}

.form-success {
  font-size: 0.8rem;
  color: #28a745;
  margin-top: 0.4rem;
  font-weight: 500;
  display: none;
}

.form-success.show {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.toggle-pass {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6c757d;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  transition: color 0.2s;
}

.toggle-pass__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.toggle-pass:hover {
  color: #3B5BA1;
}

.disclaimer-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px; /* Figma style */
  padding: 1rem;
  margin-top: 0.5rem;
}

.disclaimer-highlight {
  background: #f0f4f8;
  border-color: #d1d9e6;
}

.disclaimer-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--devir-navy);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.disclaimer-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #3B5BA1;
  cursor: pointer;
}

.disclaimer-text {
  font-size: 0.8rem;
  color: #495057;
  line-height: 1.5;
  max-height: 150px; /* Reducido para mayor prolijidad */
  overflow-y: auto;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.disclaimer-text ul {
  margin: 0.5rem 0 0.5rem 1rem;
  padding: 0;
}

.disclaimer-text li {
  margin-bottom: 0.25rem;
}

.disclaimer-note {
  margin-top: 0.75rem;
  padding: 0.6rem;
  background: rgba(31, 37, 72, 0.05);
  border-radius: 6px;
  font-size: 0.75rem;
  border-left: 3px solid #3B5BA1;
}

.disclaimer-text a {
  color: #3B5BA1;
  font-weight: 700;
}

.disclaimer-text a:hover {
  color: var(--devir-navy);
}

.country-select {
  position: relative;
}

.country-selected {
  display: flex;
  align-items: center;
  width: 100%;
  height: 50px; /* Altura estandarizada con .form-control */
  gap: 0.75rem;
  padding: 0 1.25rem;
  border: 2px solid #e9ecef;
  border-radius: 8px; /* Figma style */
  cursor: pointer;
  background: #fbfbfb;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
  color: var(--devir-navy);
}

.country-selected:hover {
  border-color: #3B5BA1;
  background: white;
}

.country-select.open .country-selected {
  border-color: #3B5BA1;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 91, 161, 0.1);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.country-selected .flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
}

.flag-img {
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: block;
}

.country-option .flag-img {
  margin-right: 0.25rem;
}

.country-selected .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-selected .arrow {
  color: #adb5bd;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.country-select.open .country-selected .arrow {
  transform: rotate(180deg);
}

.country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #3B5BA1;
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.country-select.open .country-dropdown {
  display: block;
}

.country-search {
  padding: 0.75rem;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  background: white;
}

.country-search input {
  width: 100%;
  height: 38px;
  padding: 0 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #f8f9fa;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 0.95rem;
}

.country-option:hover {
  background: #f0f4f8;
  color: #3B5BA1;
}

.btn-submit {
  width: 100%;
  height: 55px;
  margin-top: 1rem;
  background: linear-gradient(180deg, var(--devir-pink-light) 0%, var(--devir-pink-base) 15%, var(--devir-pink-vivid) 100%); /* Gradiente vertical Figma */
  color: white;
  border: none;
  border-radius: 8px; /* Figma style */
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(206, 70, 108, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(206, 70, 108, 0.45);
  filter: brightness(1.1);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px; /* Figma style */
  margin-bottom: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
  border: 1px solid transparent;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert.show {
  display: block;
}

.alert-success {
  background: #e7f5ee;
  color: #1e7e34;
  border-color: #c3e6cb;
}

.alert-error {
  background: #fff5f5;
  color: #c53030;
  border-color: #feb2b2;
}

.alert-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border-color: #bee3f8;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.back-link {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.back-link a {
  color: #6c757d;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link a:hover {
  color: var(--devir-navy);
}

.link-recovery {
  color: #3B5BA1;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.link-recovery:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 37, 72, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 450px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.modal-title {
  color: var(--devir-navy);
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #f8f9fa;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #e9ecef;
  color: var(--devir-navy);
}

.modal-message {
  margin-top: 1.5rem;
  display: none;
  padding: 1rem;
  border-radius: 8px; /* Figma style */
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-message.success {
  display: block;
  background: #e7f5ee;
  color: #1e7e34;
}

.modal-message.error {
  display: block;
  background: #fff5f5;
  color: #c53030;
}

@media (max-width: 576px) {
  .auth-card {
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .auth-header h1 {
    font-size: 1.8rem;
  }
}
