/* ============================================================
   Vardan School of Finance — theme.css
   Design tokens + reset + typography + shared primitives.
   Loaded on EVERY page. Keep it small. Keep it stable.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face { font-family: 'Instrument Serif Fallback'; src: local('Georgia'); size-adjust: 100%; }

/* Preloaded in HTML; declared here for CSS-only fallbacks */

/* ---------- Tokens ---------- */
:root {
  /* Colours — exactly as in the brief */
  --bg:            #faf8f3;    /* kaagaz */
  --surface:       #fffefb;    /* cards */
  --surface-2:     #f3f0e8;    /* subtle inset */
  --text:          #1c1a17;
  --text-muted:    #5c574e;
  --text-dim:      #857e73;
  --accent:        #1a6b48;
  --accent-strong: #155638;
  --accent-light:  #e6f1ea;    /* pills, tags, quiet backgrounds */
  --accent-tint:   #f0f7f2;
  --on-accent:     #fff;       /* hare ke upar likha text -- naya rang nahi,
                                  bas usko ek naam mil gaya */
  --border:        rgba(28, 26, 23, .13);
  --border-strong: rgba(28, 26, 23, .22);
  --error:         #9a3b26;
  --warn:          #a76d1b;
  --shadow-sm:     0 1px 2px rgba(28,26,23,.05);
  --shadow-md:     0 6px 24px -12px rgba(28,26,23,.14), 0 2px 6px -3px rgba(28,26,23,.08);
  --shadow-lg:     0 30px 80px -30px rgba(26,107,72,.22), 0 4px 16px -6px rgba(28,26,23,.08);

  /* Type */
  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-serif:   'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing scale (used with clamp for fluid) */
  --content-w: 1180px;
  --content-x: clamp(16px, 4vw, 40px);

  /* Motion */
  --dur-fast: 160ms;
  --dur-med:  260ms;
  --dur-slow: 480ms;
  --ease:     cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; color: var(--text); }
p { margin: 0; }

/* Focus visible — accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Selection */
::selection { background: var(--accent); color: #fff; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding-inline: var(--content-x);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px -12px rgba(26,107,72,.6), 0 1px 2px rgba(28,26,23,.08);
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--text); background: rgba(28,26,23,.03); }

.btn-link {
  color: var(--accent);
  padding: 0;
  font-weight: 500;
  border-radius: 0;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Chips / pills / kickers ---------- */
.kicker {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-light);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.chip.chip-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Serif italic accent word */
.serif-i { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.005em; color: var(--accent); }

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

/* ---------- Form primitives ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.01em; }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }

/* Honeypot — must be invisible to humans, not `type=hidden` */
.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ---------- Sale banner ---------- */
.sale-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 44px 10px 16px;
  background: linear-gradient(90deg, #14523a, #1a6b48);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  cursor: pointer;
  text-align: center;
  justify-content: center;
}
.sale-tag {
  background: rgba(255,255,255,.16);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.sale-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: var(--r-pill);
  color: #fff; font-size: 22px; line-height: 1;
  opacity: .75;
}
.sale-close:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* ---------- Offer popup ---------- */
.offer-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 18, 15, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}
.offer-overlay.show { opacity: 1; }
.offer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  max-width: 420px; width: 100%;
  padding: 32px 28px 24px;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform var(--dur-med) var(--ease);
}
.offer-overlay.show .offer-box { transform: translateY(0); }
.offer-close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border-radius: var(--r-pill);
  color: var(--text-muted); font-size: 22px; line-height: 1;
}
.offer-close:hover { background: var(--surface-2); color: var(--text); }
.offer-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-strong);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 14px;
}
.offer-title { font-size: 24px; margin-bottom: 8px; letter-spacing: -0.02em; }
.offer-text { color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }
.offer-code {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: var(--r-md);
}
.offer-code-label { color: var(--accent-strong); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.offer-code b { font-family: var(--font-mono); color: var(--accent-strong); font-size: 16px; letter-spacing: 0.06em; }
.offer-cta {
  display: block; text-align: center;
  margin-top: 18px;
  background: var(--accent); color: #fff;
  padding: 14px 18px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 14.5px;
  transition: background var(--dur-fast) var(--ease);
}
.offer-cta:hover { background: var(--accent-strong); }
.offer-later {
  display: block; width: 100%;
  text-align: center;
  margin-top: 8px;
  padding: 10px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.offer-later:hover { color: var(--text); }

/* ---------- Toast (used by JS across pages) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 200;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); color: #fff; }
.toast.success { background: var(--accent); color: #fff; }

/* ---------- Utility ---------- */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---------- Reduced motion ---------- */
@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;
  }
}
