/* WAF Sizing Tool - stylesheet */

:root {
  --ink: #1f2933;
  --ink-soft: #52616f;
  --muted: #7a8894;
  --line: #e2e8ef;
  --line-soft: #eef2f6;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --navy: #1f3b57;
  --navy-soft: #2c5c86;
  --accent: #2c5c86;
  --good: #16a34a;
  --warn: #ca8a04;
  --bad: #dc2626;
  --vendor: #2c5c86;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .05), 0 8px 24px rgba(16, 32, 48, .05);
  --font: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

.wrap { width: min(1220px, 100% - 40px); margin-inline: auto; }

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.85rem; margin: 0 0 6px; }
h2 { font-size: 1.22rem; margin: 0 0 4px; }
h3 { font-size: 1rem; margin: 22px 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.prose { max-width: 62ch; color: var(--ink-soft); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { display: flex; }
.brand-text strong { display: block; font-size: .96rem; color: var(--navy); }
.brand-text small { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a {
  padding: 7px 13px; border-radius: 8px; text-decoration: none;
  color: var(--ink-soft); font-size: .9rem; font-weight: 500;
}
.topnav a:hover { background: var(--line-soft); }
.topnav a.is-active { background: var(--navy); color: #fff; }

.topbar-auth { display: flex; align-items: center; gap: 12px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-soft); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 600;
}
.tag { font-style: normal; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; }
.tag-sandbox { background: #fef3c7; color: #92400e; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 17px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: background .13s, border-color .13s, color .13s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #17304a; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: #c3cfdb; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-lg { padding: 12px 24px; font-size: .98rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.inline { display: inline; }

/* ---------- flash / notices ---------- */
.flash { margin-top: 16px; padding: 11px 15px; border-radius: 9px; font-size: .9rem; border: 1px solid; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.flash-warn    { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }

.notice {
  margin: 18px 0; padding: 13px 16px; border-radius: 10px; font-size: .88rem;
  background: #f0f6ff; border: 1px solid #d5e4f7; color: #1e3a5f;
}
.notice-warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }

/* ---------- hero ---------- */
.hero {
  display: flex; gap: 40px; align-items: flex-start; justify-content: space-between;
  padding: 34px 0 6px;
}
.hero p { max-width: 68ch; color: var(--ink-soft); }
.hero-stats { display: flex; gap: 10px; flex-shrink: 0; }
.hero-stats div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; text-align: center; min-width: 88px;
}
.hero-stats strong { display: block; font-size: 1.5rem; color: var(--navy); }
.hero-stats span { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- form ---------- */
.card-form { display: grid; gap: 18px; padding-bottom: 60px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px 24px; box-shadow: var(--shadow); margin: 0;
}
.card legend {
  font-weight: 700; color: var(--navy); font-size: .95rem;
  padding: 0 8px; margin-left: -8px;
}
.field-intro { font-size: .86rem; color: var(--muted); margin: -2px 0 14px; }

.grid { display: grid; gap: 16px 20px; margin-top: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
label small { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.sr-label { font-weight: 600; }

input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: .9rem; color: var(--ink); background: var(--surface);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(44, 92, 134, .3); outline-offset: 1px; border-color: var(--accent);
}
textarea { resize: vertical; }

.range-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.range-row input[type=range] { flex: 1; accent-color: var(--navy); }
.range-row output {
  min-width: 46px; text-align: right; font-weight: 700; color: var(--navy); font-size: .92rem;
}

.checkgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400;
  transition: border-color .13s, background .13s;
}
.check:hover { border-color: #c3cfdb; }
.check input { margin-top: 3px; accent-color: var(--navy); flex-shrink: 0; }
.check:has(input:checked) { border-color: var(--navy); background: #f5f9fd; }
.check strong { display: block; font-size: .84rem; color: var(--ink); }
.check small { display: block; font-size: .75rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.vendorgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vendor {
  display: flex; gap: 10px; align-items: center; padding: 14px;
  border: 1px solid var(--line); border-left: 4px solid var(--vendor);
  border-radius: 10px; cursor: pointer; font-weight: 400;
}
.vendor:has(input:checked) { background: #f5f9fd; border-color: var(--vendor); border-left-color: var(--vendor); }
.vendor input { accent-color: var(--vendor); }
.vendor strong { display: block; font-size: .88rem; color: var(--ink); }
.vendor small { display: block; font-size: .74rem; color: var(--muted); }

.form-actions { display: flex; align-items: center; gap: 18px; }

/* ---------- results ---------- */
.result-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding: 28px 0 20px;
}
.result-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.back { font-size: .82rem; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--accent); }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.panel-head { margin-bottom: 16px; }
.panel-head p { font-size: .88rem; margin: 0; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

/* vendor comparison cards */
.vendor-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.vcard {
  display: flex; flex-direction: column; gap: 4px; padding: 16px;
  border: 1px solid var(--line); border-top: 3px solid var(--vendor);
  border-radius: 11px; text-decoration: none; color: inherit; background: var(--surface);
  transition: box-shadow .14s, transform .14s, border-color .14s;
}
.vcard:hover { box-shadow: 0 6px 20px rgba(16, 32, 48, .1); transform: translateY(-1px); }
.vcard.is-selected { border-color: var(--vendor); background: #f8fbfe; box-shadow: 0 0 0 2px rgba(44, 92, 134, .12); }
.vcard.is-empty { opacity: .62; }
.vcard header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vcard-oem { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--vendor); font-weight: 700; }
.vcard-model { font-size: 1.16rem; color: var(--navy); }
.vcard-form { font-size: .78rem; color: var(--muted); }
.vcard-specs { display: flex; gap: 14px; margin: 10px 0 8px; }
.vcard-specs div { flex: 1; }
.vcard-specs dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.vcard-specs dd { margin: 1px 0 0; font-size: .85rem; font-weight: 600; color: var(--ink); }
.vcard-alt { font-size: .74rem; color: var(--muted); margin-top: 8px; }

.util { margin-top: auto; }
.util-bar { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.util-bar span { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.util-high .util-bar span { background: var(--bad); }
.util-low  .util-bar span { background: var(--warn); }
.util-label { display: block; font-size: .74rem; color: var(--muted); margin-top: 5px; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 600; background: var(--line-soft); color: var(--ink-soft);
}
.pill-selected { background: var(--navy); color: #fff; }
.pill-small { font-size: .64rem; padding: 1px 6px; }
.pill-support { background: #eef2ff; color: #3730a3; }
.pill-subscription { background: #ecfdf5; color: #065f46; }
.pill-bundle { background: #fef3c7; color: #92400e; }
.pill-management { background: #f1f5f9; color: #334155; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th, .table td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th {
  background: var(--navy); color: #fff; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; border-bottom: none;
}
.table thead th:first-child { border-top-left-radius: 8px; }
.table thead th:last-child { border-top-right-radius: 8px; }
.table tbody tr:hover { background: #fafcfe; }
.table-kv th { width: 38%; background: #f7fafc; font-weight: 600; color: var(--ink-soft); }
.table-compact th, .table-compact td { padding: 6px 9px; font-size: .8rem; }
.table-scroll { overflow-x: auto; }
tr.is-pick { background: #f5fbf7; }

.workings { margin: 0; padding-left: 20px; font-size: .86rem; color: var(--ink-soft); }
.workings li { margin-bottom: 6px; }

.more-models { margin-top: 20px; }
.more-models summary, details.panel summary {
  cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); margin-bottom: 12px;
}

/* ---------- diagrams ---------- */
.diagram-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.tabs { display: flex; gap: 4px; background: var(--line-soft); padding: 4px; border-radius: 9px; flex-shrink: 0; }
.tab {
  border: none; background: transparent; font: inherit; font-size: .84rem; font-weight: 600;
  padding: 6px 14px; border-radius: 7px; cursor: pointer; color: var(--ink-soft);
}
.tab.is-active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.diagram { display: none; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; background: #fff; }
.diagram.is-active { display: block; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- export ---------- */
.panel-export { border-color: #d5e4f7; background: linear-gradient(180deg, #fbfdff, #ffffff); }
.export-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.btn-export {
  justify-content: flex-start; gap: 13px; padding: 15px 18px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.btn-export:hover { border-color: #c3cfdb; box-shadow: var(--shadow); }
.btn-export .fmt {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: #fff; font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.btn-word  .fmt { background: #2b579a; }
.btn-ppt   .fmt { background: #c43e1c; }
.btn-excel .fmt { background: #217346; }
.btn-export strong { display: block; font-size: .9rem; }
.btn-export small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
.export-status { font-size: .8rem; margin: 12px 0 0; }

/* ---------- catalogue ---------- */
.vendor-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.vendor-tab {
  padding: 8px 16px; border-radius: 9px; text-decoration: none; font-size: .88rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--vendor); color: var(--ink-soft);
}
.vendor-tab.is-active { background: var(--vendor); color: #fff; border-color: var(--vendor); }

/* ---------- projects ---------- */
.project-list { display: grid; gap: 12px; padding-bottom: 50px; }
.project {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px;
}
.project h2 { font-size: 1.05rem; margin: 0 0 3px; }
.project h2 a { text-decoration: none; }
.project p { font-size: .84rem; margin: 0; }
.project-meta { font-size: .76rem; margin-top: 4px; }
.project-actions { display: flex; gap: 6px; flex-shrink: 0; }

.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 60px 30px; text-align: center; margin: 24px 0 60px;
}
.empty p { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.empty .btn { margin-top: 14px; }

/* ---------- sign in ---------- */
.signin { display: grid; place-items: center; padding: 50px 0 80px; }
.signin-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 36px 38px; max-width: 620px; box-shadow: var(--shadow);
}
.signin-form { display: grid; gap: 14px; margin-top: 20px; }
.signin-meta { display: grid; gap: 8px; margin-top: 24px; font-size: .82rem; }
.signin-meta div { display: flex; gap: 12px; }
.signin-meta dt { color: var(--muted); min-width: 70px; }
.signin-meta dd { margin: 0; color: var(--ink-soft); }
.signin-alt { margin-top: 24px; font-size: .86rem; }

/* ---------- footer ---------- */
.sitefoot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.sitefoot-inner {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 18px 0; font-size: .8rem; color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .vendor-cards, .vendorgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .wrap { width: calc(100% - 28px); }
  .hero { flex-direction: column; gap: 22px; }
  .grid-2, .grid-3, .split, .export-row { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .result-head, .project { flex-direction: column; align-items: flex-start; }
  .diagram-head { flex-direction: column; }
}
@media (max-width: 560px) {
  .vendor-cards, .vendorgrid, .checkgrid { grid-template-columns: 1fr; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; min-width: 0; }
}


/* ------------------------------------------------------------------ */
/* WAF-specific pieces                                                 */
/* ------------------------------------------------------------------ */

/* The four demand figures, shown as a strip above the result. */
.demand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 18px;
}
.demand-cell { background: var(--surface); padding: 12px 16px; }
.demand-cell .k { font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.demand-cell .v { font-size: 1.12rem; font-weight: 600; color: var(--navy); margin-top: 2px; }
.demand-cell .n { font-size: .78rem; color: var(--muted); }

/* The inspection pipeline, as an ordered list of stages. */
.pipeline { list-style: none; margin: 0; padding: 0; }
.pipeline li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pipeline li:last-child { border-bottom: 0; }
.pipeline .step {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  background: var(--stage, var(--accent));
}
.pipeline .what { font-weight: 600; }
.pipeline .why { font-size: .86rem; color: var(--muted); }

/* Licence type pills reuse the shared .pill styles; add the ones the
   firewall tool did not need. */
.pill-module { background: #eef2ff; color: #4338ca; }
.pill-platform { background: #ecfeff; color: #0e7490; }

/* Compare tray at the foot of the catalogue. */
.tray {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 0;
  margin-top: 18px;
  box-shadow: 0 -6px 18px rgba(16, 32, 48, .06);
}
.tray-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tray strong { color: var(--navy); }

/* The methodology page reads like a document rather than a form. */
.method h2 { margin-top: 28px; }
.method .formula {
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: .9rem;
  background: #f4f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0 16px;
  overflow-x: auto;
}

/* Fieldset grouping on the long requirements form. */
.fset { border: 0; margin: 0 0 6px; padding: 0; }
.fset > legend {
  font-weight: 600;
  color: var(--navy);
  font-size: 1.02rem;
  padding: 0;
  margin: 0 0 4px;
}
.fset > .hint { color: var(--muted); font-size: .88rem; margin: 0 0 14px; }

/* Pass / fail marking on the shortlist comparison. */
.is-pass { background: #f0fdf4; color: #15803d; }
.is-fail { background: #fef2f2; color: #b91c1c; }
.is-fail small { display: block; color: #b91c1c; opacity: .8; }

/* ------------------------------------------------------------------ */
/* Fit scoring: how well a shortlisted model matches the requirement   */
/* ------------------------------------------------------------------ */

.fitgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.fitcard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  background: var(--surface);
  border-top: 3px solid var(--vendor, var(--accent));
}
.fitcard header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.fitcard-oem {
  font-size: .72rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--vendor, var(--muted));
  font-weight: 700;
}
.fitcard-model { font-size: 1rem; color: var(--navy); }

.fitscore { display: flex; align-items: baseline; gap: 10px; }
.fitpct { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--ink); }
.fitpct small { font-size: 1rem; font-weight: 600; color: var(--muted); margin-inline-start: 1px; }
.fitverdict { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.fitbar {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
  margin: 10px 0 10px;
}
.fitbar span { display: block; height: 100%; border-radius: 4px; }

.fit-good .fitverdict { color: var(--good); }
.fit-good .fitbar span { background: var(--good); }
.fit-warn .fitverdict { color: var(--warn); }
.fit-warn .fitbar span { background: var(--warn); }
.fit-bad  .fitverdict { color: var(--bad); }
.fit-bad  .fitbar span { background: var(--bad); }

.fitwhy { margin: 0 0 12px; font-size: .86rem; color: var(--ink-soft); }

.fitmeta { margin: 0; display: grid; gap: 6px; }
.fitmeta div { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; }
.fitmeta dt { color: var(--muted); margin: 0; }
.fitmeta dd { margin: 0; font-weight: 600; text-align: end; }

/* The "% of need" note under a short figure in the comparison table. */
.cover { display: block; font-size: .72rem; opacity: .85; }

/* Compact fit readout used on the result page next to a chosen model. */
.fitline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.fitline .fitpct { font-size: 1.4rem; }
.fitline .fitbar { flex: 1 1 140px; margin: 0; min-width: 120px; }
