/* Ingresar, Crear cuenta, Recuperar y Crear contraseña nueva (app/views/partials/auth-ui.php). Sobre el tema oscuro v2. */
.auth {
  --auth-text: var(--d-text, #eef1f8);
  --auth-muted: var(--d-muted, #9aa4b8);
  --auth-line: var(--d-border, rgba(255, 255, 255, 0.09));
  --auth-line-strong: var(--d-border-strong, rgba(255, 255, 255, 0.18));
  --auth-link: #93c5fd;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: calc(100vh - var(--v-header-h, 68px));
  padding: clamp(28px, 6vh, 64px) 16px 56px;
  overflow: hidden;
  color: var(--auth-text);
  font-family: var(--v-sans, 'Inter', system-ui, sans-serif);
}
.auth-glow { position: absolute; inset: 0; pointer-events: none; }
.auth-glow i { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(70px); opacity: 0.32; animation: authFloat 16s ease-in-out infinite alternate; }
.auth-glow i:first-child { top: -160px; left: calc(50% - 520px); background: radial-gradient(circle, #2563eb 0%, transparent 70%); }
.auth-glow i:last-child { top: 120px; left: calc(50% + 40px); background: radial-gradient(circle, #7c3aed 0%, transparent 70%); animation-delay: -8s; }
@keyframes authFloat { to { transform: translate3d(40px, 30px, 0) scale(1.08); } }

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px 32px 28px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 25, 41, 0.9), rgba(11, 14, 23, 0.92));
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 1px;
  background: var(--v-grad-line, linear-gradient(90deg, #3b82f6, #8b5cf6, #22d3ee));
  opacity: 0.7;
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px; color: #fff; font-family: var(--v-display, 'Space Grotesk', sans-serif); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.auth-card h1 { margin: 0 0 6px; color: #fff; font-family: var(--v-display, 'Space Grotesk', sans-serif); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.auth-sub { margin: 0 0 22px; color: var(--auth-muted); font-size: 0.95rem; line-height: 1.5; overflow-wrap: anywhere; }

.auth-alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 11px 14px; border: 1px solid; border-radius: 12px; font-size: 0.9rem; line-height: 1.45; }
.auth-alert svg { flex-shrink: 0; margin-top: 1px; }
.auth-alert a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.auth-alert.is-error { border-color: rgba(248, 113, 113, 0.4); background: rgba(239, 68, 68, 0.12); color: #fecaca; }
.auth-alert.is-info { border-color: rgba(96, 165, 250, 0.4); background: rgba(59, 130, 246, 0.12); color: #dbeafe; }
.auth-alert.is-success { border-color: rgba(74, 222, 128, 0.4); background: rgba(34, 197, 94, 0.12); color: #dcfce7; }

.auth-form { display: grid; gap: 16px; }
.auth-field label, .auth-label-row label { display: block; margin: 0 0 7px; color: #dfe4ee; font-size: 0.875rem; font-weight: 600; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.auth-link-sm { color: var(--auth-link); font-size: 0.84rem; font-weight: 500; text-decoration: none; }
.auth-link-sm:hover { text-decoration: underline; }
.auth-input { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 6px 0 14px; border: 1px solid var(--auth-line-strong); border-radius: 14px; background: rgba(255, 255, 255, 0.03); color: var(--auth-muted); transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
.auth-input:focus-within { border-color: #60a5fa; background: rgba(59, 130, 246, 0.05); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18); color: #bfdbfe; }
.auth-input > svg { flex-shrink: 0; }
.auth .auth-input input { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--auth-text); font: inherit; font-size: 1rem; outline: none; }
.auth .auth-input input::placeholder { color: #6b7488; }
.auth .auth-input input:-webkit-autofill { -webkit-text-fill-color: var(--auth-text); caret-color: var(--auth-text); transition: background-color 99999s; }
.auth-input.has-prefix .auth-prefix { padding-right: 9px; border-right: 1px solid var(--auth-line-strong); color: #c7cede; font-weight: 600; }
.auth-eye { display: grid; flex-shrink: 0; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--auth-muted); cursor: pointer; }
.auth-eye:hover { background: rgba(255, 255, 255, 0.07); color: var(--auth-text); }
.auth-eye .is-hide, .auth-eye[aria-pressed="true"] .is-show { display: none; }
.auth-eye[aria-pressed="true"] .is-hide { display: inline-flex; }
.auth-eye span { display: inline-flex; }
.auth-caps { display: flex; align-items: center; gap: 6px; margin: 7px 0 0; color: #fbbf24; font-size: 0.8rem; }
.auth-caps[hidden], .auth-match[hidden] { display: none; }
.auth-hint { margin: 7px 0 0; color: var(--auth-muted); font-size: 0.8rem; }

.auth-meter { margin-top: 10px; }
.auth-meter-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.auth-meter-bar i { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); transition: background-color 0.2s; }
.auth-meter[data-score="1"] i:nth-child(-n+1) { background: #f87171; }
.auth-meter[data-score="2"] i:nth-child(-n+2) { background: #fbbf24; }
.auth-meter[data-score="3"] i:nth-child(-n+3) { background: #a3e635; }
.auth-meter[data-score="4"] i { background: #4ade80; }
.auth-meter-text { margin: 6px 0 0; color: var(--auth-muted); font-size: 0.78rem; }
.auth-rules { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.auth-rules li { display: flex; align-items: center; gap: 6px; color: var(--auth-muted); font-size: 0.78rem; }
.auth-rules li::before { content: ''; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; }
.auth-rules li.is-ok { color: #4ade80; }
.auth-rules li.is-ok::before { border-color: #4ade80; background: #4ade80; }
.auth-match { margin: 7px 0 0; font-size: 0.8rem; }
.auth-match.is-ok { color: #4ade80; }
.auth-match.is-bad { color: #fca5a5; }

.auth-check { display: flex; align-items: center; gap: 10px; color: var(--auth-muted); font-size: 0.9rem; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin: 0; accent-color: #3b82f6; cursor: pointer; }
.auth-check b { color: var(--auth-text); font-weight: 600; }
.auth-check--top { align-items: flex-start; color: #dfe4ee; font-size: 0.86rem; line-height: 1.45; }
.auth-check--top input { flex-shrink: 0; margin-top: 1px; }

.auth-birth { min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-birth legend { display: block; margin: 0 0 7px; padding: 0; color: #dfe4ee; font-size: 0.875rem; font-weight: 600; }
.auth-birth-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.auth-birth-row > div { min-width: 0; }
.auth-field .auth-birth-label { margin: 0 0 5px; color: var(--auth-muted); font-size: 0.78rem; font-weight: 500; }
.auth-birth .auth-input { padding: 0 12px; }
.auth .auth-birth .auth-input input { text-align: center; }

.auth-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 4px; border: 0; border-radius: 14px; background: var(--v-grad-btn, linear-gradient(135deg, #2563eb 0%, #7c3aed 100%)); box-shadow: 0 14px 34px -14px rgba(99, 102, 241, 0.8); color: #fff; font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 0.15s, filter 0.15s; }
.auth-submit:hover { filter: brightness(1.07); transform: translateY(-1px); }
.auth-submit:disabled { cursor: progress; filter: saturate(0.7); transform: none; }
.auth-submit .auth-spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: authSpin 0.7s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--auth-muted); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--auth-line); }
.auth-alt { display: flex; align-items: center; justify-content: center; gap: 9px; height: 48px; border: 1px solid var(--auth-line-strong); border-radius: 14px; background: rgba(255, 255, 255, 0.03); color: var(--auth-text); font-size: 0.95rem; font-weight: 500; text-decoration: none; transition: background-color 0.15s, border-color 0.15s; }
.auth-alt:hover { border-color: rgba(147, 197, 253, 0.5); background: rgba(255, 255, 255, 0.06); }
.auth-foot { margin: 20px 0 0; color: var(--auth-muted); font-size: 0.92rem; text-align: center; }
.auth-foot a { color: var(--auth-link); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.auth-state { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 18px; padding: 16px; border: 1px solid rgba(96, 165, 250, 0.3); border-radius: 16px; background: rgba(59, 130, 246, 0.08); }
.auth-state p { margin: 0; color: #dfe4ee; font-size: 0.92rem; line-height: 1.5; }
.auth-state-icon { display: grid; flex-shrink: 0; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--v-grad-btn, linear-gradient(135deg, #2563eb, #7c3aed)); color: #fff; }
.auth-state.is-ok { border-color: rgba(74, 222, 128, 0.35); background: rgba(34, 197, 94, 0.08); }
.auth-state.is-ok .auth-state-icon { background: linear-gradient(135deg, #16a34a, #22c55e); }
.auth-state.is-warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(245, 158, 11, 0.08); }
.auth-state.is-warn .auth-state-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }

.auth-trust { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; margin: 18px 0 0; color: var(--auth-muted); font-size: 0.8rem; text-align: center; }
.auth :focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.auth .auth-input input:focus-visible { outline: none; }

@media (max-width: 480px) {
  .auth { padding: 20px 12px 40px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 20px; }
  .auth-card h1 { font-size: 1.5rem; }
  .auth-glow i { width: 360px; height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-glow i, .auth-submit .auth-spin { animation: none; }
  .auth-submit:hover { transform: none; }
}
