/* =====================================================================
   Auditably.co — Shared auth-page styles
   Used by login.html, signup.html, reset.html, success.html
   ===================================================================== */

:root {
  --brand: #4042E4;
  --brand-dark: #2D2BAB;
  --brand-mid: #5B5DEC;
  --brand-tint: #EEEFFF;
  --emerald: #10B981;
  --emerald-dark: #059669;
  --text: #0F0A1E;
  --text-mid: #4C3D7A;
  --text-light: #7B6FA3;
  --text-faint: #C0B8D8;
  --border: rgba(64, 66, 228, 0.14);
  --bg: #FAFAFA;
  --bg-card: #ffffff;
  --radius: 16px;
  --radius-sm: 9px;
  --radius-pill: 100px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --elev-1: 0 1px 2px rgba(15,10,30,0.04), 0 1px 3px rgba(15,10,30,0.06);
  --elev-2: 0 4px 6px rgba(15,10,30,0.05), 0 1px 3px rgba(15,10,30,0.04);
  --elev-3: 0 10px 25px rgba(15,10,30,0.07), 0 4px 10px rgba(15,10,30,0.04);
  --elev-4: 0 25px 50px rgba(15,10,30,0.10), 0 12px 24px rgba(15,10,30,0.06);
}

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* Subtle ambient backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(64, 66, 228, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 10% 60%, rgba(16, 185, 129, 0.04) 0%, transparent 55%);
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ── Top brand bar ────────────────────────────────────────────────── */
.auth-topbar {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(64, 66, 228, 0.10);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}
.auth-topbar-logo { height: 30px; width: auto; }
.auth-topbar-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--brand-dark);
  letter-spacing: -0.015em;
}
.auth-topbar-name .dot { color: var(--emerald); }
.auth-topbar-link {
  font-size: 12.5px;
  color: var(--text-mid);
  text-decoration: none;
  transition: color var(--t);
}
.auth-topbar-link:hover { color: var(--brand-dark); }
.auth-topbar-link strong { color: var(--brand-dark); font-weight: 600; }

/* ── Centered card ────────────────────────────────────────────────── */
.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 64px;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 36px 32px;
  box-shadow: var(--elev-3);
  width: 100%;
  max-width: 420px;
  position: relative;
}
.auth-card.wide { max-width: 540px; }

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--brand);
  opacity: 0.5;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.2;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 26px;
}

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

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

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: -0.005em;
}

.field-input {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}
.field-input::placeholder { color: var(--text-faint); }
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(64, 66, 228, 0.12);
}
.field-input.error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.field-help {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 2px;
}
.field-help a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px dotted rgba(64, 66, 228, 0.4);
}
.field-help a:hover { color: var(--brand-dark); }

/* Show/hide password toggle */
.field-pw-row { position: relative; }
.field-pw-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t), background var(--t);
}
.field-pw-toggle:hover {
  color: var(--brand-dark);
  background: var(--brand-tint);
}
.field-pw-toggle svg { width: 16px; height: 16px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--t), box-shadow var(--t), filter var(--t), background var(--t);
  white-space: nowrap;
  width: 100%;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(64, 66, 228, 0.32);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(64, 66, 228, 0.45);
  filter: brightness(1.05);
}

.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--brand-tint);
  border-color: var(--brand);
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inline messages ──────────────────────────────────────────────── */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 16px;
}
.alert.error {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.22);
  color: #991B1B;
}
.alert.success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #065F46;
}
.alert.info {
  background: var(--brand-tint);
  border: 1px solid rgba(64, 66, 228, 0.18);
  color: var(--brand-dark);
}
.alert svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.alert strong { font-weight: 600; }

/* ── Footer / page-level helpers ──────────────────────────────────── */
.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-light);
  text-align: center;
}
.auth-foot a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted rgba(64, 66, 228, 0.4);
}
.auth-foot a:hover { color: var(--brand); }

.auth-bottombar {
  padding: 18px 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(64, 66, 228, 0.06);
}
.auth-bottombar a {
  color: var(--text-mid);
  text-decoration: none;
}
.auth-bottombar a:hover { color: var(--brand-dark); }

/* ── Pricing summary card (signup page) ───────────────────────────── */
.tier-summary {
  background: linear-gradient(135deg, var(--brand-tint), #fff);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.tier-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.tier-summary-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}
.tier-summary-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.tier-summary-price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
}
.tier-summary-sub {
  font-size: 11.5px;
  color: var(--text-mid);
  line-height: 1.55;
}

/* ── Tier picker (signup) ─────────────────────────────────────────── */
.tier-picker { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.tier-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t);
  background: #fff;
}
.tier-option:hover { border-color: rgba(64, 66, 228, 0.4); }
.tier-option.selected {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand-tint), #fff);
  box-shadow: 0 0 0 1px var(--brand);
}
.tier-option input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--brand);
  cursor: pointer;
}
.tier-option-body { flex: 1; }
.tier-option-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.tier-option-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.tier-option-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--brand-dark);
}
.tier-option-price small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
}
.tier-option-desc {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.55;
}
.tier-option-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  background: rgba(64, 66, 228, 0.12);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
  margin-left: 6px;
}

/* ── Loading state ────────────────────────────────────────────────── */
.loading-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 14px;
}
.loading-spinner-lg {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(64, 66, 228, 0.18);
  border-top-color: var(--brand);
  border-right-color: var(--emerald);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loading-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.loading-sub {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  max-width: 320px;
}

/* ── Trust line under CTA ─────────────────────────────────────────── */
.trust-line {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-light);
}
.trust-line svg { width: 13px; height: 13px; color: var(--emerald); }

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px 24px; }
  .auth-topbar { padding: 12px 18px; }
  .auth-bottombar { padding: 14px 18px; font-size: 10px; }
}
