/* ==========================================================================
   Páginas de cuenta (iniciar sesión, registro, recuperar contraseña,
   revisa tu correo): mismo lenguaje visual que la landing y el sistema
   de diseño (Nunito, azul de confianza, botones con relieve, modo oscuro).
   ========================================================================== */

@import url('../assets/css/styles.css');

.auth-page {
  --au-blue: #1d4ed8;
  --au-blue-dark: #1e3a8a;
  --au-blue-soft: #eaf1ff;
  --au-gold: #f5b301;
  --au-gold-soft: #fff6dc;
  --au-success: #15803d;
  --au-success-soft: #e8f6ec;
  --au-error: #b91c1c;
  --au-error-soft: #fdecec;
  --au-ink: #0f172a;
  --au-muted: #475569;
  --au-line: #e2e8f0;
  --au-line-strong: #cbd5e1;
  --au-surface: #ffffff;
  --au-bg: #f6f8fc;
}

body.active.auth-page {
  --au-blue: #60a5fa;
  --au-blue-dark: #2563eb;
  --au-blue-soft: rgba(96, 165, 250, 0.14);
  --au-gold: #fbbf24;
  --au-gold-soft: rgba(251, 191, 36, 0.12);
  --au-success: #4ade80;
  --au-success-soft: rgba(74, 222, 128, 0.12);
  --au-error: #fca5a5;
  --au-error-soft: rgba(248, 113, 113, 0.14);
  --au-ink: #f1f5f9;
  --au-muted: #a7b4c8;
  --au-line: rgba(148, 163, 184, 0.24);
  --au-line-strong: rgba(148, 163, 184, 0.4);
  --au-surface: #111c33;
  --au-bg: #0b1220;
}

.auth-page,
.auth-page * {
  box-sizing: border-box;
}

.auth-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 420px at 50% -120px, var(--au-blue-soft), transparent 70%),
    var(--au-bg);
  color: var(--au-ink);
  font-family: 'Nunito', 'Alegreya Sans', system-ui, sans-serif;
  text-align: left;
}

/* ---------- Tarjeta ---------- */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px 28px;
  background: var(--au-surface);
  border: 2px solid var(--au-line);
  border-bottom-width: 5px;
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--au-ink);
  font-weight: 900;
  font-size: 1.15rem;
  text-decoration: none;
}

.auth-brand img {
  width: 36px;
  height: 36px;
}

.auth-header {
  margin-bottom: 26px;
}

.auth-header h1 {
  margin: 0 0 8px;
  color: var(--au-ink);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.2;
}

.auth-header p {
  margin: 0;
  color: var(--au-muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* ---------- Formularios ---------- */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--au-ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.form-group input {
  width: 100%;
  padding: 13px 16px;
  background: var(--au-surface);
  color: var(--au-ink);
  border: 2px solid var(--au-line-strong);
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:hover {
  border-color: var(--au-blue);
}

.form-group input:focus {
  outline: none;
  border-color: var(--au-blue);
  box-shadow: 0 0 0 4px var(--au-blue-soft);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 46px;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: none;
  border: none;
  color: var(--au-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  outline: none;
  color: var(--au-blue);
}

.password-requirements {
  margin-top: 6px;
  color: var(--au-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Botones con relieve ---------- */
.auth-button,
.login-button,
.register-button,
.forgot-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--au-blue);
  color: #ffffff;
  border: 2px solid var(--au-blue-dark);
  border-bottom-width: 5px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

body.active.auth-page .auth-button,
body.active.auth-page .login-button,
body.active.auth-page .register-button,
body.active.auth-page .forgot-button {
  color: #0b1220;
}

.auth-button:hover,
.login-button:hover,
.register-button:hover,
.forgot-button:hover {
  filter: brightness(1.08);
}

.auth-button:active,
.login-button:active,
.register-button:active,
.forgot-button:active {
  transform: translateY(2px);
  border-bottom-width: 3px;
}

.auth-button:focus-visible,
.login-button:focus-visible,
.register-button:focus-visible,
.forgot-button:focus-visible {
  outline: 3px solid var(--au-gold);
  outline-offset: 2px;
}

.auth-button:disabled,
.login-button:disabled,
.register-button:disabled,
.forgot-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.auth-button-ghost {
  background: transparent;
  color: var(--au-blue);
  border-color: var(--au-line-strong);
}

body.active.auth-page .auth-button-ghost {
  color: var(--au-blue);
}

/* ---------- Mensajes ---------- */
.error-message,
.success-message {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
}

.error-message {
  background: var(--au-error-soft);
  color: var(--au-error);
  border: 2px solid var(--au-error-soft);
}

.success-message {
  background: var(--au-success-soft);
  color: var(--au-success);
  border: 2px solid var(--au-success-soft);
}

.info-box {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--au-blue-soft);
  color: var(--au-ink);
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
}

.info-box i {
  color: var(--au-blue);
}

/* ---------- Enlaces ---------- */
.login-link,
.auth-switch {
  margin-bottom: 14px;
  color: var(--au-muted);
  font-weight: 600;
}

.login-link a,
.auth-switch a,
.auth-text-link {
  color: var(--au-blue);
  font-weight: 800;
  text-decoration: none;
}

.login-link a:hover,
.auth-switch a:hover,
.auth-text-link:hover {
  text-decoration: underline;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.register-link,
.forgot-link {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  color: var(--au-blue);
  background: transparent;
  border: 2px solid var(--au-line);
  border-bottom-width: 4px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.register-link:hover,
.forgot-link:hover {
  background: var(--au-blue-soft);
  border-color: var(--au-blue);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--au-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--au-blue);
}

/* ---------- Carga ---------- */
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.9s linear infinite;
}

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

/* ---------- Revisa tu correo ---------- */
.auth-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  background: var(--au-blue-soft);
  color: var(--au-blue);
  border-radius: 50%;
  font-size: 2.4rem;
}

.auth-email {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  padding: 4px 12px;
  background: var(--au-blue-soft);
  color: var(--au-ink);
  border-radius: 999px;
  font-weight: 800;
  word-break: break-all;
}

.auth-steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.auth-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  color: var(--au-ink);
  font-weight: 600;
  line-height: 1.45;
}

.auth-steps .step-num {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--au-blue);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 900;
}

body.active.auth-page .auth-steps .step-num {
  color: #0b1220;
}

.auth-spam {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--au-gold-soft);
  border: 2px solid var(--au-gold);
  border-radius: 16px;
  text-align: left;
  font-weight: 600;
  line-height: 1.5;
}

.auth-spam i {
  flex: none;
  color: var(--au-gold);
  font-size: 1.3rem;
}

.auth-spam strong {
  font-weight: 900;
}

.auth-resend-hint {
  margin-bottom: 14px;
  color: var(--au-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 22px;
    border-radius: 20px;
  }

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

  .login-links {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}
