:root {
  --navy: #0b1f3a;
  --navy-soft: #14294a;
  --navy-deep: #071527;
  --gold: #c9a227;
  --gold-soft: #e6c866;
  --gold-hover: #b08d1b;
  --cream: #f6f2ea;
  --paper: #ffffff;
  --text: #1a2332;
  --muted: #6b7280;
  --line: #e7e0d2;
  --line-soft: #f0ebe0;
  --danger: #b3261e;
  --danger-bg: #fdecec;
  --ok: #1f6b4a;
  --ok-bg: #e5f5ee;
  --warn: #92650c;
  --warn-bg: #fbf1dd;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(11, 31, 58, 0.06);
  --shadow-md: 0 12px 32px rgba(11, 31, 58, 0.10);
  --shadow-lg: 0 24px 60px rgba(11, 31, 58, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .brand-mark span { font-family: Lora, Georgia, serif; }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }

/* ---------- Header ---------- */
.topbar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 0.9rem 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-mark { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; }
.brand-mark:hover { text-decoration: none; }
.brand-mark .logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  font-family: Lora, Georgia, serif;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
  flex-shrink: 0;
}
.brand-mark span { font-weight: 600; letter-spacing: 0.02em; font-size: 1.05rem; }
.brand-mark small { display: block; font-family: "Source Sans 3", sans-serif; font-size: 0.68rem; color: var(--gold-soft); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

.topbar nav { display: flex; gap: 1.4rem; align-items: center; font-size: 0.92rem; flex-wrap: wrap; }
.topbar nav a { color: rgba(255, 255, 255, 0.82); font-weight: 500; transition: color 0.15s ease; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a.gold { color: var(--gold-soft); font-weight: 700; }
.topbar nav a.gold:hover { color: var(--gold); }
.topbar .logout-btn { background: none; border: 0; color: rgba(255, 255, 255, 0.82); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.topbar .logout-btn:hover { color: #fff; text-decoration: underline; }

/* ---------- Layout ---------- */
.wrap { max-width: 1000px; margin: 2.2rem auto; padding: 0 1.4rem 3.5rem; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.9rem 2rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1.1rem; }
.hero-title { margin: 0 0 0.4rem; font-size: 1.9rem; }
.lede { color: var(--muted); margin-top: 0; line-height: 1.55; }

/* ---------- Auth shell ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.2rem;
  background:
    radial-gradient(1200px 480px at 15% -10%, rgba(201, 162, 39, 0.10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(11, 31, 58, 0.06), transparent 55%);
}
.auth-back {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.auth-back a { color: var(--muted); font-weight: 600; }
.auth-card {
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 2.3rem 2.2rem 2.1rem;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 1.4rem; }
.auth-brand .logo-badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: Lora, Georgia, serif; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 0 0 5px rgba(11, 31, 58, 0.06);
  margin-bottom: 0.7rem;
}
.auth-brand .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--gold-hover); font-weight: 700; margin: 0 0 0.15rem; }
.auth-card .hero-title { text-align: center; font-size: 1.55rem; margin-bottom: 0.25rem; }
.auth-card .lede { text-align: center; font-size: 0.94rem; margin-bottom: 1.4rem; }
.auth-card .footnote { text-align: center; margin-top: 1.3rem; font-size: 0.92rem; color: var(--muted); }
.auth-card .footnote a { font-weight: 600; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.86rem; margin: 1rem 0 0.35rem; font-weight: 600; color: var(--navy); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}
.checkbox { display: flex; gap: 0.55rem; align-items: flex-start; margin-top: 1.1rem; font-size: 0.92rem; color: var(--text); font-weight: 400; }
.checkbox input { width: auto; margin-top: 0.2rem; }
.helptext, .errorlist { color: var(--muted); font-size: 0.83rem; margin: 0.3rem 0 0; }
.errorlist { color: var(--danger); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  margin-top: 1.2rem;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 6px 16px rgba(201, 162, 39, 0.28); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(11, 31, 58, 0.22); }
.btn-navy:hover { background: var(--navy-soft); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--navy); box-shadow: none; }
.btn-ghost:hover { border-color: var(--navy); background: rgba(11, 31, 58, 0.03); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

/* Google button, per Google's own sign-in branding: light surface, dark text, colored G */
.btn-google {
  background: #fff;
  color: #3c4043;
  border: 1.5px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.btn-google:hover { background: #f8f8f8; border-color: #d0d0d0; }
.btn-google svg { width: 19px; height: 19px; flex-shrink: 0; }

.divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.3rem 0; color: var(--muted); font-size: 0.82rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Alerts ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.messages li { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 0.7rem; font-size: 0.92rem; font-weight: 500; }
.messages .success { background: var(--ok-bg); color: var(--ok); }
.messages .error { background: var(--danger-bg); color: var(--danger); }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.plan { position: relative; border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 1.5rem; background: #fff; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.plan.featured { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; border-color: transparent; box-shadow: var(--shadow-md); }
.plan.featured .price, .plan.featured p, .plan.featured h3 { color: #fff; }
.plan.featured .plan-features li { color: rgba(255, 255, 255, 0.88); }
.plan h3 { margin-top: 0; font-size: 1.25rem; }
.price { font-size: 1.7rem; font-weight: 700; color: var(--navy); margin: 0.3rem 0; }
.badge { display: inline-block; background: var(--gold); color: var(--navy); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 0.6rem; }
.plan-features { list-style: none; padding: 0; margin: 1rem 0 0; }
.plan-features li { padding: 0.3rem 0; font-size: 0.9rem; color: var(--text); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; margin-top: 0.4rem; }
.table th { text-align: left; padding: 0.7rem 0.5rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 2px solid var(--line); }
.table td { text-align: left; padding: 0.8rem 0.5rem; border-bottom: 1px solid var(--line-soft); font-size: 0.94rem; }
.table tr:hover td { background: rgba(11, 31, 58, 0.02); }
.status-active { color: var(--ok); font-weight: 700; }
.status-expired, .status-refused { color: var(--danger); font-weight: 700; }
.status-pending { color: var(--warn); font-weight: 700; }

/* ---------- Misc ---------- */
.social { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.footer-note { margin-top: 2.4rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
.footer-note a { color: var(--muted); font-weight: 600; }

@media (max-width: 640px) {
  .wrap { margin: 1.2rem auto; padding: 0 1rem 2.5rem; }
  .card { padding: 1.4rem; }
  .auth-card { padding: 1.8rem 1.4rem; }
  .topbar { padding: 0.8rem 1rem; }
}
