/* ============================================================
   auth.css — Estilos para páginas de autenticación
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f172a;
  --surface:  #1e293b;
  --surface2: #273548;
  --border:   #334155;
  --accent:   #38bdf8;
  --green:    #4ade80;
  --red:      #f87171;
  --yellow:   #fbbf24;
  --text:     #e2e8f0;
  --muted:    #94a3b8;
  --radius:   12px;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* ── Layout centrado ─────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(56,189,248,.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(56,189,248,.05) 0%, transparent 60%),
    var(--bg);
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

/* ── Logo / Header ──────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: .4rem;
}
.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
}
.auth-logo p {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* ── Formulario ─────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}
.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: .8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,.12);
}
.form-group input.error {
  border-color: var(--red);
}
.field-error {
  font-size: .78rem;
  color: var(--red);
  margin-top: .3rem;
  display: none;
}
.field-error.show { display: block; }

/* Input con ícono de ojo (password) */
.input-wrap {
  position: relative;
}
.input-wrap input {
  padding-right: 2.75rem;
}
.toggle-pass {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: .2rem;
  line-height: 1;
}
.toggle-pass:hover { color: var(--text); }

/* ── Botón principal ────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #0f172a;
  font-weight: 800;
  font-size: 1rem;
  padding: .875rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .2s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.btn-primary:hover  { background: #7dd3fc; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: default; }

/* ── Botón secundario ───────────────────────────────────── */
.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  padding: .8rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  margin-top: .5rem;
  transition: border-color .2s, color .2s;
  text-align: center;
  text-decoration: none;
  display: block;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Alertas ────────────────────────────────────────────── */
.alert {
  padding: .8rem 1rem;
  border-radius: 10px;
  font-size: .88rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.show   { display: block; }
.alert-error  { background: #450a0a; border: 1px solid #991b1b; color: #fca5a5; }
.alert-success{ background: #1c2a1a; border: 1px solid #166534; color: #86efac; }
.alert-info   { background: #1e3a5f; border: 1px solid #1d4ed8; color: #93c5fd; }

/* ── Divider ────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: .8rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Links ──────────────────────────────────────────────── */
.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: var(--muted);
}
.auth-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.auth-links a:hover { text-decoration: underline; }

/* ── Password strength ──────────────────────────────────── */
.pass-strength {
  margin-top: .4rem;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.pass-strength-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .3s, background .3s;
  width: 0;
}

/* ── 2FA QR box ─────────────────────────────────────────── */
.qr-box {
  text-align: center;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
}
.qr-box img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.qr-box p {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .75rem;
}
.secret-code {
  font-family: monospace;
  font-size: .95rem;
  color: var(--accent);
  letter-spacing: .1em;
  background: var(--surface2);
  padding: .4rem .75rem;
  border-radius: 6px;
  display: inline-block;
  margin-top: .4rem;
}

/* ── OTP input ──────────────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: 1rem 0;
}
.otp-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  caret-color: transparent;
}
.otp-inputs input:focus { border-color: var(--accent); }
.otp-inputs input.filled { border-color: var(--accent); color: var(--accent); }

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(15,23,42,.3);
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Plan badge ─────────────────────────────────────────── */
.plan-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.plan-free     { background: #1e293b; color: var(--muted); border: 1px solid var(--border); }
.plan-pro      { background: #1e3a5f; color: #38bdf8; }
.plan-business { background: #2d1f4a; color: #c084fc; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-box { padding: 1.75rem 1.25rem; border-radius: 16px; }
  .otp-inputs input { width: 42px; height: 50px; font-size: 1.3rem; }
}
