/* Rakshak AI — design system
   Warm, editorial, trustworthy. Serif display (Fraunces) + humanist sans (Hanken Grotesk).
   Hand-tuned scale, soft paper surfaces, restrained motion. Not a template. */

:root {
  --paper:    #FBF7F0;
  --paper-2:  #F4EDE1;
  --card:     #FFFFFF;
  --line:     #EBE3D5;
  --line-2:   #DCD1BE;

  --ink:      #211D17;
  --ink-2:    #4B453B;
  --muted:    #8C8474;

  --brand:    #15694A;   /* guardian green */
  --brand-700:#0F4E37;
  --brand-300:#2F9E72;
  --brand-tint:#E8F1EC;
  --brand-ring:#15694A26;

  --gold:     #C8902F;
  --gold-700: #9A6B16;
  --gold-tint:#FBF0D9;

  --danger:   #BB3A26;
  --danger-700:#8E2A1A;
  --danger-tint:#FAE8E3;

  --info:     #2C6E9B;
  --info-tint:#E5F0F7;

  --shadow-sm: 0 1px 2px rgba(60,45,20,.06), 0 1px 1px rgba(60,45,20,.04);
  --shadow:    0 8px 24px -10px rgba(60,45,20,.20), 0 2px 6px -2px rgba(60,45,20,.08);
  --shadow-lg: 0 30px 70px -24px rgba(45,33,12,.34);

  --r:   16px;
  --r-sm:11px;
  --r-lg:24px;
  --r-pill:999px;

  --f-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --f-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 540px at 12% -8%, #FFFDF8 0%, rgba(255,253,248,0) 60%),
    radial-gradient(900px 500px at 110% 0%, var(--brand-tint) 0%, rgba(232,241,236,0) 55%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand); color: #fff; }

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 560; letter-spacing: -.01em; color: var(--ink); margin: 0; }
h1 { font-size: clamp(28px, 4.4vw, 46px); line-height: 1.06; font-variation-settings: "SOFT" 0, "WONK" 1; }
h2 { font-size: 22px; line-height: 1.18; }
h3 { font-size: 17px; }
p { margin: 0 0 14px; color: var(--ink-2); }
small, .muted { color: var(--muted); }
.muted { font-size: 13.5px; }

/* --- layout --------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }
.grid { display: grid; gap: 18px; }

/* --- top bar -------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(251,247,240,.82);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em;
  font-size: 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(160deg, var(--brand-300), var(--brand-700));
  color: #fff; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand .mark svg { width: 17px; height: 17px; }
.brand b { font-family: var(--f-display); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links .muted { font-size: 13px; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  --bg: var(--brand); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-sans); font-weight: 650; font-size: 14.5px; line-height: 1;
  padding: 12px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, #fff), var(--bg));
  color: var(--fg); cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .14s var(--ease-spring), box-shadow .18s var(--ease), filter .18s var(--ease);
}
.btn:hover { transform: translateY(-1.5px); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.25); text-decoration: none; }
.btn:active { transform: translateY(0) scale(.985); filter: brightness(.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring), var(--shadow-sm); }
.btn[disabled], .btn.is-loading { opacity: .8; cursor: default; pointer-events: none; }

.btn.sec { --bg: var(--card); --fg: var(--ink); border-color: var(--line-2); background: var(--card); }
.btn.sec:hover { background: #fff; border-color: var(--muted); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.gold { --bg: var(--gold); }
.btn.danger { --bg: var(--danger); }
.btn.lg { padding: 15px 26px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn .spin { display: none; }
.btn.is-loading .spin { display: inline-block; }
.btn.is-loading .label { opacity: .5; }

.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- cards ---------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 28px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; }
.eyebrow { font-family: var(--f-sans); font-weight: 700; font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand); }

/* --- forms ---------------------------------------------------------------- */
label.field { display: block; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 7px; }
input[type=text], input[type=tel], input[type=email], input[type=number], select {
  width: 100%; padding: 12px 13px; font-family: var(--f-sans); font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-ring); }
input::placeholder { color: #b8b0a1; }
select { appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%238C8474' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; cursor: pointer; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.err { background: var(--danger-tint); border: 1px solid color-mix(in srgb, var(--danger) 30%, #fff);
  color: var(--danger-700); padding: 11px 13px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  display: flex; gap: 8px; align-items: center; }

/* segmented radio cards (entity type, scheme) */
.choice { display: grid; gap: 10px; }
.choice.cols-2 { grid-template-columns: repeat(2, 1fr); }
.choice.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice label {
  position: relative; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease), background .15s;
}
.choice label:hover { border-color: var(--brand-300); transform: translateY(-1px); }
.choice label .t { font-weight: 650; font-size: 14px; color: var(--ink); }
.choice label .d { font-size: 12px; color: var(--muted); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice input:checked + .opt { }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint);
  box-shadow: 0 0 0 1px var(--brand) inset; }
.choice label:has(input:checked) .t { color: var(--brand-700); }

.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.switchrow .t { font-weight: 600; font-size: 14px; }
.switch { position: relative; width: 46px; height: 27px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background .2s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .22s var(--ease-spring); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(19px); }

/* --- badges --------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; border: 1px solid transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-done    { background: var(--brand-tint); color: var(--brand-700); }
.b-missed  { background: var(--danger-tint); color: var(--danger-700); }
.b-unknown { background: var(--paper-2); color: var(--muted); }
.b-due_soon{ background: var(--gold-tint); color: var(--gold-700); }
.b-upcoming{ background: var(--info-tint); color: var(--info); }

/* --- KPI stats ------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi { background: linear-gradient(180deg, #fff, var(--paper)); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 15px; }
.kpi .n { font-family: var(--f-display); font-size: 27px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-weight: 600; letter-spacing: .02em; }
.kpi.is-done .n { color: var(--brand-700); }
.kpi.is-missed .n { color: var(--danger-700); }
.kpi.is-due_soon .n { color: var(--gold-700); }
.kpi.is-upcoming .n { color: var(--info); }

/* --- health ring ---------------------------------------------------------- */
.health { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { position: relative; width: 116px; height: 116px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .track { stroke: var(--paper-2); }
.ring .meter { stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .val .s { font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .val .band { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; margin-top: 3px; text-transform: uppercase; }
.health .sum { flex: 1; min-width: 220px; }
.health .sum h2 { margin-bottom: 4px; }

/* --- reminders ------------------------------------------------------------ */
.rem { list-style: none; margin: 0; padding: 0; }
.rem li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.rem li:last-child { border-bottom: 0; }
.rem .u { flex: none; margin-top: 2px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 16%, transparent); }
.u-critical { color: var(--danger); } .u-high { color: var(--gold-700); }
.u-medium { color: var(--gold); } .u-low { color: var(--muted); }
.rem .msg { font-size: 14px; color: var(--ink-2); }
.rem .tag { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-right: 6px; }

/* --- compliance list ------------------------------------------------------ */
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.chip { font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: #fff; color: var(--ink-2); cursor: pointer; transition: all .15s var(--ease); }
.chip:hover { border-color: var(--brand-300); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.flist { display: flex; flex-direction: column; }
.fitem { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center;
  padding: 15px 6px; border-bottom: 1px solid var(--line); transition: background .15s var(--ease); }
.fitem:hover { background: #fffdf8; }
.fitem:last-child { border-bottom: 0; }
.fitem.is-hidden { display: none; }
.fdate { text-align: center; }
.fdate .d { font-family: var(--f-display); font-size: 19px; font-weight: 600; line-height: 1; }
.fdate .m { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.fmain .nm { font-weight: 650; font-size: 15px; }
.fmain .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.fmain .cite { font-size: 11.5px; color: var(--muted); }
.factions { display: flex; align-items: center; gap: 8px; }
.factions .mini { display: inline-flex; gap: 6px; }
.mini button { font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink-2); cursor: pointer; transition: all .14s var(--ease); }
.mini button:hover { border-color: var(--brand); color: var(--brand-700); transform: translateY(-1px); }
.mini button[value=filed]:hover { background: var(--brand-tint); }
.mini .undo:hover { border-color: var(--muted); color: var(--ink); background: var(--paper-2); }
.badge.flash { animation: badgepop .5s var(--ease-spring); }
@keyframes badgepop { 0% { transform: scale(.6); opacity: .2; } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* --- empty / data states -------------------------------------------------- */
.empty { text-align: center; padding: 40px 20px; }
.empty .ico { font-size: 30px; }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-tint);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, #fff); border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--gold-700); }

/* --- OTP boxes ------------------------------------------------------------ */
.otp { display: flex; gap: 10px; justify-content: center; }
.otp input { width: 52px; height: 60px; text-align: center; font-family: var(--f-display); font-size: 26px;
  font-weight: 600; padding: 0; caret-color: var(--brand); }
.otp input.filled { border-color: var(--brand); background: var(--brand-tint); }
@media (max-width: 460px) { .otp input { width: 42px; height: 52px; font-size: 22px; } }

/* --- wizard --------------------------------------------------------------- */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.steps .s { display: flex; align-items: center; gap: 8px; }
.steps .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; background: var(--paper-2); color: var(--muted); border: 1px solid var(--line-2);
  transition: all .2s var(--ease); }
.steps .lbl2 { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.steps .bar { flex: 1; height: 2px; background: var(--line-2); border-radius: 2px; }
.steps .s.done .num, .steps .s.active .num { background: var(--brand); color: #fff; border-color: var(--brand); }
.steps .s.active .lbl2 { color: var(--ink); }
.wstep { display: none; animation: stepIn .42s var(--ease) both; }
.wstep.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* --- toast ---------------------------------------------------------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px;
  max-width: 360px; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: #fff;
  padding: 12px 15px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: toastIn .4s var(--ease-spring) both; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast .ic { flex: none; }
.toast.ok .ic { color: var(--brand-300); }
.toast.warn .ic { color: var(--gold); }
.toast.err .ic { color: #ff9a8a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* --- landing -------------------------------------------------------------- */
.hero { padding: 64px 0 40px; }
.hero .pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 6px 14px 6px 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm); }
.hero .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-300);
  box-shadow: 0 0 0 4px var(--brand-tint); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.hero h1 { margin: 22px 0 16px; max-width: 16ch; }
.hero h1 .em { color: var(--brand); font-style: italic; }
.hero .sub { font-size: 18px; max-width: 52ch; color: var(--ink-2); }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; align-items: center; }
.hero .trust { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat .card { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.feat .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--brand-tint); color: var(--brand-700); }
.section-h { text-align: center; max-width: 56ch; margin: 0 auto 30px; }
.section-h .eyebrow { display: block; margin-bottom: 10px; }

.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.steps3 .card { position: relative; }
.steps3 .card::before { counter-increment: step; content: counter(step); font-family: var(--f-display);
  font-size: 14px; font-weight: 700; color: var(--brand); width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-tint); display: grid; place-items: center; margin-bottom: 12px; }

.cta-band { background: linear-gradient(150deg, var(--brand-700), var(--brand)); color: #fff;
  border-radius: var(--r-lg); padding: 44px; text-align: center; box-shadow: var(--shadow); }
.cta-band h2 { color: #fff; font-size: 28px; }
.cta-band p { color: rgba(255,255,255,.85); }
.cta-band .btn { --bg: #fff; --fg: var(--brand-700); }

footer.foot { border-top: 1px solid var(--line); margin-top: 50px; padding: 28px 0; }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.foot .muted { font-size: 12.5px; }

/* --- reveal animation ----------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 820px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .feat, .steps3 { grid-template-columns: 1fr; }
  .choice.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .fitem { grid-template-columns: 56px 1fr; }
  .factions { grid-column: 2 / -1; justify-content: flex-start; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cta-band { padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
