/* =============================================================================
   calcagent shell.css  —  shared stylesheet for all site pages
   Mobile-first (375 px base). Classes are intentionally minimal and stable;
   do NOT rename or remove selectors — the DOM contract depends on them.
   ============================================================================= */

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/* ── Design tokens ───────────────────────────────────────────────────────────── */
:root {
  --c-bg:       #ffffff;
  --c-surface:  #f8fafc;
  --c-border:   #e2e8f0;
  --c-text:     #1a1a2e;
  --c-muted:    #64748b;
  --c-accent:   #2563eb;
  --c-accent-h: #1d4ed8;
  --c-success:  #16a34a;
  --font:       system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
                Roboto, Helvetica, Arial, sans-serif;
  --radius:     6px;
  --max-w:      680px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

/* ── Base ────────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Skip link (accessibility) ───────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  background: var(--c-accent);
  color: #fff;
  padding: 10px 18px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 200;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; outline: 3px solid var(--c-accent-h); outline-offset: 2px; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
header {
  background: var(--c-text);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
#site-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
#site-brand:hover { opacity: .85; }

/* ── Main ────────────────────────────────────────────────────────────────────── */
#page {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

#page-title {
  font-size: clamp(1.45rem, 5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.025em;
  margin-bottom: 8px;
}

#page-intro {
  color: var(--c-muted);
  font-size: .95rem;
  margin-bottom: 20px;
}

/* ── Ad slots ────────────────────────────────────────────────────────────────── */
.ad-slot {
  min-height: 90px;
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-border);
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ad-slot::after { content: 'Advertisement'; }

/* ── Tool body ───────────────────────────────────────────────────────────────── */
#tool-body {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* ── Affiliate slot ──────────────────────────────────────────────────────────── */
#affiliate-slot { min-height: 40px; margin: 8px 0; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 20px 16px;
  text-align: center;
  font-size: .82rem;
  color: var(--c-muted);
}
#site-footer nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
#site-footer a { color: var(--c-accent); text-decoration: none; }
#site-footer a:hover { text-decoration: underline; }

/* ── Consent banner ──────────────────────────────────────────────────────────── */
#consent-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e293b;
  color: #f1f5f9;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 150;
  box-shadow: 0 -2px 8px rgba(0,0,0,.2);
  font-size: .85rem;
  line-height: 1.4;
}
#consent-banner p { flex: 1; min-width: 180px; }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
#consent-accept {
  background: var(--c-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
#consent-accept:hover { background: var(--c-accent-h); }
#consent-reject {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #475569;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: .85rem;
  cursor: pointer;
}
#consent-reject:hover { border-color: #94a3b8; color: #f1f5f9; }

/* ── Form primitives (deterministic) ─────────────────────────────────────────── */
.field-group { margin-bottom: 14px; }
.field-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.field-group input[type="number"],
.field-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: #fff;
  color: var(--c-text);
  -moz-appearance: textfield;
  appearance: textfield;
}
.field-group input[type="number"]::-webkit-inner-spin-button,
.field-group input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.field-group input:focus {
  outline: 2px solid var(--c-accent);
  outline-offset: 1px;
  border-color: transparent;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  width: 100%;
  margin-top: 4px;
  transition: filter .1s ease;
}
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: transparent;
  color: var(--c-accent);
  border: 1.5px solid var(--c-accent);
}
.btn-secondary:hover { background: #eff6ff; }

/* ── Result display (deterministic) ──────────────────────────────────────────── */
#tool-result {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--c-border);
}
.result-row:last-child { border-bottom: none; }
.result-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.result-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--c-text);
}
[data-result] { display: inline; }

/* ── Step nav (interactive) ──────────────────────────────────────────────────── */
.step-header { margin-bottom: 16px; }
.step-header h2 { font-size: 1.1rem; font-weight: 700; }
.step-header p { font-size: .875rem; color: var(--c-muted); margin-top: 4px; }
.step-nav {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.step-nav .btn { width: auto; flex: 1; min-width: 100px; }

/* ── Checklist (interactive) ─────────────────────────────────────────────────── */
.checklist { list-style: none; display: grid; gap: 8px; margin: 12px 0; }
.checklist li label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: .95rem;
  transition: background .1s, border-color .1s;
}
.checklist li label:has(input:checked) {
  background: #f0fdf4;
  border-color: #86efac;
  color: var(--c-muted);
  text-decoration: line-through;
}
.checklist input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--c-success);
}

/* ── Reference / glossary ────────────────────────────────────────────────────── */
#content-body { line-height: 1.75; }
#content-body h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
#content-body dl { display: grid; gap: 18px; }
#content-body dt { font-weight: 700; }
#content-body dd { color: var(--c-muted); font-size: .95rem; margin-top: 2px; }
[data-claim] { border-bottom: 1px dotted var(--c-border); cursor: help; }
#sources {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
#sources h2 {
  font-size: .75rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
#sources ol { padding-left: 20px; display: grid; gap: 4px; }
#sources li { font-size: .8rem; color: var(--c-muted); }
#sources a { color: var(--c-accent); text-decoration: none; }
#sources a:hover { text-decoration: underline; }

/* ── Legal pages ─────────────────────────────────────────────────────────────── */
.legal-body { max-width: var(--max-w); margin: 0 auto; padding: 24px 16px 56px; }
.legal-body h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.legal-body .updated { font-size: .8rem; color: var(--c-muted); margin-bottom: 24px; }
.legal-body h2 { font-size: 1rem; font-weight: 700; margin: 20px 0 6px; }
.legal-body p, .legal-body li { font-size: .9rem; color: var(--c-muted); margin-bottom: 8px; }
.legal-body ul { padding-left: 20px; }
.legal-body a { color: var(--c-accent); }

/* ── Responsive enhancements (≥ 480 px) ──────────────────────────────────────── */
@media (min-width: 480px) {
  #page { padding: 32px 24px 72px; }
  #tool-body { padding: 24px; }
  .field-group input[type="number"],
  .field-group input[type="text"] { width: auto; min-width: 220px; }
}
