/* ==========================================================================
   DBS Kenya — design tokens
   Palette: ink navy (structure) / cash gold (action) / trust emerald (proof)
   Type: Fraunces (display) + Manrope (body/UI) + IBM Plex Mono (USSD & refs)
   ========================================================================== */
:root {
  --ink:        #12213B;
  --ink-2:      #182a4a;
  --ink-3:      #223759;
  --paper:      #F7F5F0;
  --paper-2:    #EFEBE1;
  --gold:       #E3A008;
  --gold-dark:  #b97e05;
  --emerald:    #1B8A6B;
  --emerald-l:  #e4f5ef;
  --text:       #1b2436;
  --muted:      #5b6785;
  --line:       #e3e0d6;
  --radius:     14px;
  --shadow:     0 10px 30px rgba(18,33,59,.10);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page-bg, var(--paper));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.site-shell { background: var(--content-bg, var(--paper)); min-height: 100vh; }
body.layout-boxed .site-shell {
  max-width: 1400px;
  margin: 0 auto;
  box-shadow: 0 0 60px rgba(18,33,59,.12);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink);
  padding: 10px 16px; z-index: 999; font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { color: var(--muted); margin: 0 0 1em; }
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 13px 24px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--paper); border: 1.5px solid rgba(247,245,240,.4); }
.btn-outline:hover { border-color: var(--paper); }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-block { width: 100%; }

/* Header */
.site-header { background: var(--header-bg, var(--ink)); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.header-inner.align-center { justify-content: center; position: relative; }
.header-inner.align-center .brand { position: absolute; left: 24px; }
.brand { display: flex; align-items: baseline; gap: 4px; }
.brand-mark { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 26px; }
.brand-name { font-family: var(--font-display); font-weight: 700; color: var(--paper); font-size: 26px; }
.brand-logo { height: 40px; }

.main-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; align-items: center; }
.main-nav a { color: var(--paper); font-weight: 700; font-size: 14px; letter-spacing: .03em; text-transform: var(--nav-text-case, uppercase); opacity: .9; }
.main-nav a:hover { opacity: 1; color: var(--gold); }
.has-dropdown { position: relative; }
.dropdown {
  display: none; position: absolute; top: 100%; left: 0; background: var(--ink-2);
  list-style: none; padding: 8px; margin: 6px 0 0; border-radius: 10px; min-width: 220px;
  box-shadow: var(--shadow); flex-direction: column; gap: 0;
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: flex; }
.dropdown li a { display: block; padding: 10px 12px; border-radius: 6px; }
.dropdown li a:hover { background: var(--ink-3); }

.nav-toggle { display: none; background: none; border: none; width: 40px; height: 32px; position: relative; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--paper); margin: 7px 0; border-radius: 2px; }

/* Hero */
.hero { background: var(--ink); color: var(--paper); padding: 64px 0 80px; overflow: hidden; position: relative; }
.hero::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(227,160,8,.18), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--gold); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.hero h1 { color: var(--paper); margin-bottom: 18px; }
.hero p.lead { color: rgba(247,245,240,.75); font-size: 1.1rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; }
.hero-stats .stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--gold); }
.hero-stats .stat span { font-size: 13px; color: rgba(247,245,240,.65); }

/* Signature element: phone / USSD calculator card */
.calc-card {
  background: var(--ink-2); border-radius: 20px; padding: 24px; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.06);
}
.calc-card h3 { color: var(--paper); font-size: 15px; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-body); }
.calc-tabs { display: flex; gap: 6px; margin: 14px 0 18px; background: var(--ink); border-radius: 999px; padding: 4px; }
.calc-tabs button {
  flex: 1; background: none; border: none; color: rgba(247,245,240,.6); font-family: var(--font-body);
  font-weight: 600; font-size: 12.5px; padding: 9px 6px; border-radius: 999px; cursor: pointer;
}
.calc-tabs button.active { background: var(--gold); color: var(--ink); }
.calc-field { margin-bottom: 14px; }
.calc-field label { display: block; font-size: 12.5px; color: rgba(247,245,240,.6); margin-bottom: 6px; }
.calc-field input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
  background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 16px;
}
.calc-result { display: flex; justify-content: space-between; align-items: center; background: var(--emerald-l); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.calc-result span { font-size: 12.5px; color: var(--emerald); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.calc-result b { font-family: var(--font-mono); font-size: 1.3rem; color: var(--ink); }
.ussd-preview {
  background: var(--ink); border: 1px dashed rgba(227,160,8,.5); border-radius: 12px;
  padding: 14px 16px; font-family: var(--font-mono); color: var(--gold); font-size: 1.15rem;
  letter-spacing: .03em; text-align: center; min-height: 26px;
}
.calc-hint { font-size: 12px; color: rgba(247,245,240,.5); margin-top: 10px; text-align: center; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .eyebrow { color: var(--emerald); }
.section-head .eyebrow::before { background: var(--emerald); }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
}
.service-card .rate { font-family: var(--font-mono); color: var(--emerald); font-weight: 600; font-size: 1.1rem; }
.service-card a.btn { margin-top: auto; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { position: relative; padding-left: 4px; }
.step .num {
  counter-increment: step; font-family: var(--font-display); font-size: 2.4rem; color: var(--gold);
  opacity: .5; display: block; margin-bottom: 6px;
}
.step .num::before { content: counter(step, decimal-leading-zero); }

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; color: var(--gold); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: 12px; }

.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trust-item { background: #fff; border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.trust-item .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--emerald-l); color: var(--emerald); display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }

.hours-banner {
  background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 24px 28px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.hours-banner .mono { color: var(--gold); }

/* Forms (conversion pages) */
.form-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.conv-form { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  font-family: var(--font-body); font-size: 15px; background: var(--paper);
}
.field small { color: var(--muted); font-size: 12.5px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; }
.form-msg.error { background: #fde8e8; color: #9b2226; display: block; }
.form-msg.success { background: var(--emerald-l); color: var(--emerald); display: block; }

/* Modal (confirmation / USSD dial) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,33,59,.6); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; padding: 30px; text-align: center; }
.modal-box .ref { font-family: var(--font-mono); font-size: 1.1rem; color: var(--emerald); margin: 10px 0; }
.modal-box .ussd-preview { color: var(--ink); border-color: var(--gold); background: var(--paper-2); margin: 16px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

footer.site-footer { background: var(--ink); color: rgba(247,245,240,.7); padding: 56px 0 0; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-col h3 { color: var(--paper); font-family: var(--font-body); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a:hover { color: var(--gold); }
.footer-brand { margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: 13px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--ink); padding: 12px 24px 24px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dropdown { display: block !important; position: static; box-shadow: none; background: none; padding-left: 12px; }
  .nav-toggle { display: block; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
