/* CVIntelli360 — SaaS theme (design tokens, light + dark) */
:root {
  --bg: #f5f8fd; --card: #ffffff; --ink: #0f172a; --muted: #64748b;
  --accent: #2563eb; --accent-dark: #1d4ed8; --accent-soft: #e3edfd;
  --accent-2: #f97316; --accent-line: #bfdbfe; --accent-disabled: #93c5fd;
  --ok: #059669; --ok-soft: #d1fae5;
  --warn: #d97706; --warn-soft: #fef3c7;
  --bad: #dc2626; --bad-soft: #fee2e2; --bad-ink: #991b1b;
  --line: #e2e8f0; --surface-2: #f8fafc; --input-bg: #ffffff;
  --bar-bg: #e9eff9; --ghost: #cbd5e1;
  --nav-bg: rgba(255,255,255,.92);
  --hero-glow: #dbeafe;
  --veil: rgba(255,255,255,.96); --veil-2: rgba(238,242,255,.9);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a1222; --card: #111c31; --ink: #e6ecf7; --muted: #93a5c4;
  --accent: #3b82f6; --accent-dark: #60a5fa; --accent-soft: #16264a;
  --accent-2: #fb923c; --accent-line: #2f4a7d; --accent-disabled: #2f4a7d;
  --ok: #34d399; --ok-soft: rgba(16,185,129,.16);
  --warn: #fbbf24; --warn-soft: rgba(245,158,11,.16);
  --bad: #f87171; --bad-soft: rgba(239,68,68,.16); --bad-ink: #fca5a5;
  --line: #22345a; --surface-2: #14213c; --input-bg: #0d1730;
  --bar-bg: #16264a; --ghost: #29406b;
  --nav-bg: rgba(10,18,34,.88);
  --hero-glow: #16264a;
  --veil: rgba(17,28,49,.96); --veil-2: rgba(22,38,74,.9);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  transition: background-color .25s ease, color .25s ease; }
main { max-width: 920px; margin: 0 auto 64px; padding: 0 20px; }

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

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--accent);
  color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0; text-decoration: none; }
.skip-link:focus { left: 0; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 22px; padding: 12px 28px; }
.nav .logo { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.nav .logo .mark { display: inline-flex; width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  align-items: center; justify-content: center; font-size: .85rem; }
.nav .logo .mark-img { border-radius: 50%; display: block; }
.nav .logo .w360, .topbar .brand .w360 { color: var(--accent-2); }
.nav a.link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.nav a.link:hover { color: var(--ink); }
.nav .spacer { margin-left: auto; }
.userbox { font-size: .85rem; color: var(--muted); }
.userbox a { color: var(--accent); }

.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 34px; height: 34px; cursor: pointer; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
  transition: border-color .15s, background-color .15s; flex-shrink: 0; }
.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- admin topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; padding: 14px 28px; margin-bottom: 24px; }
.topbar .brand { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 64px 20px 46px;
  background: radial-gradient(1100px 420px at 50% -150px, var(--hero-glow) 0%, transparent 70%); }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.9rem); letter-spacing: -.03em;
  margin: 0 0 14px; line-height: 1.12; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent-dark), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto 26px; font-size: 1.05rem; }
.hero .cta { display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 13px 28px; font-size: 1.02rem; font-weight: 600;
  cursor: pointer; text-decoration: none; box-shadow: 0 8px 20px -8px rgba(79,70,229,.6);
  transition: transform .15s ease, background-color .15s; }
.hero .cta:hover { background: var(--accent-dark); transform: translateY(-1px); }
.hero .trustline { margin-top: 16px; font-size: .8rem; color: var(--muted); }
.badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.badges span { background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: .8rem; color: var(--muted); box-shadow: var(--shadow); }

/* ---------- progress stepper ---------- */
.stepper { display: flex; justify-content: center; gap: 8px; list-style: none;
  padding: 0; margin: 4px 0 22px; }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600;
  color: var(--muted); padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); transition: .25s; }
.stepper li .dot { display: inline-flex; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bar-bg); color: var(--muted); align-items: center; justify-content: center;
  font-size: .72rem; transition: .25s; }
.stepper li.active { color: var(--accent-dark); border-color: var(--accent-line);
  background: var(--accent-soft); }
.stepper li.active .dot { background: var(--accent); color: #fff; }
.stepper li.done { color: var(--ok); border-color: var(--ok); }
.stepper li.done .dot { background: var(--ok); color: #fff; }
@media (max-width: 520px) { .stepper li { padding: 7px 10px; } }

/* ---------- cards & steps ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; margin-bottom: 20px; box-shadow: var(--shadow); }
.step h2 { margin-top: 0; letter-spacing: -.01em; }
.stepnum { display: inline-flex; width: 28px; height: 28px; border-radius: 9px;
  background: var(--accent); color: #fff; align-items: center; justify-content: center;
  font-size: .9rem; margin-right: 10px; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.hidden { display: none !important; }

.reveal { animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.dropzone { border: 2px dashed var(--accent-line); border-radius: 12px; padding: 42px; text-align: center;
  color: var(--muted); transition: .15s; cursor: pointer; background: var(--surface-2); }
.dropzone.drag, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer;
  text-decoration: underline; font-size: 1em; padding: 0; }

.status { margin-top: 14px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft);
  font-size: .93rem; }
.status.error { background: var(--bad-soft); color: var(--bad); }

select { width: 100%; padding: 11px 13px; font-size: 1rem; border-radius: 10px;
  border: 1px solid var(--line); margin: 10px 0; background: var(--input-bg); color: var(--ink); }
button.primary { background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 12px 24px; font-size: .98rem; font-weight: 600; cursor: pointer; margin-top: 10px;
  transition: background-color .15s, transform .15s ease; }
button.primary:hover { background: var(--accent-dark); }
button.primary:active { transform: scale(.98); }
button.primary:disabled { background: var(--accent-disabled); cursor: not-allowed; transform: none; }
button.secondary { background: var(--card); color: var(--accent-dark); border: 1px solid var(--accent-line);
  border-radius: 10px; padding: 10px 18px; cursor: pointer; font-weight: 600;
  transition: background-color .15s; }
button.secondary:hover { background: var(--accent-soft); }

.row { display: flex; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.row input { flex: 1; min-width: 200px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; background: var(--input-bg); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

/* ---------- summary ---------- */
.score-row { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.score-circle { width: 132px; height: 132px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.25); animation: popIn .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.score-circle .num { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.score-circle .of { font-size: .8rem; opacity: .9; }
.band-excellent { background: linear-gradient(135deg, #059669, #10b981); }
.band-good { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.band-average { background: linear-gradient(135deg, #d97706, #f59e0b); }
.band-weak { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* conic progress ring (replaces the flat score circle) */
.score-ring { --p: 0; --ring: var(--accent); width: 140px; height: 140px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--bar-bg) 0);
  animation: popIn .5s cubic-bezier(.2,1.4,.4,1) both; }
.score-ring.band-excellent { --ring: #10b981; }
.score-ring.band-good { --ring: #3b82f6; }
.score-ring.band-average { --ring: #f59e0b; }
.score-ring.band-weak { --ring: #ef4444; }
.score-ring .inner { width: 108px; height: 108px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .num { font-size: 2.4rem; font-weight: 800; line-height: 1; color: var(--ring); }
.score-ring .of { font-size: .78rem; color: var(--muted); }

.verdict { font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
.sg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 640px) { .sg-grid { grid-template-columns: 1fr; } }
.sg-grid h4 { margin: 0 0 6px; }
.sg-grid ul { margin: 0; padding-left: 18px; }
.sg-grid .s li { color: var(--ok); } .sg-grid .g li { color: var(--bad); }
.sg-grid li span { color: var(--ink); }

/* ---------- dimensions ---------- */
.dim { margin: 10px 0; }
.dim .lbl { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.bar { height: 9px; background: var(--bar-bg); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .8s cubic-bezier(.25,.9,.3,1); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; margin: 10px 0 22px; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .04em; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.tag.found { background: var(--ok-soft); color: var(--ok); }
.tag.weak { background: var(--warn-soft); color: var(--warn); }
.tag.missing { background: var(--bad-soft); color: var(--bad); }
.tag.must { background: var(--accent-soft); color: var(--accent-dark); }
.tag.nice { background: var(--surface-2); color: var(--muted); }
.tag.meets { background: var(--ok-soft); color: var(--ok); }
.tag.below { background: var(--bad-soft); color: var(--bad); }

.check-pass::before { content: "✔ "; color: var(--ok); }
.check-fail::before { content: "✘ "; color: var(--bad); }
ul.checks { list-style: none; padding: 0; }
ul.checks li { padding: 4px 0; }
ul.checks .fix { color: var(--muted); font-size: .84rem; margin-left: 20px; }

.rec { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 11px 15px;
  margin: 8px 0; border-radius: 0 10px 10px 0; }
.rec .impact { color: var(--accent-dark); font-weight: 600; font-size: .8rem; }
.rec.critical { border-color: var(--bad); background: var(--bad-soft); }
.rec.high { border-color: var(--warn); }

.upsell { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); border-color: var(--accent-line); }
.hardfail { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad-ink);
  padding: 13px 17px; border-radius: 10px; margin: 14px 0; line-height: 1.5; }

/* ---------- custom position ---------- */
.custom-pos { border: 1px dashed var(--accent-line); background: var(--surface-2); border-radius: 12px;
  padding: 18px 20px; margin-top: 12px; }
.proposal { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-top: 14px;
  background: var(--card); }
.proposal h4 { margin: 0 0 6px; }
.sources { font-size: .82rem; color: var(--muted); margin-top: 8px; }
.sources a { color: var(--accent); }

/* ---------- forms / rewrite ---------- */
.q { margin: 12px 0; }
.q label { display: block; font-size: .92rem; margin-bottom: 4px; }
.q textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: .95rem; font-family: inherit; resize: vertical; background: var(--input-bg); color: var(--ink); }
.dlbtn { display: inline-block; background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-dark); border-radius: 10px; padding: 10px 16px; margin: 4px 8px 4px 0;
  text-decoration: none; font-size: .9rem; font-weight: 600; }
.dlbtn:hover { filter: brightness(1.05); }
.diffbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin: 10px 0; font-size: .9rem; }
.diffbox .add { color: var(--ok); } .diffbox .del { color: var(--bad); text-decoration: line-through; }
.diffbox .chg { color: var(--warn); }

/* ---------- timeline ---------- */
.timeline { border-left: 3px solid var(--accent-soft); margin: 10px 0 18px 8px; padding-left: 18px; }
.timeline .tl-item { position: relative; margin-bottom: 10px; font-size: .92rem; }
.timeline .tl-item::before { content: ""; position: absolute; left: -24.5px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ---------- report top / download ---------- */
.report-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-top h2 { margin: 0; }
.dlbtn-top { margin-top: 0 !important; white-space: nowrap; }
button.primary.big { padding: 14px 28px; font-size: 1.05rem; }

.table-wrap { overflow-x: auto; }
table.corrections td.issue { color: var(--bad); }
table.corrections td.fixcol { color: var(--ok); }
table.corrections th:nth-child(1) { width: 30px; }

/* ---------- locked suggestions teaser ---------- */
.locked-wrap { position: relative; margin-top: 10px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); }
.locked-stack { padding: 14px; filter: blur(5px); opacity: .7; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 95%); }
.rec.locked { background: var(--accent-soft); border-left-color: var(--accent-line); }
.ghost-line { height: 11px; background: var(--ghost); border-radius: 6px; margin: 7px 0; }
.ghost-line.short { width: 55%; }
.locked-cta { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 20px;
  background: radial-gradient(120% 120% at 50% 40%, var(--veil) 55%, var(--veil-2)); }
.locked-cta h3 { margin: 2px 0; }
.lock-badge { font-size: 1.8rem; }

.corrections-teaser { position: relative; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; }
table.corrections.blurred { filter: blur(4px); opacity: .6; margin: 0; pointer-events: none; }
.teaser-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 18px; font-weight: 600; color: var(--accent-dark);
  background: radial-gradient(120% 120% at 50% 50%, var(--veil) 50%, var(--veil-2)); }

/* ---------- unlock modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card); border-radius: 18px; max-width: 460px; width: 100%; padding: 28px 30px;
  position: relative; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5);
  max-height: 92vh; overflow-y: auto; animation: fadeUp .25s ease both; }
.modal-close { position: absolute; top: 14px; right: 16px; border: none; background: none;
  font-size: 1.2rem; color: var(--muted); cursor: pointer; }
.modal-title { margin: 0 0 4px; }
.modal-step { margin: 18px 0 6px; font-size: 1rem; }
.benefits { list-style: none; padding: 0; margin: 14px 0; }
.benefits li { padding: 7px 0 7px 28px; position: relative; font-size: .95rem; border-bottom: 1px solid var(--line); }
.benefits li::before { content: "✓"; position: absolute; left: 0; top: 7px; color: var(--ok);
  font-weight: 800; background: var(--ok-soft); width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }

/* ---------- skeletons ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--bar-bg) 25%, var(--surface-2) 50%, var(--bar-bg) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton.line { height: 14px; margin: 10px 0; }
.skeleton.line.w60 { width: 60%; }
.skeleton.line.w40 { width: 40%; }
.skeleton.circle { width: 132px; height: 132px; border-radius: 50%; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: none; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; font-weight: 700;
  transition: transform .2s ease; flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 14px; color: var(--muted); }

footer { margin: 48px 0 28px; }
footer .footgrid { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--accent-line);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}
