/**
 * Propzora — Auth v2
 * Shared styles for: user-login, register, forgot-password, verify-email, reset-password
 * Classes prefixed with .a-
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--pz-font);
  background: #ffffff;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ── */
.a-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  flex-shrink: 0;
}

.a-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.a-logo img { height: 32px; width: auto; }

.a-logo-text {
  font-family: var(--pz-font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: -0.02em;
}

.a-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.a-avatar svg { color: #ffffff; }

/* ── Main content area ── */
.a-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
}

/* ── Card ── */
.a-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}

.a-card--centered {
  align-items: center;
  text-align: center;
}

/* ── Icon circle (verify-email) ── */
.a-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.a-icon svg { color: #1e3a8a; }

/* ── Typography ── */
.a-title {
  font-family: var(--pz-font-display);
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 700;
  color: #1e3a8a;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.a-subtitle {
  font-size: 0.9375rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 32px;
}

.a-email {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 20px;
  word-break: break-all;
}

/* ── Form fields ── */
.a-field { margin-bottom: 20px; }

.a-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 8px;
}

.a-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.a-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-size: 1rem;
  font-family: var(--pz-font);
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-sizing: border-box;
}

.a-input::placeholder { color: #94a3b8; }

/* Force option colors explicitly — some Android/Chrome WebViews render the
   native <select> popup using the OS's own dark-mode setting regardless of
   the page's color-scheme, which can leave option text invisible (white
   text on an OS-forced dark popup). Setting background/color directly on
   <option> is respected even when the popup chrome itself isn't. */
select.a-input option,
select.a-input optgroup {
  background: #fff;
  color: #0f172a;
}

.a-input:focus {
  background: #ffffff;
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.a-input-wrap { position: relative; }
.a-input-wrap .a-input { padding-right: 48px; }

.a-eye {
  position: absolute;
  right: 0; top: 0;
  height: 100%; width: 48px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: #94a3b8;
  transition: color 0.15s;
}

.a-eye:hover { color: #0f172a; }

/* ── Password strength ── */
.a-strength {
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.a-strength__fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 0.3s, background 0.3s;
}

.a-strength__label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Forgot link ── */
.a-forgot {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1e3a8a;
  text-decoration: none;
}

.a-forgot:hover { text-decoration: underline; }

/* ── Buttons ── */
.a-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--pz-font);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  box-sizing: border-box;
  text-decoration: none;
}

.a-btn--primary {
  background: var(--pz-blue);
  color: var(--pz-white);
  margin-top: 8px;
}

.a-btn--primary:hover { background: var(--pz-blue-hover); }
.a-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }

.a-btn--ghost {
  background: transparent;
  color: var(--pz-blue);
  border: 1.5px solid var(--pz-blue-soft);
  margin-top: 12px;
}

.a-btn--ghost:hover { background: var(--pz-blue-mist); }

/* ── Messages ── */
.a-msg {
  font-size: 0.8125rem;
  text-align: center;
  min-height: 20px;
  margin-top: 10px;
  color: #dc2626;
}

.a-msg--ok  { color: #16a34a; }
.a-msg--err { color: #dc2626; }

/* ── Status box (verify-email) ── */
.a-status {
  display: none;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.5;
}

.a-status.show  { display: block; }
.a-status--ok   { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.a-status--err  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

/* ── Countdown ── */
.a-countdown {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 10px;
  min-height: 20px;
  text-align: center;
}

/* ── Divider ── */
.a-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: #cbd5e1;
  margin: 4px 0;
}

.a-divider::before,
.a-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ── Bottom links ── */
.a-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  width: 100%;
}

.a-link {
  font-size: 0.9375rem;
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 500;
}

.a-link:hover { text-decoration: underline; }

.a-link--muted {
  font-size: 0.9375rem;
  color: #475569;
  font-weight: 400;
}

/* ── Terms text ── */
.a-terms {
  font-size: 0.8125rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.6;
}

.a-terms a {
  color: #1e3a8a;
  font-weight: 500;
  text-decoration: none;
}

.a-terms a:hover { text-decoration: underline; }

/* ── 2FA overlay ── */
.twofa-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.twofa-overlay.active { display: flex; }

.twofa-card {
  background: var(--pz-surface, #ffffff);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .twofa-card {
  background: #1e293b;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .twofa-icon { background: rgba(30, 58, 138, 0.35) !important; }
[data-theme="dark"] .twofa-card h2 { color: #f1f5f9; }
[data-theme="dark"] .twofa-card p  { color: #94a3b8; }
[data-theme="dark"] .twofa-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .twofa-input:focus { border-color: #3b82f6; background: #0f172a; }
[data-theme="dark"] .twofa-cancel { color: #64748b; }
[data-theme="dark"] .twofa-cancel:hover { color: #cbd5e1; }
/* Passkey overlay email input */
[data-theme="dark"] #passkeyOverlay textarea,
[data-theme="dark"] #passkeyOverlay input[type="email"] {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] #passkeyOverlay h2 { color: #f1f5f9; }
[data-theme="dark"] #passkeyOverlay p  { color: #94a3b8; }

.twofa-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}

.twofa-input {
  width: 100%; height: 56px;
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.4em; text-align: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px; outline: none;
  font-family: inherit; color: #0f172a;
  margin-bottom: 16px; background: #f8fafc;
  box-sizing: border-box;
}

.twofa-input:focus {
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
  background: #ffffff;
}

.twofa-cancel {
  margin-top: 12px; font-size: 0.8125rem;
  color: #475569; background: none;
  border: none; cursor: pointer; font-family: inherit;
  transition: color 0.15s;
}

.twofa-cancel:hover { color: #0f172a; }