/* ============================================================
   auth.css
   Sign In, Create Account, and MFA screens
   ============================================================ */

/* ── Auth modal header ── */
.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.auth-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: .2rem;
}

.auth-subtitle {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-close-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .18s;
}
.auth-close-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── Tab switcher (Sign In / Create Account) ── */
.auth-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 3px;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: 27px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  cursor: pointer;
  transition: all .18s;
}
.auth-tab.active { background: var(--gold); color: #000; font-weight: 700; }

/* ── Form layout ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-error {
  font-size: .7rem;
  color: var(--error);
}

.auth-error-box {
  font-size: .74rem;
  color: var(--error);
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 6px;
  padding: .5rem .75rem;
  line-height: 1.5;
}

.auth-success-box {
  font-size: .74rem;
  color: var(--ok);
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 6px;
  padding: .5rem .75rem;
  line-height: 1.5;
}

/* ── Password strength bar ── */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 4px;
}

.strength-bar {
  display: flex;
  gap: 3px;
  flex: 1;
}

.strength-segment {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--bg-surface2);
  transition: background .25s;
}

.strength-label {
  font-size: .64rem;
  font-family: 'Cinzel', serif;
  letter-spacing: .06em;
  white-space: nowrap;
  transition: color .25s;
}

/* ── Switch link at bottom of form ── */
.auth-switch {
  font-size: .74rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: .35rem;
}

.text-link {
  background: none;
  border: none;
  color: var(--gold);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.text-link:hover { color: var(--gold-light); }

/* ── Loading row (spinner + text side by side) ── */
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

/* ── MFA screens ── */
.mfa-icon  { font-size: 2.5rem; text-align: center; margin-bottom: .5rem; }
.mfa-title { font-family: 'Cinzel', serif; font-size: .95rem; font-weight:700; color: var(--text); text-align:center; margin-bottom:.4rem; }
.mfa-desc  { font-size: .78rem; color: var(--text-muted); text-align:center; line-height:1.6; margin-bottom:.85rem; }

.code-input {
  font-size: 1.6rem !important;
  letter-spacing: .3em !important;
  text-align: center !important;
  font-family: monospace !important;
}

/* ── MFA QR code ── */
.qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
  margin: .5rem 0;
}

.qr-image {
  width: min(200px, 100%);
  height: auto;
  display: block;
}

.secret-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  text-align: center;
}

.secret-code {
  font-family: monospace;
  font-size: .82rem;
  color: var(--gold);
  word-break: break-all;
  letter-spacing: .08em;
  user-select: all;
  cursor: text;
}
