/* Firewall Selector 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; }
.empty .btn + .btn { margin-inline-start: 8px; }

/* ---------- manual model picker ---------- */
.picker {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #f7fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; margin-bottom: 18px;
}
.picker label { font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin: 0; }
.picker select { width: auto; min-width: 300px; max-width: 100%; margin: 0; }
.picker small { flex-basis: 100%; font-size: .76rem; color: var(--muted); }
.pill-manual { background: #fef3c7; color: #92400e; }

/* ---------- comparison tray ---------- */
.nav-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-inline-start: 6px; padding: 0 5px; border-radius: 9px;
  background: var(--navy); color: #fff; font-size: .68rem; font-weight: 700;
}
.topnav a.is-active .nav-count { background: #fff; color: var(--navy); }

.compare-pick {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.compare-pick-label { font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
.chip-check {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .82rem; font-weight: 500; cursor: pointer; background: var(--surface);
}
.chip-check:has(input:checked) { border-color: var(--vendor); background: #f5f9fd; }
.chip-check input { accent-color: var(--vendor); margin: 0; }

.col-compare { width: 64px; text-align: center; }
.col-compare input { accent-color: var(--navy); }
tr.is-ticked { background: #f5f9fd; }
.form-actions-sm { margin-top: 12px; gap: 12px; }

/* ---------- comparison table ---------- */
.compare-table { font-size: .84rem; }
.compare-table thead th { vertical-align: bottom; padding: 10px 12px; }
.compare-table thead th:first-child { text-align: left; }
.compare-oem {
  display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em;
  opacity: .75; margin-bottom: 2px;
}
.compare-table thead th strong { display: block; font-size: .92rem; }
.compare-remove {
  border: none; background: transparent; color: rgba(255, 255, 255, .6);
  font-size: 1rem; line-height: 1; cursor: pointer; padding: 2px 4px; margin-top: 4px;
}
.compare-remove:hover { color: #fff; }
.compare-rowhead {
  text-align: left; background: #f7fafc; font-weight: 600; color: var(--ink-soft);
  width: 210px; white-space: nowrap;
}
.compare-rowhead.is-critical { color: var(--navy); }
.compare-rowhead.is-critical::after {
  content: "required"; display: block; font-size: .64rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.compare-need { background: #fbfdff; color: var(--muted); font-size: .8rem; white-space: nowrap; width: 110px; }
.compare-table td { text-align: left; }
.compare-table .cell-pass { background: #f2fbf6; }
.compare-table .cell-fail { background: #fef4f3; color: #9f1d17; }
.compare-table td.is-best { font-weight: 700; }
.compare-table td.is-best::after {
  content: "best"; margin-inline-start: 6px; font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--good);
}
.compare-text td { color: var(--ink-soft); font-size: .8rem; }
.compare-verdict td { padding-top: 10px; padding-bottom: 10px; }
.verdict { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.verdict-pass { background: #dcfce7; color: #14532d; }
.verdict-fail { background: #fee2e2; color: #7f1d1d; }
.verdict-why { display: block; margin-top: 4px; font-size: .7rem; color: var(--muted); line-height: 1.35; }
.util-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.util-chip-pass { background: #dcfce7; color: #14532d; }
.util-chip-warn { background: #fef3c7; color: #92400e; }
.util-chip-fail { background: #fee2e2; color: #7f1d1d; }
.util-chip-none { background: var(--line-soft); color: var(--muted); }

.compare-legend { margin: 14px 0 0; font-size: .78rem; }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin: 0 4px 0 12px; vertical-align: -1px; }
.key-pass { background: #d6f3e3; }
.key-fail { background: #fbdbd8; }
.key-best { background: var(--good); }

.compare-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.compare-notes article { border-inline-start: 3px solid var(--vendor); padding-inline-start: 14px; }
.compare-notes h3 { margin-top: 0; }

/* ---------- 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; }
}
