/* CyberSafe · Company31 · security posture scanner
   Builds on /assets/styles.css tokens. No inline styles anywhere so the site's
   strict Content-Security-Policy (style-src 'self') is preserved. */

:root {
  --sev-crit: #C21D3B;
  --sev-high: #E0611A;
  --sev-med:  #B8860B;
  --sev-low:  #1C4FD8;
  --ok:       #147A4A;
  --term-bg:  #071026;
  --term-ink: #D7E6FF;
}
:root[data-theme="dark"], :root:not([data-theme]) {
  --sev-crit: #FF6B84;
  --sev-high: #FFA05C;
  --sev-med:  #F2C94C;
  --sev-low:  #7FB2FF;
  --ok:       #57D999;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --sev-crit: #C21D3B; --sev-high: #E0611A; --sev-med: #B8860B;
    --sev-low: #1C4FD8; --ok: #147A4A;
  }
}

/* hero tightening for a tool page */
.cs-hero { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(1.5rem, 4vw, 2.5rem); }
.cs-hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1.04; letter-spacing: -.025em; margin: 1rem 0 1.4rem; }
.cs-hero .lede { max-width: 42rem; }

/* The stake in the ground: why this scanner and not the other free ones. */
.cs-why {
  max-width: 46rem; margin-top: 1.5rem; padding: 1.1rem 1.3rem;
  border-left: 3px solid var(--accent); background: var(--fill);
  font-size: 1.02rem; line-height: 1.65; color: var(--muted);
}
.cs-why strong { color: var(--text); font-weight: 400; font-family: "Company31 Sans", "Bricolage Grotesque", serif; }
.cs-why em { color: var(--text); }
.cs-why a { color: var(--accent); }

/* The optional updates opt-in: visually inside the email field, clearly
   separate from the required consents. */
.cs-optin {
  margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--hairline);
  font-size: .95rem; color: var(--muted);
}
.cs-optin strong { color: var(--accent-strong); font-weight: 400; }

/* ---- console shell ----
   Drawn as a terminal window: square frame, a mono title strip across the top,
   no rounded chrome anywhere inside. */
.cs-consolewrap { padding-block: clamp(1rem, 3vw, 2rem) clamp(4rem, 9vw, 7rem); }
.cs-console {
  position: relative; border: 1px solid var(--card-border);
  background: var(--fill);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  padding-top: calc(clamp(1.5rem, 4vw, 2.75rem) + 2.1rem);
}
.cs-console::before {
  content: "cybersafe \00b7\0020security posture console";
  position: absolute; top: 0; left: 0; right: 0;
  font-family: "Company31 Mono", "Spline Sans Mono", ui-monospace, Menlo, monospace;
  font-weight: 500; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--faint); padding: .65rem 1.15rem;
  border-bottom: 1px solid var(--card-border);
}
.cs-h { font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: -.015em; line-height: 1.12; }
.cs-h3 { font-family: "Company31 Sans", "Bricolage Grotesque", serif; font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; margin: 0; }
.cs-sub { color: var(--muted); margin-top: .6rem; font-size: 1.05rem; max-width: 52ch; }
.cs-stage[data-active="false"] { display: none; }

/* ---- form ---- */
#scanform { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 1.6rem; }
.cs-field { display: flex; flex-direction: column; }
.cs-label { color: var(--accent); margin-bottom: .55rem; }
.cs-label::before { content: "> "; }
#url, #email, .cs-confirm-input, .cs-code-input {
  font-family: "Company31 Mono", "Spline Sans Mono", ui-monospace, Menlo, monospace;
  font-size: 1rem; color: var(--text); background: var(--ground);
  border: 1.5px solid var(--line); padding: .85rem 1rem;
  width: 100%; transition: border-color .2s ease, box-shadow .2s ease;
}
#url:focus, #email:focus, .cs-confirm-input:focus, .cs-code-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
#url::placeholder, #email::placeholder, .cs-confirm-input::placeholder, .cs-code-input::placeholder { color: var(--faint); }
.cs-hint { color: var(--faint); font-size: .9rem; margin-top: .5rem; line-height: 1.5; }
.cs-error { color: var(--sev-crit); font-size: .92rem; margin-top: .55rem; font-family: "Company31 Sans", "Bricolage Grotesque", serif; font-weight: 500; }

.cs-consent { border: 1px solid var(--hairline); padding: 1.3rem 1.4rem; margin: 0; }
.cs-consent legend { padding: 0 .5rem; margin-left: -.5rem; }
.cs-check { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem 0; font-size: 1rem; line-height: 1.5; color: var(--text); cursor: pointer; }
.cs-check + .cs-check { border-top: 1px solid var(--hairline); }
.cs-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin-top: .2rem;
  width: 22px; height: 22px; border: 1.8px solid var(--line);
  background: var(--ground); cursor: pointer; position: relative; transition: border-color .2s ease, background .2s ease;
}
.cs-check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.cs-check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid var(--btn-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.cs-check input[type="checkbox"]:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.cs-confirm { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.cs-confirm label { display: block; margin-bottom: .5rem; }

/* email verification stage */
#verifyform { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 1.6rem; }
.cs-code-input {
  max-width: 11ch; text-align: center;
  font-size: 1.35rem; letter-spacing: .45em;
}
#verifyform .labbtn { margin-top: 0; }

/* ownership stage (unlocks deep scan) */
.cs-ownsteps { margin: 1.8rem 0 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.cs-ownsteps li { font-size: 1.02rem; line-height: 1.55; color: var(--text); }
.cs-mono, code.cs-mono {
  font-family: "Company31 Mono", "Spline Sans Mono", ui-monospace, Menlo, monospace; font-size: .92em;
  color: var(--accent); word-break: break-all;
}
.cs-owncontent { margin-top: .7rem; user-select: all; }
.cs-ownurl { display: inline-block; margin-top: .2rem; }
#stage-own .cs-actions { margin-top: 1.8rem; }

/* tier badge on the report */
.cs-tier {
  display: inline-block; margin: .3rem 0 .1rem; padding: .25rem .6rem;
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--chip-border);
}
.cs-tier[data-tier="deep"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.cs-tier[data-tier="standard"] { color: var(--muted); }

.cs-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.4rem; }
/* Buttons squared to match the terminal frame (scoped here; core .btn untouched
   elsewhere). .labbtn is the quiet secondary command, defined only on this page. */
.cs-console .btn { border-radius: 0; }
.labbtn {
  font-family: "Company31 Mono", "Spline Sans Mono", ui-monospace, Menlo, monospace; font-weight: 500;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); background: none; border: 1px solid var(--line);
  padding: .65rem 1.1rem; cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.labbtn:hover { border-color: var(--accent); background: var(--ground); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled::after { opacity: 0; }
.cs-legalnote { color: var(--faint); font-size: .82rem; max-width: 30ch; }

/* ---- progress + terminal ---- */
.cs-runhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
#run-target { margin-top: .3rem; overflow-wrap: anywhere; }
.cs-cancel { margin-top: 0; padding: .5rem 1.1rem; font-size: .9rem; }

.cs-progress {
  position: relative; margin-top: 1.6rem; height: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 10%, var(--ground)); overflow: hidden;
}
.cs-progress-bar {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.cs-progress-pct { position: absolute; right: .1rem; top: 1.4rem; color: var(--faint); font-size: .7rem; }

.cs-terminal {
  margin-top: 2.2rem; background: var(--term-bg); border: 1px solid var(--card-border);
  height: clamp(260px, 42vh, 420px); overflow-y: auto;
  padding: 1rem 1.1rem; scroll-behavior: smooth;
}
.cs-terminal-inner {
  font-family: "Company31 Mono", "Spline Sans Mono", ui-monospace, Menlo, monospace;
  font-size: .82rem; line-height: 1.7; color: var(--term-ink);
}
.cs-line { display: flex; gap: .7rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-line .t { color: #5C7BB5; flex: none; }
.cs-line .m { color: var(--term-ink); }
.cs-line.ok  .m { color: #57D999; }
.cs-line.warn .m { color: #F2C94C; }
.cs-line.bad  .m { color: #FF6B84; }
.cs-line.info .m { color: #7FB2FF; }
.cs-line.head .m { color: #FFFFFF; font-weight: 500; }
.cs-cursor { display: inline-block; width: 8px; background: var(--term-ink); animation: cs-blink 1.1s steps(1) infinite; }
@keyframes cs-blink { 50% { opacity: 0; } }

/* ---- report ---- */
.cs-report-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.4rem, 4vw, 2.6rem); align-items: center; }
.cs-score { position: relative; width: 132px; height: 132px; flex: none; }
.cs-ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.cs-ring-track { fill: none; stroke: var(--hairline); stroke-width: 9; }
.cs-ring-val {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1);
}
.cs-score-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cs-grade { font-family: "Company31 Sans", "Bricolage Grotesque", serif; font-weight: 600; font-size: 2.6rem; line-height: 1; color: var(--text); }
.cs-scoreline { color: var(--faint); font-size: .68rem; margin-top: .25rem; }
.cs-report-verdict { margin-top: .9rem; font-size: 1.12rem; color: var(--muted); max-width: 48ch; }
.cs-report-verdict b { color: var(--text); font-weight: 400; }
.cs-report-meta { color: var(--faint); font-size: .72rem; margin-top: .8rem; }

/* category strip */
.cs-catgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-top: 2.2rem; }
.cs-cat { border: 1px solid var(--card-border); padding: .9rem 1rem; background: var(--ground); }
.cs-cat .n { font-family: "Company31 Mono", "Spline Sans Mono", monospace; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.cs-cat .g { font-family: "Company31 Sans", "Bricolage Grotesque", serif; font-weight: 600; font-size: 1.5rem; margin-top: .3rem; display: block; }
.cs-cat .d { font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.cs-cat[data-tone="bad"]  .g { color: var(--sev-crit); }
.cs-cat[data-tone="warn"] .g { color: var(--sev-med); }
.cs-cat[data-tone="ok"]   .g { color: var(--ok); }

/* priorities */
.cs-priorities { margin-top: 2.4rem; }
.cs-prio-list { margin: 1rem 0 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .7rem; }
.cs-prio-list li { font-size: 1.02rem; color: var(--text); line-height: 1.5; }
.cs-prio-list li .sev { font-family: "Company31 Mono", "Spline Sans Mono", monospace; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; padding: .1rem .45rem; margin-right: .5rem; vertical-align: middle; }

/* findings */
.cs-findings { margin-top: 2.6rem; display: flex; flex-direction: column; gap: 2rem; }
.cs-fgroup > h3 { display: flex; align-items: baseline; gap: .7rem; }
.cs-fgroup > h3 .count { font-family: "Company31 Mono", "Spline Sans Mono", monospace; font-size: .72rem; color: var(--faint); font-weight: 400; }
.cs-fitem { border: 1px solid var(--card-border); margin-top: .8rem; background: var(--ground); overflow: hidden; }
.cs-fitem summary {
  cursor: pointer; list-style: none; padding: 1rem 1.2rem; display: flex; gap: .8rem; align-items: baseline;
  font-family: "Company31 Sans", "Bricolage Grotesque", serif; font-weight: 500; font-size: 1.02rem;
}
.cs-fitem summary::-webkit-details-marker { display: none; }
.cs-fitem summary .sev { font-family: "Company31 Mono", "Spline Sans Mono", monospace; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; padding: .18rem .5rem; flex: none; align-self: center; }
.cs-fitem summary .title { flex: 1; }
.cs-fitem summary::after { content: "+"; font-family: "Company31 Mono", "Spline Sans Mono", monospace; color: var(--accent); flex: none; }
.cs-fitem[open] summary::after { content: "\2013"; }
.cs-fbody { padding: 0 1.2rem 1.2rem; border-top: 1px solid var(--hairline); }
.cs-fbody p { margin-top: .9rem; font-size: .98rem; line-height: 1.6; color: var(--muted); }
.cs-fbody p b { color: var(--text); font-weight: 400; }
.cs-fbody .cs-evidence {
  font-family: "Company31 Mono", "Spline Sans Mono", monospace; font-size: .78rem; color: var(--text);
  background: var(--fill); border: 1px solid var(--hairline);
  padding: .7rem .8rem; margin-top: .8rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cs-fbody .cs-std { margin-top: .8rem; }
.cs-fbody .cs-std .chip {
  font-family: "Company31 Mono", "Spline Sans Mono", monospace; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--chip-border); border-radius: 0; padding: .25rem .6rem; margin: .2rem .35rem .2rem 0; display: inline-block;
}

.sev-crit { background: color-mix(in srgb, var(--sev-crit) 16%, transparent); color: var(--sev-crit); }
.sev-high { background: color-mix(in srgb, var(--sev-high) 16%, transparent); color: var(--sev-high); }
.sev-med  { background: color-mix(in srgb, var(--sev-med) 18%, transparent);  color: var(--sev-med); }
.sev-low  { background: color-mix(in srgb, var(--sev-low) 16%, transparent);  color: var(--sev-low); }
.sev-pass { background: color-mix(in srgb, var(--ok) 16%, transparent);       color: var(--ok); }
.sev-info { background: var(--fill); color: var(--muted); }

.cs-report-actions { margin-top: 2.8rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.cs-report-actions .labbtn { margin-top: 0; }
.cs-disclaimer { margin-top: 1.6rem; font-size: .8rem; color: var(--faint); line-height: 1.6; max-width: 70ch; }

/* what-it-checks grid */
.cs-method { text-align: left; }
.cs-method h2 { text-align: center; font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.02em; }
/* Ruled entries under hairlines, matching the drawing language of the home
   page — no boxed cards. */
.cs-checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 2.5rem; margin-top: 2.6rem; }
.cs-checkcard { border-top: 1px solid var(--hairline); padding: 1rem 0 1.3rem; }
.cs-checkcard .mono { color: var(--accent); display: block; }
.cs-checkcard p { margin-top: .6rem; font-size: .98rem; color: var(--muted); line-height: 1.55; }
.cs-standards { max-width: 68ch; margin: 2.6rem auto 0; text-align: center; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.cs-standards b { color: var(--text); font-weight: 400; }

/* status banner (errors / rate limit) */
.cs-banner { padding: 1rem 1.2rem; margin-top: 1.4rem; font-size: .98rem; line-height: 1.5; }
.cs-banner[data-tone="error"] { background: color-mix(in srgb, var(--sev-crit) 12%, var(--ground)); border: 1px solid var(--sev-crit); color: var(--text); }
.cs-banner[data-tone="warn"]  { background: color-mix(in srgb, var(--sev-med) 14%, var(--ground)); border: 1px solid var(--sev-med); color: var(--text); }

@media (max-width: 620px) {
  .cs-report-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .cs-actions { flex-direction: column; align-items: stretch; }
  .cs-actions .btn { width: 100%; text-align: center; }
  .cs-legalnote { max-width: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-progress-bar, .cs-ring-val { transition: none; }
  .cs-cursor { animation: none; }
  .cs-terminal { scroll-behavior: auto; }
}

/* print / PDF */
@media print {
  header, footer, .cs-hero, .cs-method, .faq, .cs-report-actions, .cs-cancel, #stage-form, #stage-verify, #stage-own, #stage-run, .themebtn { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .cs-console { border: none; background: #fff; padding: 0; }
  .cs-console::before { display: none; }
  .cs-consolewrap { padding: 0; }
  .cs-fitem { break-inside: avoid; border-color: #ccc; }
  .cs-fitem[open] .cs-fbody, .cs-fbody { display: block !important; }
  .cs-fitem summary::after { display: none; }
  details.cs-fitem { page-break-inside: avoid; }
  .cs-ring-val { stroke: #000; }
  a { color: #000; text-decoration: underline; }
}
