/* ================================================================
   BLIBAK CMS — auth.css  v3.0
   Login · Register · Forgot · Reset · Verify
================================================================ */

/* ─── WRAPPER ────────────────────────────────────────────────── */
.auth-wrapper,
.auth-container {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(var(--brand-rgb,37,99,235),.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(var(--brand-rgb,99,102,241),.1) 0%, transparent 50%),
    var(--bg-page, #f8fafc);
}

/* ─── CARD ───────────────────────────────────────────────────── */
.auth-card {
  background: var(--card-bg, #ffffff);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 0 0 1px rgba(var(--brand-rgb,37,99,235),.06),
    0 8px 32px rgba(15,23,42,.10),
    0 32px 80px rgba(15,23,42,.06);
  animation: authIn .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes authIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ─── LOGO ───────────────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}
.auth-logo img {
  height: 48px;
  width: auto;
  margin: 0 auto;
}
.auth-logo .auth-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand-dark,#1e40af);
  letter-spacing: -.03em;
}

/* ─── HEADING ────────────────────────────────────────────────── */
.auth-heading {
  text-align: center;
  margin-bottom: 28px;
}
.auth-heading h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -.02em;
}
.auth-heading p {
  font-size: .9rem;
  color: #64748b;
  line-height: 1.5;
}

/* ─── FORMULARIO ─────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input-group {
  position: relative;
}
.auth-input-group .auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 1rem;
  line-height: 1;
}
.auth-input-group input,
.auth-input-group select {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  font-family: inherit;
  font-size: .95rem;
  background: #f8fafc;
  color: #0f172a;
  transition: all .2s;
  -webkit-appearance: none;
}
.auth-input-group input:not(.with-icon),
.auth-input-group select:not(.with-icon) {
  padding-left: 14px;
}
.auth-input-group input:focus,
.auth-input-group select:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb,37,99,235),.1);
}
.auth-input-group input::placeholder { color: #94a3b8; }

/* Campos sin icono */
.auth-form input,
.auth-form select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  font-family: inherit;
  font-size: .95rem;
  background: #f8fafc;
  color: #0f172a;
  transition: all .2s;
  -webkit-appearance: none;
}
.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb,37,99,235),.1);
}
.auth-form input::placeholder { color: #94a3b8; }

/* Label flotante (opcional, si se usa) */
.auth-form label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Select */
.auth-form select { cursor: pointer; }

/* Fila de 2 campos */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─── BOTÓN ──────────────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--brand-gradient, linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%));
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 16px rgba(var(--brand-rgb,37,99,235),.35);
  margin-top: 4px;
  letter-spacing: .01em;
}
.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(var(--brand-rgb,37,99,235),.45);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled {
  opacity: .6; cursor: not-allowed; transform: none;
}
.auth-btn .btn-loader { display: none; }
.auth-btn.loading .btn-text { display: none; }
.auth-btn.loading .btn-loader { display: inline-block; }

/* auth-btn usado como enlace <a> (verify, reset OK) */
a.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
a.auth-btn:hover { text-decoration: none; color: white; }

/* ─── DIVIDER ────────────────────────────────────────────────── */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: #94a3b8; font-size: .8rem; margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}

/* ─── LINKS / FOOTER ─────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .875rem;
  color: #64748b;
  line-height: 1.8;
}
.auth-footer a {
  color: var(--brand, #2563eb);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* ─── ALERTAS ────────────────────────────────────────────────── */
.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.auth-alert-error   { background: #fef2f2; color: #b91c1c; border-color: #ef4444; }
.auth-alert-success { background: #f0fdf4; color: #15803d; border-color: #22c55e; }
.auth-alert-info    { background: var(--brand-light, #eff6ff); color: var(--brand-dark,#1e40af); border-color: var(--brand,#3b82f6); }
.auth-alert-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

/* ─── VERIFY BOX ─────────────────────────────────────────────── */
.auth-verify-icon {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 20px;
    margin: 16px;
  }
  .auth-heading h1 { font-size: 1.4rem; }
  .auth-form-row { grid-template-columns: 1fr; }
}

/* ---------- TOGGLE OJO CONTRASEÑA ---------- */
.pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pass-wrap input {
  flex: 1;
  padding-right: 44px !important;
}
.pass-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.pass-eye:hover { color: #374151; }
.auth-hint {
  display: block;
  font-size: .78rem;
  color: #9ca3af;
  margin-top: -6px;
  margin-bottom: 4px;
}

/* ─── REGISTER: PASOS ────────────────────────────────────── */
.reg-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 18px;
}
.reg-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reg-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #e5e7eb; background: #fff; color: #9ca3af;
  font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.reg-step.active .reg-step-num { border-color: var(--brand, #2563eb); background: var(--brand, #2563eb); color: #fff; }
.reg-step.done   .reg-step-num { border-color: #16a34a; background: #16a34a; color: #fff; }
.reg-step-label { font-size: .72rem; color: #9ca3af; font-weight: 600; }
.reg-step.active .reg-step-label { color: var(--brand, #2563eb); }
.reg-step.done   .reg-step-label { color: #16a34a; }
.reg-step-line { width: 36px; height: 2px; background: #e5e7eb; margin: 0 4px 14px; }

/* ─── REGISTER: AVATAR ───────────────────────────────────── */
.reg-avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 16px; }
.reg-avatar-preview {
  width: 88px; height: 88px; border-radius: 50%;
  border: 3px dashed #e5e7eb; display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #f9fafb; transition: border-color .2s;
}
.reg-avatar-preview.has-image { border-style: solid; border-color: var(--brand, #2563eb); }
.reg-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.reg-avatar-icon { font-size: 2rem; }
.reg-avatar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 18px; border: 1.5px solid #e5e7eb; border-radius: 999px;
  cursor: pointer; font-size: .85rem; font-weight: 600; color: #374151;
  transition: all .2s; text-align: center;
}
.reg-avatar-btn small { font-size: .72rem; color: #9ca3af; font-weight: 400; }
.reg-avatar-btn:hover { border-color: var(--brand, #2563eb); color: var(--brand, #2563eb); background: var(--brand-light, #eff6ff); }

/* ─── REGISTER: TÉRMINOS ─────────────────────────────────── */
.reg-terms-box {
  background: #f9fafb; border: 1.5px solid #e5e7eb;
  border-radius: 14px; padding: 18px; text-align: center; margin-bottom: 16px;
}
.reg-terms-icon { font-size: 2.2rem; margin-bottom: 8px; }
.reg-terms-text { font-size: .88rem; color: #374151; line-height: 1.55; }

.reg-terms-check {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 2px solid #e5e7eb; border-radius: 12px;
  cursor: pointer; margin-bottom: 16px; transition: all .2s; user-select: none;
}
.reg-terms-check:hover { border-color: var(--brand, #2563eb); background: var(--brand-light,#f0f7ff); }
.reg-terms-check.checked { border-color: #16a34a; background: #f0fdf4; }
.reg-terms-checkbox {
  width: 24px; height: 24px; border-radius: 6px; border: 2px solid #d1d5db;
  background: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #16a34a; transition: all .2s;
}
.reg-terms-check.checked .reg-terms-checkbox { border-color: #16a34a; background: #16a34a; color: #fff; }
.reg-terms-check span { font-size: .87rem; font-weight: 600; color: #374151; }

/* ─── REGISTER: MISC ─────────────────────────────────────── */
.reg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reg-back-link { text-align: center; margin-top: 8px; }
.reg-back-link a { font-size: .82rem; color: #6b7280; text-decoration: none; }
.reg-back-link a:hover { text-decoration: underline; }
.reg-terms-link { color: var(--brand, #2563eb); font-weight: 600; }

/* ─── LOGIN: ALERTAS CONTEXTUALES ───────────────────────── */
.auth-notice-timeout {
  background: #fef3c7; border: 1.5px solid #f59e0b; border-radius: 8px;
  padding: 10px 14px; margin: 12px 0; color: #92400e; font-size: .9rem;
}
.auth-notice-logout {
  background: #dcfce7; border: 1.5px solid #16a34a; border-radius: 8px;
  padding: 10px 14px; margin: 12px 0; color: #166534; font-size: .9rem;
}
.auth-resend-link { font-weight: 700; color: #92400e; }

/* ─── MISC HELPERS ───────────────────────────────────────── */
.hidden { display: none; }
.auth-btn-block { display: block; text-align: center; text-decoration: none; }
/* ★ Botón-enlace dentro del pie (p.ej. "Iniciar sesión" tras registrarse):
   la regla .auth-footer a le ponía el texto azul sobre el fondo azul. */
a.auth-btn,
.auth-footer a.auth-btn,
.auth-footer a.auth-btn:hover { color: #fff; text-decoration: none; }
.auth-footer-done { margin-top: 16px; }

/* ─── RESET: subtítulo reducido ─────────────────────────── */
.auth-heading-sm { margin-bottom: 20px; }

/* ── Botón de enlace de auth (Reenviar código, Volver al login, etc.) ─ */
.auth-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--brand-color, #2563eb);
  color: var(--brand-color, #2563eb);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  font-family: inherit;
}
.auth-link-btn:hover {
  background: var(--brand-color, #2563eb);
  color: #fff;
}
.auth-link-btn:active {
  transform: scale(.98);
}

/* ★ El logo por defecto es blanco (pensado para la cabecera azul) y en la
   tarjeta blanca de acceso no se veía. Solo para ese logo de fábrica. */
.auth-logo img[src^="/assets/images/logo.png"] {
  background: var(--brand, #2563eb);
  padding: 8px 14px;
  border-radius: 12px;
  box-sizing: content-box;
}


/* ─── AUTH: legibilidad móvil y árabe ──────────────────────── */
.auth-form input,
.auth-form select,
.auth-form textarea,
.auth-form button {
  font-weight: 500;
}
.auth-form input::placeholder,
.auth-form select::placeholder,
.auth-form textarea::placeholder {
  color: #64748b;
  opacity: 1;
}
html[lang^="ar"] .auth-form input,
html[lang^="ar"] .auth-form select,
html[lang^="ar"] .auth-form textarea,
html[lang^="ar"] .auth-form button,
html[lang^="ar"] .auth-form label {
  font-family: 'Noto Sans Arabic', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html[lang^="ar"] .auth-form input,
html[lang^="ar"] .auth-form select,
html[lang^="ar"] .auth-form textarea {
  font-size: 1rem;
}


/* BLIBAK — Auth readability v3.2 */
.auth-form input,
.auth-form select,
.auth-form textarea,
.auth-form button {
  font-family: var(--font, 'Noto Sans', 'Noto Sans Arabic', system-ui, sans-serif);
}
.auth-form input::placeholder,
.auth-input-group input::placeholder {
  color: #64748b;
  opacity: 1;
}
.auth-form label,
.auth-form .form-label {
  color: #334155;
  font-weight: 600;
}
html[lang^="ar"] .auth-form,
html[lang^="ar"] .auth-form * {
  font-family: 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
}
