/* ============================================================
   AUTH.CSS — Módulo de Estilos para Login, Registro y Landing
   QuiniGold Club — Compact 100% Above-the-Fold & Accessible
   ============================================================ */

.hidden {
  display: none !important;
}

/* ── Decoración de fondo atmosférica ── */
.bg-decoration {
  position: fixed;
  pointer-events: none;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.bg-decoration::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: radial-gradient(circle, rgba(230, 57, 70, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.bg-decoration::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -5%;
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.09) 0%, transparent 70%);
  border-radius: 50%;
}

/* ── Contenedor principal con Viewport Dinámico (dvh) ── */
.auth-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: min(16px, 2vh) 14px calc(38px + env(safe-area-inset-bottom, 8px));
  box-sizing: border-box;
}

/* ── Tarjeta de Autenticación Glassmorphism Compacta ── */
.auth-card {
  width: 100%;
  max-width: 410px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.1);
  contain: layout;
}

/* ── Brand & Cabecera Compacta ── */
.auth-logo {
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-brand-badge {
  width: 76px;
  height: 76px;
  aspect-ratio: 1 / 1;
  contain: paint layout;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  border-radius: 50%;
  filter: drop-shadow(0 4px 18px rgba(245, 158, 11, 0.45)) drop-shadow(0 0 12px rgba(230, 57, 70, 0.35));
  transition: transform var(--transition-normal, 200ms ease);
}

.auth-brand-badge picture {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.auth-brand-badge:hover {
  transform: scale(1.05);
}

.brand-crest-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.auth-title {
  font-size: clamp(1.4rem, 5vw, 1.65rem);
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  letter-spacing: 0.5px;
  line-height: 1.1;
  margin: 0 0 2px;
}

.auth-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-secondary, #94a3b8);
  line-height: 1.35;
  margin: 0 0 6px;
  max-width: 320px;
}

/* ── Micro-Chips Horizontales (100% Gratis + Bares/Peñas) ── */
.auth-meta-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.micro-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.2;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
}

.chip-free {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.chip-bar {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  transition: all var(--transition-fast, 150ms ease);
}

.chip-bar:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Segmented Control (Pestañas Compactas) ── */
.segmented-control {
  display: flex;
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}

.segmented-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  transition: all var(--transition-fast, 150ms ease);
  text-align: center;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.segmented-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.segmented-tab.active,
.segmented-tab.btn-primary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── Formulario Compacto ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary, #94a3b8);
  margin-bottom: 1px;
}

.label-link {
  font-size: 0.74rem;
  color: var(--color-gold, #f59e0b);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast, 150ms ease);
}

.label-link:hover {
  color: #fbbf24;
  text-decoration: underline;
}

.form-input {
  min-height: 42px;
  padding: 7px 12px;
  font-size: 0.88rem;
  border-radius: 8px;
}

.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 2.8rem;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted, #64748b);
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; /* WCAG touch target */
  min-height: 44px;
  border-radius: 6px;
  transition: color var(--transition-fast, 150ms ease);
}

.password-toggle:hover {
  color: #fff;
}

.password-toggle svg {
  display: block;
}

.btn-auth-submit {
  min-height: 44px; /* WCAG AA touch target */
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 2px;
  border-radius: 8px;
}

/* ── Checkbox Clickwrap de Términos (+18 RGPD) ── */
.legal-consent-group {
  margin-top: 4px;
  margin-bottom: 4px;
}

.consent-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.consent-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--color-gold, #f59e0b);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-checkbox-label a {
  color: var(--color-gold, #f59e0b);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-checkbox-label a:hover {
  color: #fbbf24;
}

/* ── Micro-Dock de Beneficios & WhatsApp (Compacto) ── */
.features-micro-dock {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.micro-points-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--color-text-muted, #94a3b8);
  flex-wrap: wrap;
}

.micro-points-row strong {
  color: #fff;
}

.whatsapp-mini-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.22);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 8px;
  min-height: 36px;
}

.wa-mini-content {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wa-mini-text {
  font-size: 0.74rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-mini-btn {
  background: var(--brand-whatsapp, #25D366);
  color: var(--color-bg-primary);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 6px);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  transition: transform var(--transition-fast, 150ms ease), filter var(--transition-fast, 150ms ease);
}

.wa-mini-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.02);
}

/* ── Footer Legal Fijo Accesible ── */
.legal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  padding: 6px 12px;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.98) 70%, transparent);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
  contain: layout style;
  content-visibility: visible;
}

.legal-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
  contain: layout style;
}

.legal-footer-links {
  display: inline;
  contain: style;
}

.legal-footer a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color var(--transition-fast, 150ms ease);
}

.legal-footer a:hover {
  color: #fff;
}

.legal-footer a.link-bares {
  color: var(--color-gold, #f59e0b);
  text-decoration: none;
  font-weight: 700;
}

/* ── Modales Bottom Sheet (Aviso Legal & Recuperación) ── */
.disclaimer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeInOverlay 0.2s ease;
  content-visibility: hidden;
}

.disclaimer-overlay.open {
  display: flex;
  content-visibility: visible;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.disclaimer-sheet {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-xl, 14px) var(--radius-xl, 14px) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 16px));
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.disclaimer-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.disclaimer-sheet h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disclaimer-sheet p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 10px;
}

.disclaimer-close {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition-fast, 150ms ease);
}

.disclaimer-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Modal Legal Multitab (Opción B) ── */
.legal-modal-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
  margin-bottom: 14px;
}

.legal-tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted, #94a3b8);
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.legal-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.legal-tab-btn.active {
  background: rgba(245, 158, 11, 0.18);
  color: var(--color-gold, #f59e0b);
  border-color: rgba(245, 158, 11, 0.4);
}

.legal-pane {
  animation: fadeIn 0.2s ease;
}

.legal-external-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-gold, #f59e0b);
  text-decoration: none;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  transition: all 0.2s ease;
}

.legal-external-chip:hover {
  background: rgba(245, 158, 11, 0.18);
  color: #fff;
}

/* ── Media Queries de Compactación Dinámica ── */
@media (max-height: 720px) {
  .auth-card {
    padding: 14px 16px;
    border-radius: 14px;
  }
  .auth-logo {
    margin-bottom: 6px;
  }
  .auth-brand-badge {
    width: 44px;
    height: 44px;
    margin-bottom: 2px;
  }
  .auth-title {
    font-size: 1.35rem;
  }
  .segmented-control {
    margin-bottom: 10px;
  }
  .auth-form {
    gap: 7px;
  }
  .features-micro-dock {
    margin-top: 8px;
    padding-top: 6px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 16px 14px;
  }
}
