/* ===== Swasti Bharat — v7 legal / policy pages ==========================
   Companion to v7-shared.css (auto-linked by head.php). Adds ONLY the
   legal-specific chrome: serif hero, sticky table-of-contents, prose body,
   callouts, policy tables, cookie toggles and the refund promise strip.
   Tokens / .container / .breadcrumb / buttons / footer live in v7-shared.css
   and are reused as-is — nothing here redefines them.
   Used by privacy.php, terms.php, refund.php, cookies.php.
   ======================================================================== */

/* === HERO (Fraunces serif, loaded globally in head.php) === */
.legal-hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 100%); }
.legal-hero h1 { font-family: 'Fraunces', serif; font-size: 56px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; color: var(--ink); margin-bottom: 16px; max-width: 800px; }
.legal-hero .lead { font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 720px; margin-bottom: 24px; }
.legal-meta { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.legal-meta .stamp { background: var(--bg); border: 1px solid var(--line); padding: 8px 14px; border-radius: var(--r-full); font-weight: 600; color: var(--ink-2); }
.legal-meta .stamp strong { color: var(--ink); }
.legal-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.legal-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--teal-bright); color: white; border-radius: var(--r-full); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.legal-badge.plum { background: var(--plum); }
.legal-badge.saffron { background: var(--saffron-deep); }

/* === TOC + BODY GRID === */
.legal-shell { padding: 56px 0 96px; }
.legal-grid { display: grid; grid-template-columns: 240px 1fr; gap: 64px; align-items: start; }

.legal-toc { position: sticky; top: 100px; }
.legal-toc h5 { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.legal-toc ul { list-style: none; border-left: 2px solid var(--line); padding-left: 0; }
.legal-toc li { margin: 0; }
.legal-toc a { display: block; padding: 8px 0 8px 16px; margin-left: -2px; border-left: 2px solid transparent; font-size: 13px; color: var(--muted); font-weight: 500; transition: all 0.15s; line-height: 1.4; }
.legal-toc a:hover { color: var(--ink); }
.legal-toc a.active { color: var(--ink); font-weight: 700; border-left-color: var(--saffron); }
.legal-toc .actions { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.legal-toc .actions a { padding: 0; border: none; font-size: 13px; color: var(--plum); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; cursor: pointer; text-align: left; }
/* full-width TOC call-to-action button (cookies "manage preferences", refund "request") */
.legal-toc .toc-btn { display: block; margin-top: 20px; padding: 14px 18px; border-radius: var(--r-md); text-align: center; font-weight: 700; font-size: 14px; color: white; background: var(--ink); }
.legal-toc .toc-btn:hover { background: var(--plum); }
.legal-toc .toc-btn.saffron { background: var(--saffron); }
.legal-toc .toc-btn.saffron:hover { background: var(--saffron-bright); }

/* === PROSE BODY === */
.legal-body { max-width: 760px; font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.legal-body section { padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.legal-body section:last-child { border-bottom: none; }
.legal-body h2 { font-family: 'Inter Tight', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 16px; line-height: 1.2; }
.legal-body h2 .sec-num { color: var(--muted); font-weight: 500; margin-right: 8px; font-family: 'Fraunces', serif; font-style: italic; }
.legal-body h3 { font-family: 'Inter Tight', sans-serif; font-size: 17px; font-weight: 800; color: var(--ink); margin: 24px 0 10px; }
.legal-body p { margin-bottom: 16px; }
.legal-body ul, .legal-body ol { margin: 0 0 16px 22px; }
.legal-body li { margin-bottom: 8px; line-height: 1.6; }
.legal-body a { color: var(--plum); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.legal-body strong { color: var(--ink); font-weight: 700; }

/* callouts */
.legal-body .callout { background: var(--saffron-soft); border-left: 4px solid var(--saffron); padding: 20px 24px; border-radius: var(--r-md); margin: 24px 0; font-size: 15px; }
.legal-body .callout strong { display: block; margin-bottom: 4px; color: var(--saffron-deep); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.legal-body .callout.plum { background: var(--plum-soft); border-left-color: var(--plum); }
.legal-body .callout.plum strong { color: var(--plum); }
.legal-body .callout.success { background: #DEF7E5; border-left-color: var(--jade); }
.legal-body .callout.success strong { color: var(--jade); }
.legal-body .callout.danger { background: #FFE5E1; border-left-color: #B83830; }
.legal-body .callout.danger strong { color: #B83830; }

/* policy tables */
.legal-body table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 14px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.legal-body th { background: var(--bg-soft); color: var(--ink); font-weight: 700; padding: 12px 16px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
.legal-body td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-body tr:last-child td { border-bottom: none; }

/* worked-example box (refund) */
.legal-body .example { padding: 16px 20px; background: var(--bg-soft); border-radius: var(--r-md); margin-top: 12px; font-size: 14px; }
.legal-body .example .lbl { display: inline-block; font-size: 11px; font-weight: 800; color: var(--saffron-deep); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }

/* dark contact card at the foot of the prose */
.legal-body .legal-contact { background: var(--plum-darker); color: white; border-radius: var(--r-xl); padding: 32px; margin-top: 48px; }
.legal-body .legal-contact h3 { font-family: 'Inter Tight', sans-serif; color: white; font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.legal-body .legal-contact p { color: rgba(255,255,255,0.8); font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.legal-body .legal-contact a { color: var(--saffron-bright); font-weight: 700; }

/* === REFUND: three-promise strip === */
.refund-promise { padding: 56px 0; }
.promise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.promise-card { padding: 28px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); transition: all 0.2s; }
.promise-card:hover { border-color: var(--saffron); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.promise-card .num { font-family: 'Fraunces', serif; font-size: 44px; font-weight: 500; color: var(--saffron-deep); line-height: 1; display: block; margin-bottom: 16px; letter-spacing: -0.03em; }
.promise-card h3 { font-family: 'Inter Tight', sans-serif; font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 8px; letter-spacing: -0.01em; }
.promise-card p { font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* === COOKIES: category cards + presentational toggles === */
.cookie-cat { padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 16px; transition: all 0.15s; }
.cookie-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.cookie-cat-head h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; }
.cookie-cat-head h3 .badge { font-size: 10px; padding: 3px 8px; border-radius: var(--r-full); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.cookie-cat-head h3 .badge.always { background: var(--jade); color: white; }
.cookie-cat-head h3 .badge.opt { background: var(--saffron-soft); color: var(--saffron-deep); }
.cookie-cat p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin-bottom: 12px; }
.cookie-cat table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cookie-cat th { background: var(--bg-soft); color: var(--ink); font-weight: 700; padding: 10px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
.cookie-cat td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cookie-cat tr:last-child td { border-bottom: none; }
.cookie-cat td code { font-family: 'DM Mono', monospace; font-size: 12px; background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; color: var(--ink); }

/* toggle switch — built around a real checkbox input, kept presentational */
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line-strong); border-radius: var(--r-full); transition: background 0.2s; pointer-events: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: var(--shadow-sm); transition: left 0.2s; }
.switch input:checked ~ .track { background: var(--saffron); }
.switch input:checked ~ .track::after { left: 20px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled ~ .track { background: var(--jade); }
.switch input:disabled:checked ~ .track::after { left: 20px; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .legal-grid { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc { position: static; padding: 20px; background: var(--bg-soft); border-radius: var(--r-lg); }
  .legal-hero h1 { font-size: 40px; }
  .promise-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .legal-hero h1 { font-size: 34px; }
}
