/* =========================================================
   BOBLOYALTY — Loyalty System Frontend
   Vanilla CSS. Black & white, rounded display type.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, ul, ol, li, form, label, table, tr, td, th, button, input, select, textarea { margin: 0; padding: 0; border: 0; font: inherit; vertical-align: baseline; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; }
img, svg { display: block; max-width: 100%; }
input, select, textarea, button { font-family: inherit; color: inherit; }

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg:            #ffffff;   /* base canvas */
  --bg-raised:     #fafafa;   /* sticky header / sidebar */
  --surface:       #f2f2f2;   /* card surface */
  --surface-2:     #e9e9e9;   /* hover / lifted */
  --border:        rgba(17, 17, 17, 0.08);
  --border-strong: rgba(17, 17, 17, 0.16);

  /* Text */
  --text:          #111111;   /* primary near-black */
  --text-dim:      #6b6b6b;   /* secondary gray */
  --text-faint:    #9a9a9a;   /* tertiary gray */

  /* Accent — black is the only accent. Used for actions + active state. */
  --accent:        #111111;
  --accent-hover:  #000000;
  --accent-ink:    #ffffff;   /* text on black-filled surfaces */
  --accent-soft:   rgba(17, 17, 17, 0.06);
  --accent-line:   rgba(17, 17, 17, 0.2);

  --success:       #111111;
  --success-soft:  rgba(17, 17, 17, 0.06);
  --danger:        #b3261e;   /* reserved for destructive/error only */
  --danger-soft:   rgba(179, 38, 30, 0.08);

  /* Radius — generous, rounded */
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  /* Shadow — soft, no glow */
  --shadow-card: 0 24px 48px -30px rgba(17, 17, 17, 0.18);
  --shadow-lift: 0 14px 28px -20px rgba(17, 17, 17, 0.14);

  /* Type */
  --font: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fredoka', 'Quicksand', -apple-system, sans-serif;
}

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Utility ---------- */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mono { font-family: var(--font); font-variant-numeric: tabular-nums; }

.hairline { height: 1px; background: var(--border); border: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Emblem (signature mark) ---------- */
.emblem {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emblem svg { width: 16px; height: 16px; }
.emblem--sm { width: 28px; height: 28px; }
.emblem--sm svg { width: 12px; height: 12px; }
.emblem--lg { width: 56px; height: 56px; }
.emblem--lg svg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.985); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn--ghost:hover { border-color: var(--text); background: var(--surface); }

.btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(179, 38, 30, 0.3);
}
.btn--danger:hover { background: var(--danger-soft); }

.btn--sm { padding: 10px 18px; font-size: 0.85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong);
}
.btn-icon:hover { border-color: var(--text); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field input, .field select, .field textarea {
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field select { appearance: none; -webkit-appearance: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-hint { font-size: 0.82rem; color: var(--text-dim); margin-top: -12px; margin-bottom: 20px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Badges / pills / status ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
}
.pill--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill--success { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text); }
.status-dot.is-active { background: var(--text); }
.status-dot.is-pending { background: var(--text-faint); }
.status-dot.is-inactive { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.tag-plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

/* ================= MEMBERSHIP CARD (signature element) =================
   Reused on the landing page (package selection), the auth brand panel
   (selected package), the dashboard (membership hero) and the payment
   page (plan summary). Same shape and rhythm everywhere on purpose. */
.member-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 32px;
}
.member-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* Badge: black icon-circle + label, mirrors the reference "VIP MEMBERSHIP" mark */
.member-card__badge, .member-card__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.member-card__badge-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.member-card__badge-icon svg { width: 14px; height: 14px; }

.member-card__plan {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.member-card__price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-dim);
}
.member-card__price strong { color: var(--text); font-size: 2.4rem; font-weight: 700; }
.member-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.member-card__benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 26px;
}
.member-card__benefit {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
}
.member-card__benefit-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(17,17,17,0.08);
}
.member-card__benefit-icon svg { width: 16px; height: 16px; }

.member-card--select {
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.member-card--select:hover { border-color: var(--border-strong); transform: translateY(-4px); box-shadow: var(--shadow-card); }

.member-card--compact { padding: 22px; }
.member-card--compact .member-card__plan { font-size: 1.3rem; margin-bottom: 4px; }
.member-card--compact .member-card__price strong { font-size: 1.5rem; }
.member-card--compact .member-card__benefits { display: none; }

.member-card__caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 14px;
}

/* ================= LANDING (index.html) ================= */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup__text { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }

.hero {
  padding: 96px 0 72px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  max-width: 780px;
  margin: 20px auto 18px;
}
.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto;
}

.package-section { padding: 20px 0 100px; }
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
.package-card { display: flex; flex-direction: column; }
.package-card .btn { margin-top: 24px; }
.package-card--featured { border-color: var(--border-strong); }
.package-card--featured::after {
  content: 'Most Popular';
  position: absolute;
  top: 22px; right: 22px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
}

/* Full footer */
.site-footer-full { border-top: 1px solid var(--border); padding: 64px 0 32px; margin-top: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  padding-bottom: 40px;
}
.footer-col__title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 0.92rem; margin-bottom: 12px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 24px;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.footer-legal-links { display: flex; gap: 20px; }
.footer-legal-links a { color: var(--text-dim); }
.footer-legal-links a:hover { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ================= LEGAL PAGES (privacy.html, terms.html, cancellation-policy.html) ================= */
.legal-shell { padding: 56px 0 100px; max-width: 720px; margin: 0 auto; }
.legal-shell .eyebrow { display: block; margin-bottom: 10px; }
.legal-shell h1 { font-size: 2.2rem; margin-bottom: 8px; }
.legal-shell .legal-updated { color: var(--text-faint); font-size: 0.85rem; margin-bottom: 40px; }
.legal-shell h2 { font-size: 1.2rem; margin: 36px 0 12px; }
.legal-shell p, .legal-shell li { color: var(--text-dim); font-size: 0.98rem; line-height: 1.7; }
.legal-shell ul { margin-top: 8px; padding-left: 4px; }
.legal-shell li { display: flex; gap: 10px; margin-bottom: 8px; }
.legal-shell li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; margin-top: 9px; }
.legal-back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 32px; }
.legal-back:hover { color: var(--text); }

/* ================= AUTH (auth.html) ================= */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-brand {
  position: relative;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
}
.auth-brand__top { display: flex; align-items: center; gap: 14px; }
.auth-brand__wordmark { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.auth-brand__body { max-width: 420px; }
.auth-brand__body h1 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.08;
  margin: 20px 0 14px;
}
.auth-brand__body p { color: var(--text-dim); font-size: 1.02rem; max-width: 380px; }
.auth-brand__selection { margin-top: 8px; }
.auth-brand__selection .eyebrow { display: block; margin-bottom: 14px; }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card__head { margin-bottom: 30px; }
.auth-card__head h2 { font-size: 1.7rem; margin-top: 6px; }

.tabs {
  display: inline-flex;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 30px;
  border: 1px solid var(--border-strong);
}
.tabs button {
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: background 0.18s ease, color 0.18s ease;
}
.tabs button.is-active { background: var(--accent); color: var(--accent-ink); }

.auth-form { display: none; }
.auth-form.is-active { display: block; }

.auth-foot-link { margin-top: 20px; text-align: center; font-size: 0.9rem; color: var(--text-dim); }
.auth-foot-link a { color: var(--text); font-weight: 700; }

.verify-panel { display: none; text-align: center; }
.verify-panel.is-active { display: block; }
.verify-panel .emblem { margin: 0 auto 22px; }
.verify-panel h2 { font-size: 1.5rem; margin-bottom: 10px; }
.verify-panel p { color: var(--text-dim); margin-bottom: 26px; }
.code-input {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.code-input input {
  width: 50px; height: 60px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
}
.code-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.resend-line { font-size: 0.85rem; color: var(--text-dim); margin-top: 18px; }
.resend-line button { color: var(--text); font-weight: 700; }
.resend-line button[disabled] { color: var(--text-faint); cursor: not-allowed; }

.form-error {
  display: none;
  background: var(--danger-soft);
  border: 1px solid rgba(179,38,30,0.25);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.form-error.is-active { display: block; }

/* ================= DASHBOARD (dashboard.html) ================= */
.top-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  max-width: 1180px;
  margin: 0 auto;
}
.top-nav { display: flex; align-items: center; gap: 28px; margin-left: 8px; }
.top-nav a { color: var(--text-dim); font-size: 0.92rem; font-weight: 600; transition: color 0.15s ease; }
.top-nav a:hover, .top-nav a.is-active { color: var(--text); }
.header-left { display: flex; align-items: center; gap: 8px; }
.header-user { display: flex; align-items: center; gap: 18px; }
.header-user__name { text-align: right; }
.header-user__name .name { font-weight: 700; font-size: 0.92rem; }
.header-user__name .role { font-size: 0.75rem; color: var(--text-dim); }

/* Mobile nav toggle — hidden on desktop; shown by the responsive rules below.
   Shared button chrome (.btn-icon) covers dashboard/payment/settings top nav
   and the admin sidebar toggle. */
.nav-toggle { display: none; flex-shrink: 0; }
.nav-toggle svg { width: 18px; height: 18px; }

.page-section { padding: 44px 0; }
.page-section__head { margin-bottom: 26px; }
.page-section__head h2 { font-size: 1.4rem; }
.page-section__head p { color: var(--text-dim); margin-top: 6px; }

.welcome-line { padding-top: 40px; }
.welcome-line .eyebrow { display: block; margin-bottom: 6px; }
.welcome-line h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* Membership hero — extends .member-card with dashboard-specific bits */
.membership-hero { padding: 36px; }
.membership-hero .member-card__top { align-items: center; }
.membership-hero__cta { margin-top: 24px; }
.membership-hero__status-block { text-align: right; }
.membership-hero__status-line { font-size: 0.82rem; color: var(--text-dim); margin-top: 8px; }

/* Benefits row inside hero */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.benefit-grid__item .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 8px; }
.benefit-grid__item .value { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }

/* Store selector */
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.store-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease;
}
.store-card:hover { transform: translateY(-2px); }
.store-card.is-selected { border-color: var(--accent); background: var(--bg); }
.store-card__radio {
  position: absolute; top: 18px; right: 18px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-strong);
}
.store-card.is-selected .store-card__radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); }
.store-card__name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.store-card__loc { color: var(--text-dim); font-size: 0.86rem; }

/* Category tiles */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.category-tile {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 30px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.category-tile:hover { transform: translateY(-3px); border-color: var(--border-strong); }

/* Plan preview tabs (unpaid members browsing rates by plan) reuse .tabs
   from the auth page but sit tighter against the section above them. */
.plan-preview-tabs { margin-bottom: 18px; }
.category-tile__icon {
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(17,17,17,0.08);
  display: flex; align-items: center; justify-content: center;
}
.category-tile__icon svg { width: 36px; height: 36px; color: var(--text); }
.category-tile__image { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.category-tile__name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-top: 18px; }
.category-tile__discount { font-family: var(--font-display); font-size: 0.98rem; color: var(--text); font-weight: 600; margin-top: 4px; }

/* Calculator */
.calculator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}
.calculator__inputs { display: flex; flex-direction: column; }
.calculator__result {
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 30px;
}
.calculator__result.is-empty { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-faint); min-height: 210px; }
.result-row { display: flex; justify-content: space-between; padding: 11px 0; font-size: 0.96rem; }
.result-row.is-muted { color: var(--text-faint); }
.result-row.is-savings { color: var(--text); font-weight: 700; }
.result-final {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--border);
}
.result-final .label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem; color: var(--text-faint); }
.result-final .value { font-family: var(--font-display); font-weight: 700; font-size: 2rem; }

/* ================= PAYMENT (payment.html) ================= */
.payment-shell { padding: 40px 0 100px; }
.payment-back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 28px; }
.payment-back:hover { color: var(--text); }
.payment-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 36px;
  align-items: start;
}
.payment-summary .member-card { margin-bottom: 24px; }
.payment-billing-row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 0.94rem; color: var(--text-dim); }
.payment-billing-row:last-child { border-bottom: none; }
.payment-billing-row strong { color: var(--text); font-family: var(--font-display); }
.payment-form-card { padding: 34px; }
.payment-form-card h2 { font-size: 1.35rem; margin-bottom: 4px; }
.payment-form-card > p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 26px; }
.payment-confirm-note { display: flex; gap: 10px; align-items: flex-start; font-size: 0.82rem; color: var(--text-faint); margin-top: 16px; }

/* ================= ADMIN (admin.html) — simplest possible, black & white boxes ================= */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 26px; background: none; border: none; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.admin-sidebar__brand-text .name { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.admin-sidebar__brand-text .tag { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

.admin-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.admin-nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
  text-align: left;
}
.admin-nav__item:hover { background: var(--surface); color: var(--text); }
.admin-nav__item.is-active { background: var(--accent); color: var(--accent-ink); }
.admin-nav__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.admin-nav__item.is-active .admin-nav__dot { opacity: 1; }

.admin-sidebar__foot { display: flex; flex-direction: column; gap: 3px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Mobile-only top bar that hosts the sidebar toggle; hidden on desktop where
   the sidebar is always visible. See the responsive rules below. */
.admin-mobile-bar { display: none; }
.admin-mobile-bar__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.admin-sidebar-backdrop { display: none; }

.admin-main { flex: 1; min-width: 0; background: var(--bg); }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 40px;
  border-bottom: 1px solid var(--border);
}
.admin-topbar h1 { font-size: 1.5rem; }
.admin-topbar p { color: var(--text-dim); margin-top: 4px; font-size: 0.9rem; }
.admin-content { padding: 36px 40px; }
.admin-view { display: none; }
.admin-view.is-active { display: block; }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.admin-toolbar input[type="text"] {
  flex: 1; min-width: 220px; max-width: 380px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  font-size: 0.92rem;
  color: var(--text);
}
.admin-toolbar input[type="text"]::placeholder { color: var(--text-faint); }
.admin-toolbar input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.admin-toolbar select {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 160px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 8px; }
.stat-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); padding: 28px; }
.stat-card .num { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; }
.stat-card .label { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 26px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.panel__head h3 { font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); padding: 13px 24px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 16px 24px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.cell-name { font-weight: 700; }
.cell-sub { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.empty-row td { text-align: center; color: var(--text-dim); padding: 38px; }

.category-thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}
.category-thumb--empty { background: var(--surface-2); }
.upload-label { cursor: pointer; }
.upload-label input[type="file"] { display: none; }

/* ---------- Admin Settings ---------- */
.settings-tabs { margin-bottom: 26px; }
.settings-pane { display: none; }
.settings-pane.is-active { display: block; }
.settings-pane__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.settings-pane__head p { color: var(--text-dim); font-size: 0.92rem; }

/* Activity log */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text); flex-shrink: 0; margin-top: 6px;
}
.activity-item__msg { font-size: 0.92rem; }
.activity-item__time { font-size: 0.78rem; color: var(--text-faint); margin-top: 3px; }

/* Announcements / Notes cards */
.settings-card-list { display: flex; flex-direction: column; gap: 14px; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.settings-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.settings-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.settings-card__body { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.settings-card__meta { color: var(--text-faint); font-size: 0.76rem; margin-top: 12px; }
.settings-card__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Help */
.help-topics { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.help-topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.help-topic summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.help-topic summary::-webkit-details-marker { display: none; }
.help-topic summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.help-topic[open] summary::after { transform: rotate(45deg); }
.help-topic p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.7; margin-top: 14px; }

/* Feedback */
.feedback-actions { display: flex; gap: 12px; margin-top: 6px; }

/* Dashboard announcements */
.dashboard-announcements { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.dashboard-announcement {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}
.dashboard-announcement__title { font-family: var(--font-display); font-weight: 600; font-size: 0.96rem; margin-bottom: 4px; }
.dashboard-announcement__body { color: var(--text-dim); font-size: 0.88rem; line-height: 1.6; }
.dashboard-announcement__meta { color: var(--text-faint); font-size: 0.74rem; margin-top: 8px; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17,17,17,0.5);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.is-active { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 34px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal__head h3 { font-size: 1.2rem; }
.modal__actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }

/* Category detail modal (customer side) */
.category-detail-modal { max-width: 420px; }
.category-detail__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-bottom: 20px;
}
.category-detail__media img { width: 100%; height: 100%; object-fit: cover; }
.category-detail__media svg { width: 56px; height: 56px; color: var(--text-dim); }
.category-detail__desc { color: var(--text-dim); font-size: 0.94rem; line-height: 1.6; margin-bottom: 20px; }
.category-detail__discount {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
}

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px);
  background: var(--accent); color: var(--accent-ink);
  padding: 13px 24px; border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 700;
  box-shadow: var(--shadow-card);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.is-error { background: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .package-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .payment-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 280px; padding: 40px; border-right: none; border-bottom: 1px solid var(--border); }
  .auth-panel { padding: 40px 28px; }
  .calculator { grid-template-columns: 1fr; }

  /* Member nav (dashboard/payment/settings) collapses into a toggled dropdown
     instead of just disappearing. */
  .top-header__inner { position: relative; }
  .nav-toggle { display: inline-flex; }
  .top-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 20px;
    right: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    z-index: 30;
  }
  .top-nav.is-open { display: flex; }
  .top-nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .top-nav a:hover, .top-nav a.is-active { background: var(--surface); }

  /* Admin shell stacks vertically on mobile: the mobile bar sits on top,
     the sidebar becomes an off-canvas panel toggled by it, and the main
     content fills the rest. (.admin-sidebar is position:fixed here, so it
     doesn't take up column space; .admin-main becomes the only flex item.) */
  .admin-shell { flex-direction: column; }
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 90;
    box-shadow: var(--shadow-card);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar-backdrop.is-open {
    display: block;
    position: fixed; inset: 0;
    background: rgba(17, 17, 17, 0.42);
    z-index: 85;
  }
  .admin-content, .admin-topbar { padding-left: 20px; padding-right: 20px; }

  /* Wide admin tables scroll horizontally instead of being clipped. */
  .panel { overflow-x: auto; }
  .panel table { min-width: 640px; }

  /* Five settings tabs don't fit a phone-width pill — scroll instead of clipping. */
  .settings-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .settings-tabs button { flex-shrink: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .top-header__inner, .site-header__inner { padding: 16px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .header-user__name { display: none; }
  .admin-topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .settings-pane__head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .settings-card__head { flex-direction: column; gap: 12px; }
  .settings-card__actions { align-self: flex-start; }
  .hero { padding: 64px 0 48px; }
  .membership-hero__top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .membership-hero__status-block { text-align: left; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .modal-overlay { padding: 16px; }
  .modal { padding: 24px; }
}
