/* =========================================================
   Handbook Studio — Faulkner HR Solutions design system
   Brand tokens mirror faulknerhrsolutions.info/css/styles.css
   ========================================================= */
:root {
  --navy: #1B3A52;
  --navy-dark: #122839;
  --navy-light: #2A4F6E;
  --gold: #C49A3C;
  --gold-light: #D4AE5A;
  --gold-dark: #A07E28;
  --off-white: #F8F7F4;
  --light-gray: #EEF0F2;
  --mid-gray: #8A9BAD;
  --dark-text: #1A1A2E;
  --white: #FFFFFF;
  --green: #2E7D4F;
  --green-bg: #E7F3EC;
  --red: #B3372B;
  --red-bg: #FBEAE7;
  --amber: #9C6E1B;
  --amber-bg: #FCF3E1;
  --blue: #2A5B8A;
  --blue-bg: #E9F1F8;
  --shadow-sm: 0 2px 8px rgba(27,58,82,0.08);
  --shadow-md: 0 6px 24px rgba(27,58,82,0.12);
  --shadow-lg: 0 16px 48px rgba(27,58,82,0.18);
  --radius: 6px;
  --radius-lg: 12px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark-text);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-serif); color: var(--navy); line-height: 1.25; }
h1 { font-size: 2.1rem; margin: 0 0 .6em; }
h2 { font-size: 1.5rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; }
h4 { font-size: 1rem; margin: 1em 0 .3em; color: var(--navy); }
p { margin: 0 0 1em; }
a { color: var(--navy-light); }
a:hover { color: var(--gold-dark); }
small, .muted { color: #5b6b7b; }
hr { border: 0; border-top: 1px solid var(--light-gray); margin: 1.5rem 0; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.page-main { min-height: 62vh; padding: 32px 20px 64px; }

/* Accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header / footer ---------- */
.site-header { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; flex-wrap: wrap; }
.header-inner-full { max-width: none; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.12rem; color: #fff; }
.brand-product { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: #e8edf2; text-decoration: none; font-size: .92rem; font-weight: 500; }
.site-nav a:hover { color: var(--gold-light); }
.nav-user { color: var(--mid-gray); font-size: .85rem; }
.project-title-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-name { font-weight: 600; color: #fff; }
.plan-chip, .version-chip {
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; border: 1px solid rgba(255,255,255,.25); color: #dfe7ee;
}
.plan-pro, .plan-consult { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }

.site-footer { background: var(--navy-dark); color: #b9c6d2; margin-top: 48px; font-size: .85rem; }
.footer-inner { padding: 32px 20px; display: grid; gap: 14px; }
.site-footer a { color: var(--gold-light); text-decoration: none; }
.footer-links { display: flex; gap: 18px; }
.footer-legal { color: #7d8fa0; font-size: .78rem; line-height: 1.5; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: .95rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: all .2s ease; text-align: center;
}
.btn-gold { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: #e8edf2; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: var(--gold-light); color: var(--gold-light); }
.btn-quiet { background: var(--light-gray); color: var(--navy); }
.btn-quiet:hover { background: #dfe4e8; }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #e5b8b1; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
button.linklike { background: none; border: 0; color: var(--navy-light); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- Flash / notices ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .93rem; border: 1px solid; }
.flash-ok { background: var(--green-bg); color: var(--green); border-color: #bfdccb; }
.flash-err { background: var(--red-bg); color: var(--red); border-color: #e5b8b1; }
.flash-info { background: var(--blue-bg); color: var(--blue); border-color: #bcd2e4; }
.notice { padding: 14px 18px; border-radius: var(--radius); font-size: .9rem; margin: 14px 0; border-left: 4px solid; }
.notice-info { background: var(--blue-bg); border-color: var(--blue); }
.notice-warn { background: var(--amber-bg); border-color: var(--amber); }
.notice-risk { background: var(--red-bg); border-color: var(--red); }
.notice-legal { background: var(--light-gray); border-color: var(--mid-gray); color: #44525f; }

/* ---------- Cards / panels ---------- */
.card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 26px; margin-bottom: 20px; border: 1px solid #e6eaee; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-tight { padding: 18px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Landing ---------- */
.hero { background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 70%, var(--navy-light) 100%); color: #fff; border-radius: var(--radius-lg); padding: 60px 48px; margin-bottom: 36px; box-shadow: var(--shadow-md); }
.hero h1 { color: #fff; font-size: 2.5rem; max-width: 21ch; }
.hero .kicker { color: var(--gold-light); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 600; margin-bottom: 14px; }
.hero p.lead { font-size: 1.12rem; color: #d5dee6; max-width: 60ch; }
.hero-actions { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { font-size: .8rem; color: var(--mid-gray); margin-top: 14px; }
.step-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 30px 0; }
@media (max-width: 900px) { .step-strip { grid-template-columns: repeat(2, 1fr); } }
.step-chip { background: #fff; border: 1px solid #e6eaee; border-radius: var(--radius); padding: 14px 12px; font-size: .82rem; box-shadow: var(--shadow-sm); }
.step-chip .n { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--gold-light); font-weight: 700; font-size: .75rem; text-align: center; line-height: 22px; margin-bottom: 6px; }
.step-chip strong { display: block; color: var(--navy); font-size: .88rem; }

/* ---------- Forms ---------- */
form { margin: 0; }
.field { margin-bottom: 18px; }
.field label, .field > .flabel { display: block; font-weight: 600; font-size: .92rem; color: var(--navy); margin-bottom: 6px; }
.field .req { color: var(--red); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number],
.field input[type=date], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #c6d0d9; border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--dark-text);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-light); outline: 3px solid rgba(196,154,60,.35); outline-offset: 0; }
.field .fhelp { font-size: .82rem; color: #5b6b7b; margin-top: 5px; }
.field .ferror { font-size: .82rem; color: var(--red); margin-top: 5px; font-weight: 500; }
.field.has-error input, .field.has-error select { border-color: var(--red); }
fieldset { border: 1px solid #dbe2e8; border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
legend { font-weight: 600; color: var(--navy); font-size: .95rem; padding: 0 8px; }
.choice-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px; }
.choice-row input { margin-top: 4px; flex-shrink: 0; }
.choice-row label { font-weight: 400; margin: 0; }
.choice-row .cnote { display: block; font-size: .8rem; color: #5b6b7b; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card label {
  display: block; border: 2px solid #d5dde4; border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; font-weight: 500; background: #fff; height: 100%;
}
.choice-card label strong { display: block; color: var(--navy); margin-bottom: 3px; }
.choice-card label .cnote { font-size: .8rem; color: #5b6b7b; font-weight: 400; }
.choice-card input:checked + label { border-color: var(--gold); background: #fdf9f0; box-shadow: var(--shadow-sm); }
.choice-card input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.inline-fields { display: flex; gap: 14px; flex-wrap: wrap; }
.inline-fields .field { flex: 1 1 200px; }

/* Conditional groups */
.cond-group { border-left: 3px solid var(--gold-light); padding-left: 18px; margin: 14px 0 14px 4px; }
.cond-hidden { display: none; }

/* Why-this-matters disclosure */
details.why { margin-top: 8px; font-size: .85rem; }
details.why summary { cursor: pointer; color: var(--navy-light); font-weight: 500; }
details.why .why-body { background: var(--blue-bg); border-radius: var(--radius); padding: 10px 14px; margin-top: 6px; color: #33475a; }

/* ---------- Studio layout ---------- */
.studio-body { background: var(--off-white); }
.studio-layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 64px); }
@media (max-width: 980px) { .studio-layout { grid-template-columns: 1fr; } .stage-rail { position: static; display: flex; overflow-x: auto; } }
.stage-rail { background: #fff; border-right: 1px solid #e2e8ed; padding: 20px 14px; }
.stage-link {
  display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--dark-text);
  padding: 12px 12px; border-radius: var(--radius); margin-bottom: 4px; border: 1px solid transparent; min-width: 200px;
}
.stage-link:hover { background: var(--off-white); }
.stage-link.active { background: var(--navy); color: #fff; }
.stage-link.active .stage-sub { color: var(--mid-gray); }
.stage-link.active .stage-name { color: #fff; }
.stage-marker {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; text-align: center; line-height: 24px;
  font-size: .8rem; font-weight: 700; border: 2px solid var(--mid-gray); color: var(--mid-gray); background: #fff;
}
.stage-done .stage-marker { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.stage-attention .stage-marker { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.stage-link.active .stage-marker { border-color: var(--gold); color: var(--gold-light); background: var(--navy-dark); }
.stage-name { display: block; font-weight: 600; font-size: .92rem; color: var(--navy); }
.stage-sub { display: block; font-size: .76rem; color: #5b6b7b; }
.rail-note { font-size: .74rem; color: #7d8fa0; padding: 16px 12px 0; border-top: 1px solid var(--light-gray); margin-top: 14px; line-height: 1.5; }
.studio-main { padding: 30px 34px 70px; max-width: 1020px; }
@media (max-width: 700px) { .studio-main { padding: 20px 16px 60px; } }
.stage-head { margin-bottom: 22px; }
.stage-head h1 { margin-bottom: .2em; }
.stage-head .stage-lede { color: #45535f; max-width: 68ch; }

/* Progress bar */
.progressbar { background: var(--light-gray); border-radius: 20px; height: 10px; overflow: hidden; margin: 8px 0 4px; }
.progressbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); border-radius: 20px; }
.progress-label { font-size: .8rem; color: #5b6b7b; }

/* ---------- Classification badges ---------- */
.cls-badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 4px; border: 1px solid; white-space: nowrap;
}
.cls-required { background: var(--red-bg); color: var(--red); border-color: #e0a89f; }
.cls-conditional { background: var(--amber-bg); color: var(--amber); border-color: #e2c489; }
.cls-recommended { background: #fdf6e7; color: var(--gold-dark); border-color: var(--gold-light); }
.cls-practice { background: var(--blue-bg); color: var(--blue); border-color: #a9c4da; }
.cls-optional { background: var(--green-bg); color: var(--green); border-color: #a9cdb8; }
.cls-preference { background: var(--light-gray); color: #44525f; border-color: #c3ccd4; }
.cls-existing { background: #f2eefa; color: #5b4a8a; border-color: #c8bce0; }
.cls-legal { background: var(--navy); color: var(--gold-light); border-color: var(--navy); }
.cls-decision { background: #fff; color: var(--navy); border-color: var(--navy-light); }
.cls-neutral { background: var(--light-gray); color: #44525f; border-color: #c3ccd4; }

/* Decision layer tags */
.layer-tag { display: inline-block; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--light-gray); color: #44525f; }
.layer-employee_rule { background: var(--blue-bg); color: var(--blue); }
.layer-leadership { background: #fdf6e7; color: var(--gold-dark); }
.layer-supervisor { background: #f2eefa; color: #5b4a8a; }
.layer-legal { background: var(--navy); color: var(--gold-light); }

/* ---------- Workbench ---------- */
.module-list { display: flex; flex-direction: column; gap: 10px; }
.module-row {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e2e8ed;
  border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--dark-text);
}
.module-row:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.module-row .m-title { font-weight: 600; color: var(--navy); flex: 1; }
.module-row .m-status { font-size: .78rem; color: #5b6b7b; white-space: nowrap; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-done { background: var(--green); }
.dot-partial { background: var(--amber); }
.dot-todo { background: #c3ccd4; }
.dot-excluded { background: var(--mid-gray); }

.policy-block { background: #fff; border: 1px solid #e2e8ed; border-radius: var(--radius-lg); margin-bottom: 18px; overflow: hidden; }
.policy-block-head { padding: 16px 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--light-gray); }
.policy-block-head h3 { margin: 0; flex: 1; font-size: 1.06rem; }
.policy-block-body { padding: 18px 22px; }
.decision { border-top: 1px dashed #dbe2e8; padding: 16px 0; }
.decision:first-child { border-top: 0; }
.decision .dprompt { font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.decision .dhelp { font-size: .85rem; color: #5b6b7b; margin-bottom: 10px; max-width: 70ch; }
.unsure-row { margin-top: 8px; font-size: .83rem; color: #5b6b7b; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Findings ---------- */
.finding { background: #fff; border: 1px solid #e2e8ed; border-left-width: 5px; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }
.finding-high { border-left-color: var(--red); }
.finding-warn { border-left-color: var(--amber); }
.finding-info { border-left-color: var(--blue); }
.finding-resolved { opacity: .62; border-left-color: var(--green); }
.finding .f-title { font-weight: 600; color: var(--navy); }
.finding .f-detail { font-size: .9rem; color: #45535f; margin: 6px 0 10px; max-width: 78ch; }
.sev-chip { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 4px; }
.sev-high { background: var(--red-bg); color: var(--red); }
.sev-warn { background: var(--amber-bg); color: var(--amber); }
.sev-info { background: var(--blue-bg); color: var(--blue); }
.sev-resolved { background: var(--green-bg); color: var(--green); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.data th { background: var(--navy); color: #fff; text-align: left; padding: 10px 14px; font-weight: 600; font-size: .82rem; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--light-gray); vertical-align: top; }
table.data tr:hover td { background: #fbfaf7; }

/* ---------- Editor / preview ---------- */
.editor-layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; }
@media (max-width: 1000px) { .editor-layout { grid-template-columns: 1fr; } }
.toc-panel { background: #fff; border: 1px solid #e2e8ed; border-radius: var(--radius); padding: 14px; align-self: start; position: sticky; top: 16px; max-height: 85vh; overflow-y: auto; }
.toc-panel a { display: block; padding: 6px 10px; text-decoration: none; color: var(--dark-text); font-size: .86rem; border-radius: 4px; }
.toc-panel a:hover { background: var(--off-white); }
.toc-cat { font-weight: 700; color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin: 12px 10px 4px; }
.doc-preview { background: #fff; border: 1px solid #e2e8ed; border-radius: var(--radius); padding: 40px 48px; }
.doc-preview h2 { font-size: 1.3rem; border-bottom: 2px solid var(--gold); padding-bottom: 6px; }
.doc-preview h3 { font-size: 1.05rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
.compare .pane { border: 1px solid #e2e8ed; border-radius: var(--radius); padding: 16px; font-size: .88rem; background: #fff; }
.compare .pane h4 { margin-top: 0; }
.pane-standard { background: var(--off-white); }
.pane-edited { border-color: var(--gold-light); }

/* Variable chips inside previews */
.var-chip { background: #fdf6e7; border: 1px dashed var(--gold); border-radius: 4px; padding: 0 5px; font-size: .92em; color: var(--gold-dark); }

/* ---------- CTA panels ---------- */
.cta-panel { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); color: #dfe7ee; border-radius: var(--radius-lg); padding: 26px 30px; margin: 24px 0; }
.cta-panel h3 { color: #fff; margin-top: 0; }
.cta-panel .btn { margin-top: 8px; }
.cta-quiet { border: 1px solid var(--gold-light); background: #fdf9f0; color: var(--dark-text); border-radius: var(--radius); padding: 16px 20px; margin: 18px 0; font-size: .92rem; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.plan-card { background: #fff; border: 1px solid #e2e8ed; border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; }
.plan-card.featured { border: 2px solid var(--gold); box-shadow: var(--shadow-md); }
.plan-card h3 { margin-top: 0; }
.plan-card ul { padding-left: 20px; margin: 12px 0 20px; flex: 1; }
.plan-card li { margin-bottom: 7px; font-size: .92rem; }
.plan-price { font-family: var(--font-serif); font-size: 1.6rem; color: var(--navy); font-weight: 700; }

/* ---------- Misc ---------- */
.badge-count { background: var(--gold); color: var(--navy-dark); border-radius: 12px; font-size: .72rem; font-weight: 700; padding: 1px 8px; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 6px 18px; font-size: .92rem; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; } }
.kv dt { font-weight: 600; color: var(--navy); }
.kv dd { margin: 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px solid var(--light-gray); }
.checklist li::before { content: '\2713'; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.checklist li.pending::before { content: '\25CB'; color: var(--mid-gray); }
.tag { display: inline-block; background: var(--light-gray); border-radius: 4px; padding: 2px 8px; font-size: .75rem; color: #44525f; margin: 0 4px 4px 0; }

@media print {
  .site-header, .site-footer, .stage-rail, .form-actions, .btn, .flash { display: none !important; }
  body { background: #fff; }
  .studio-layout { display: block; }
}
