/* ─── Auth Page ────────────────────────────────────────────────── */
.auth-reauth-hint {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(107,20,40,0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(59,13,28,0.2) 0%, transparent 50%),
    linear-gradient(180deg, var(--deep-void) 0%, var(--deep-velvet) 100%);
  padding: 2rem;
}

/* Ambient candles */
.auth-candle-left,
.auth-candle-right {
  position: fixed;
  bottom: 0;
  opacity: 0.6;
  z-index: 0;
}
.auth-candle-left { left: 4%; }
.auth-candle-right { right: 4%; transform: scaleX(-1); }
.auth-candle-left .candle-body,
.auth-candle-right .candle-body { height: 180px; }

/* Card */
.auth-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, rgba(26,8,23,0.95) 0%, rgba(14,6,18,0.98) 100%);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-md);
  padding: 3rem 3.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(201,168,76,0.05),
    inset 0 1px 0 rgba(201,168,76,0.1);
  animation: cardReveal 0.8s var(--transition-bounce) forwards;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Corner ornaments */
.auth-card::before,
.auth-card::after {
  content: '✦';
  position: absolute;
  color: var(--gold-dark);
  font-size: 0.8rem;
}
.auth-card::before { top: 0.8rem; left: 1rem; }
.auth-card::after  { bottom: 0.8rem; right: 1rem; }

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.3rem;
}
.auth-logo-sub {
  font-family: var(--font-script);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  margin-bottom: 2rem;
}
.auth-tab {
  flex: 1;
  padding: 0.7rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
  margin-bottom: -1px;
}
.auth-tab.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}
.auth-tab:hover:not(.active) { color: var(--text-on-dark); }

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.auth-form.hidden { display: none; }

.auth-error {
  background: rgba(139,26,26,0.2);
  border: 1px solid rgba(139,26,26,0.4);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: #e88;
  font-size: 0.9rem;
  display: none;
}
.auth-error.visible { display: block; }

.auth-form-submit {
  margin-top: 0.5rem;
  width: 100%;
  position: relative;
}
.auth-form-submit.loading::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.auth-footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}
.auth-footer-text a { color: var(--gold); }

/* Password strength indicator */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 0.3rem;
}
.strength-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  transition: background 0.3s;
}
.strength-bar.filled-weak   { background: #e74c3c; }
.strength-bar.filled-fair   { background: #e67e22; }
.strength-bar.filled-good   { background: #f1c40f; }
.strength-bar.filled-strong { background: #27ae60; }

/* Generating keys overlay */
.keygen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,3,10,0.93);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.keygen-overlay.visible { opacity: 1; pointer-events: auto; }
.keygen-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(201,168,76,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.keygen-text {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--gold-light);
}
.keygen-sub {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
