/* ============================================================
   IR35 Compliance Copilot, styles.
   Matched to the IT Retirement Planning website: Objektiv
   (Adobe Fonts) for display and body, Roboto Mono for tags,
   with Figtree as fallback. Electric blue #2563EB to deep blue
   #1E40AF gradient, graphite navy #0F1520. Semantic result
   colours (red / green / amber) are kept for at-a-glance meaning;
   amber is reserved for genuine warnings. Mobile first.
   ============================================================ */

:root {
  /* Brand primitives */
  --blue:    #2563EB;   /* electric blue accent */
  --blue-dk: #1E40AF;   /* deep blue, gradient end */
  --navy:    #0F1520;   /* graphite ink */

  /* Accent tint (replaces the old category gold on structural accents) */
  --accent-bg:   rgba(37, 99, 235, 0.08);
  --accent-line: rgba(37, 99, 235, 0.28);

  /* Warning tone, reserved for genuine cautions (review flags, do-not-issue) */
  --warn:      #8A631E;
  --warn-bg:   rgba(176, 129, 46, 0.10);
  --warn-line: rgba(176, 129, 46, 0.38);

  /* Semantic tokens */
  --canvas:    #FFFFFF;
  --surface:   #FFFFFF;
  --surface-2: #F3F5F9;
  --ink:       #0F1520;
  --ink-soft:  #3D4653;
  --ink-faint: #667085;
  --line:      #E4E8EF;
  --line-soft: #EEF1F6;
  --accent:    var(--blue);
  --focus:     var(--blue);
  --on-accent: #FFFFFF;

  --grad: linear-gradient(135deg, var(--blue) 0%, var(--blue-dk) 100%);

  /* Result semantics */
  --inside:   #B4402E;   --inside-bg:  #FBEDEA;   --inside-line:  rgba(180,64,46,0.30);
  --outside:  #1E7A54;   --outside-bg: #E9F5EF;   --outside-line: rgba(30,122,84,0.30);
  --border-c: #8A631E;   --border-bg:  var(--warn-bg);

  /* Type */
  --font-display: "objektiv-variable", "Figtree", system-ui, sans-serif;
  --font-body:    "objektiv-variable", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Shape & depth */
  --radius:      14px;
  --radius-lg:   20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15,21,32,0.06), 0 1px 3px rgba(15,21,32,0.05);
  --shadow-md: 0 6px 20px -8px rgba(15,21,32,0.16), 0 2px 6px rgba(15,21,32,0.05);
  --shadow-lg: 0 20px 48px -20px rgba(15,21,32,0.28);

  --wrap: 760px;
  --header-h: 64px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.14; color: var(--navy); margin: 0 0 0.4em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 5.4vw, 2.7rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.75rem); letter-spacing: -0.02em; }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
p  { margin: 0 0 1em; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
strong { color: var(--ink); font-weight: 600; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ---------- Tag / eyebrow ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-bg);
  border: 1px solid var(--accent-line);
  padding: 5px 12px; border-radius: var(--radius-pill);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; color: var(--navy); text-decoration: none; font-size: 1.04rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}
.header-link { font-size: 0.86rem; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.header-link:hover { color: var(--blue); text-decoration: none; }

/* ---------- Privacy strip ---------- */
.privacy-strip {
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 0.82rem; color: var(--ink-soft);
}
.privacy-strip .wrap { display: flex; align-items: center; gap: 9px; padding: 9px 20px; }
.privacy-strip svg { flex: none; color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 48px 0 10px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20px -30% 0 -30%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52% 46% at 82% -8%, rgba(37,99,235,0.14), transparent 70%),
    radial-gradient(44% 40% at 6% 4%, rgba(30,64,175,0.10), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(15,21,32,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,21,32,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(75% 62% at 60% 0%, #000 0%, transparent 78%);
          mask-image: radial-gradient(75% 62% at 60% 0%, #000 0%, transparent 78%);
}
.hero h1 { margin-top: 16px; max-width: 18ch; }
.hero p.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; margin-top: 4px; }
.hero p.lede strong { color: var(--ink); font-weight: 600; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 26px; margin: 22px 0;
}
.card--flat { box-shadow: none; background: var(--surface-2); }
.section { padding: 22px 0 52px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.97rem;
  padding: 12px 24px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--grad); color: var(--on-accent); box-shadow: var(--shadow-md); }
.btn--primary:hover { box-shadow: var(--shadow-lg); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--gold { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--gold:hover { background: var(--blue-dk); box-shadow: var(--shadow-md); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Wizard ---------- */
.progress { margin: 10px 0 22px; }
.progress__bar { height: 8px; background: var(--line-soft); border-radius: var(--radius-pill); overflow: hidden; }
.progress__fill { height: 100%; background: var(--grad); border-radius: var(--radius-pill); transition: width .35s cubic-bezier(.4,0,.2,1); }
.progress__label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); margin-top: 9px; text-transform: uppercase; letter-spacing: 0.06em; }

.step-head { margin-bottom: 6px; }
.step-head .tag { margin-bottom: 14px; }
.step-head h2 { margin-bottom: 6px; }

fieldset { border: none; margin: 0; padding: 0; }
legend { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--navy); margin-bottom: 6px; }

.question { margin: 24px 0; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.question:first-of-type { border-top: none; padding-top: 4px; }
.question__text { font-weight: 600; font-size: 1.06rem; margin-bottom: 5px; color: var(--navy); }
.question__why { font-size: 0.88rem; color: var(--ink-faint); margin-bottom: 14px; line-height: 1.5; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; background: var(--surface);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.option:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.option input { margin-top: 2px; accent-color: var(--blue); flex: none; width: 18px; height: 18px; }
.option--selected { border-color: var(--blue); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--blue); }
.option__label { font-size: 0.97rem; line-height: 1.45; }

/* Intake form fields */
.field { margin: 18px 0; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 7px; color: var(--navy); }
.field input {
  width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.field .hint { font-size: 0.82rem; color: var(--ink-faint); margin-top: 5px; }

/* Info note */
.note {
  background: var(--accent-bg); border: 1px solid var(--accent-line);
  border-radius: var(--radius); padding: 14px 16px; font-size: 0.9rem; color: var(--ink-soft);
  margin: 14px 0;
}
.note strong { color: var(--navy); }

/* ---------- Results ---------- */
.result-banner {
  position: relative; border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 6px;
  border: 1px solid transparent; box-shadow: var(--shadow-sm); overflow: hidden;
}
.result-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.result-banner--inside  { background: var(--inside-bg);  border-color: var(--inside-line); }
.result-banner--inside::before  { background: var(--inside); }
.result-banner--outside { background: var(--outside-bg); border-color: var(--outside-line); }
.result-banner--outside::before { background: var(--outside); }
.result-banner--borderline { background: var(--border-bg); border-color: var(--warn-line); }
.result-banner--borderline::before { background: var(--border-c); }
.result-banner .tag { background: var(--surface); }
.result-banner h2 { margin: 10px 0 6px; }
.result-banner--inside h2  { color: var(--inside); }
.result-banner--outside h2 { color: var(--outside); }
.result-banner--borderline h2 { color: var(--border-c); }

.confidence { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 10px; color: var(--ink-soft); }
.confidence__dot { width: 9px; height: 9px; border-radius: 50%; }
.confidence--high .confidence__dot { background: var(--outside); }
.confidence--medium .confidence__dot { background: var(--warn); }
.confidence--low .confidence__dot { background: var(--inside); }

.test-block { margin: 20px 0; }
.test-block h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.pill { font-family: var(--font-mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: var(--radius-pill); font-weight: 500; }
.pill--inside  { color: var(--inside);  background: var(--inside-bg); }
.pill--outside { color: var(--outside); background: var(--outside-bg); }
.pill--neutral { color: var(--ink-faint); background: var(--surface-2); }

.reason-list { list-style: none; padding: 0; margin: 8px 0 0; }
.reason-list li { padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 0.93rem; color: var(--ink-soft); line-height: 1.5; }
.reason-list li:first-child { border-top: none; }
.reason-list .ans { font-weight: 600; color: var(--ink); }

.evidence-list { list-style: none; padding: 0; margin: 0; }
.evidence-list li { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.evidence-list li:first-child { border-top: none; }
.evidence-list .check { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--accent); border-radius: 6px; margin-top: 2px; background: var(--accent-bg); }
.evidence-list .etitle { font-weight: 600; color: var(--navy); }
.evidence-list .edetail { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

/* Escalation blocks */
.escalation { border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 22px; margin: 20px 0; }
.escalation h3 { margin-bottom: 7px; }
.escalation p { margin-bottom: 12px; }
.escalation .btn { margin-top: 2px; }
.escalation--specialist { border-left-color: var(--inside); background: var(--inside-bg); }
.regbar { font-size: 0.78rem; color: var(--ink-faint); margin: 14px 0 0; line-height: 1.5; }

/* Cross-referral */
.xref { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 12px; }
.xref a { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; text-decoration: none; color: var(--ink); background: var(--surface); transition: border-color .12s, box-shadow .12s, transform .06s; }
.xref a:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); transform: translateY(-1px); text-decoration: none; }
.xref .xt { display: block; font-weight: 600; color: var(--navy); font-family: var(--font-display); letter-spacing: -0.01em; }
.xref .xb { display: block; font-size: 0.86rem; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }

/* Disclaimer / footer / flags */
.disclaimer { font-size: 0.82rem; color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 34px; line-height: 1.55; }
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; margin-top: 44px; font-size: 0.85rem; color: var(--ink-faint); background: var(--surface); }
.site-footer a { color: var(--ink-soft); }

.review-flag {
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--warn);
  background: var(--warn-bg); border: 1px dashed var(--warn-line);
  border-radius: 10px; padding: 10px 12px; margin: 12px 0; line-height: 1.5;
}

@media (min-width: 620px) {
  .xref { grid-template-columns: 1fr 1fr; }
}

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