/* CyberPOAM demo app — shares the marketing design language. Self-contained. */

:root {
  --bg: #ffffff; --bg-alt: #f7f9fc; --bg-deep: #0f1b2d;
  --ink: #0f1b2d; --ink-soft: #3a4658; --muted: #5a6675; --line: #e2e8f1;
  --primary: #13294b; --primary-2: #1d3a6b; --accent: #c8810a; --accent-2: #e09a1f;
  --sev-critical: #b3261e; --sev-high: #d9580a; --sev-medium: #b8860b; --sev-low: #2f7d4f; --sev-info: #5a6675;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.08);
  --shadow-sm: 0 1px 3px rgba(15,27,45,.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg-alt); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { color: var(--primary); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--primary-2); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: .72rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.lead { font-size: 1.05rem; color: var(--ink-soft); }
.link { color: var(--primary-2); text-decoration: underline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem; cursor: pointer; border: 1.5px solid transparent; transition: .15s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-2); }
.btn--accent { background: var(--accent); color: #1a1206; }
.btn--accent:hover { background: var(--accent-2); }
.btn--ghost { background: #fff; color: var(--primary); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--primary); }
.btn--sm { padding: 7px 13px; font-size: .85rem; }
.btn--lg { padding: 14px 28px; font-size: 1.05rem; }

/* App chrome */
.app-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.app-header__inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.app-logo__img { max-height: 38px; width: auto; display: block; }
.app-header__right { display: flex; align-items: center; gap: 16px; }
.app-user { font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.app-main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.app-footer { background: var(--bg-deep); color: #8593a8; font-size: .8rem; }
.app-footer__inner { max-width: 1180px; margin: 0 auto; padding: 22px 24px; }

/* Notices */
.notice { border-radius: var(--radius-sm); padding: 14px 16px; margin: 12px 0; }
.notice--ok { background: #e9f5ee; border: 1px solid #b8e0c8; color: #1d5536; }
.notice--err { background: #fdecea; border: 1px solid #f3c0bb; color: #8a241c; }
.notice h2 { color: inherit; margin-top: 0; }

/* Forms */
.form { display: grid; gap: 14px; }
.form label { font-weight: 600; font-size: .88rem; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.form input, .form select, .form textarea, .env-grid select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: #fff; }
.form input:focus, .form select:focus, .env-grid select:focus { outline: 2px solid var(--primary-2); border-color: var(--primary-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Registration gate ---- */
.gate { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; padding-top: 18px; }
.gate--narrow { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
.gate__benefits { list-style: none; padding: 0; margin: 18px 0; }
.gate__benefits li { padding: 7px 0 7px 28px; position: relative; color: var(--ink-soft); }
.gate__benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--sev-low); font-weight: 800; }
.gate__privacy { background: #eef3fb; border: 1px solid #d4e0f1; border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; color: var(--ink-soft); }
.gate__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.gate__card-sub { font-size: .9rem; color: var(--muted); margin: -2px 0 16px; }

/* ---- Tool ---- */
.freshness { display: flex; align-items: center; gap: 10px; background: #eef3fb; border: 1px solid #d4e0f1; color: var(--ink-soft); border-radius: var(--radius-sm); padding: 9px 14px; font-size: .85rem; margin-bottom: 18px; }
.freshness__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sev-low); flex: none; }
.freshness--stale { background: #fdf4e6; border-color: #f0dcb4; }
.freshness--stale .freshness__dot { background: var(--accent); }

.tool__intro { margin-bottom: 20px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.panel__title { font-size: 1rem; margin-bottom: 10px; }
.panel__sub { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.panel__opt { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.panel--brand { margin-top: 20px; }
.logo-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.logo-preview img { max-height: 44px; max-width: 170px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }

.dropzone { border: 2px dashed #c3cee0; border-radius: var(--radius); padding: 26px; text-align: center; cursor: pointer; transition: .15s; background: var(--bg-alt); }
.dropzone:hover, .dropzone:focus { border-color: var(--accent); background: #fffdf8; }
.dropzone.is-drag { border-color: var(--accent); background: #fff6e8; }
.dropzone__icon { font-size: 1.8rem; color: var(--accent); }
.dropzone__title { font-weight: 600; margin: 8px 0 2px; }
.dropzone__hint { font-size: .8rem; color: var(--muted); margin: 0; }
.dropzone__actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sample-pick { font-size: .85rem; color: var(--muted); font-weight: 600; }
.sample-select { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: .85rem; color: var(--ink); background: #fff; }
.sample-select:focus { outline: 2px solid var(--primary-2); border-color: var(--primary-2); }
.file-name { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }

.detected { margin-top: 14px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.detected__head { font-size: .85rem; margin: 0 0 8px; }
.detected__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.detected__list li { display: flex; justify-content: space-between; font-size: .8rem; gap: 8px; }
.detected__list span { color: var(--muted); }
.detected__list code { color: var(--primary); }

.env-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.env-grid label { font-weight: 600; font-size: .85rem; color: var(--ink-soft); display: block; margin-bottom: 4px; }

.tool__run { display: flex; align-items: center; gap: 16px; margin: 22px 0; }
.status-msg { font-size: .9rem; color: var(--ink-soft); }

/* ---- Analysis animation ---- */
.analysis { display: flex; gap: 22px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin: 8px 0 4px; }
.analysis__scan { flex: none; width: 96px; height: 96px; border-radius: 12px; padding: 8px;
  background: linear-gradient(180deg, #0f1b2d, #1d3a6b); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.scanner-icon { width: 100%; height: 100%; display: block; }
.scanner-icon .doc { filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
/* The magnifier ONLY animates while the overlay is rendered (it is display:none
   when hidden, which pauses CSS animations entirely). */
.mag { animation: cp-mag 1.9s ease-in-out infinite alternate; }
@keyframes cp-mag {
  from { transform: translate(-4px, -8px); }
  to   { transform: translate(2px, 34px); }
}
.analysis__main { flex: 1; min-width: 0; }
.analysis__title { font-weight: 700; color: var(--primary); margin: 0 0 12px; font-size: 1.05rem; }
.analysis__file { color: var(--ink-soft); font-weight: 600; }
.analysis__bar { height: 8px; background: var(--bg-alt); border-radius: 5px; overflow: hidden; position: relative; }
.analysis__bar-fill { display: block; height: 100%; width: 0; border-radius: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .4s ease; }
.analysis__bar-fill::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%);
  animation: cp-shimmer 1.1s linear infinite; }
@keyframes cp-shimmer { to { transform: translateX(100%); } }
.analysis__steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.astep { display: flex; align-items: center; gap: 9px; font-size: .85rem; color: var(--muted); transition: color .2s; }
.astep__icon { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.astep.is-active { color: var(--ink); }
.astep.is-active .astep__icon { border-color: var(--accent); border-top-color: transparent; animation: cp-spin .6s linear infinite; }
.astep.is-done { color: var(--ink-soft); }
.astep.is-done .astep__icon { border-color: var(--sev-low); background: var(--sev-low); }
.astep.is-done .astep__icon::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 11px;
  font-weight: 800; display: grid; place-items: center; }
@keyframes cp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .mag, .analysis__bar-fill::after, .astep.is-active .astep__icon { animation: none; }
}

/* ---- Results ---- */
.results__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 14px; flex-wrap: wrap; }
.results__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.export-group { display: inline-flex; align-items: center; gap: 6px; padding-right: 10px; border-right: 1px solid var(--line); }
.export-group--pdf { border-right: 0; padding-right: 0; }
.export-group__label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.section-label { margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }

/* Exec summary */
.exec { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.exec__brand { display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.exec__logo { height: 46px; }
.exec__logo--custom { height: auto; max-height: 52px; max-width: 200px; object-fit: contain; }
.exec__reporttype { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px;
  padding: 2px 8px; margin: 4px 0; }
.exec__prepared { font-size: .95rem; font-weight: 700; color: var(--primary); margin: 2px 0; }
.exec__sub { font-size: .85rem; color: var(--muted); margin: 0; }
.exec__stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 6px 0 14px; }
.exec__stat { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.exec__stat strong { display: block; font-size: 1.6rem; color: var(--primary); }
.exec__stat span { font-size: .78rem; color: var(--muted); }
.exec__stat.is-alert strong { color: var(--sev-critical); }
.exec__profile { font-size: .9rem; background: #eef3fb; border: 1px solid #d4e0f1; border-radius: var(--radius-sm); padding: 10px 14px; color: var(--ink-soft); }
.exec__h3 { margin: 16px 0 8px; }
.exec__top { margin: 0; padding-left: 20px; }
.exec__top li { margin-bottom: 10px; }
.exec__top-detail { font-size: .88rem; color: var(--ink-soft); font-weight: 400; }
.exec__prov { font-size: .76rem; color: var(--muted); margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }

/* Vuln cards */
.top-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vuln-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.vuln-card__head { display: flex; align-items: flex-start; gap: 12px; }
.vuln-card__rank { font-weight: 800; color: var(--muted); font-size: 1.1rem; }
.vuln-card__title { flex: 1; }
.vuln-card__title strong { color: var(--primary); }
.vuln-card__meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.vuln-card__score { font-weight: 800; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 1.25rem; text-align: center; line-height: 1; }
.vuln-card__score small { display: block; font-size: .6rem; font-weight: 600; opacity: .85; }
.vuln-card__explain { font-size: .9rem; color: var(--ink-soft); margin: 12px 0 8px; }

.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-alt); margin: 14px 0 10px; }
.bar__seg { height: 100%; }
.factors { width: 100%; border-collapse: collapse; font-size: .8rem; }
.factors td { padding: 3px 4px; border-bottom: 1px solid #f0f3f8; }
.factors__zero { opacity: .45; }
.factors__sw { width: 16px; }
.factors__sw .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.factors__label { color: var(--ink-soft); }
.factors__raw { color: var(--muted); text-align: right; white-space: nowrap; }
.factors__pts { text-align: right; font-weight: 700; color: var(--primary); width: 42px; }
.factors__adj .factors__pts { color: var(--sev-low); }
.card-notes { font-size: .72rem; color: var(--muted); margin: 6px 0 0; }
.ctl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ctl-tag { font-size: .72rem; background: #eef3fb; border: 1px solid #d4e0f1; color: var(--primary-2); border-radius: 20px; padding: 3px 10px; }

/* Data tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th { text-align: left; background: var(--bg-alt); color: var(--ink-soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px; border-bottom: 2px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.data-table th.th-num { text-align: right; }
.data-table th.th-active { color: var(--accent); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid #f0f3f8; vertical-align: top; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table .td-num { text-align: right; }
.data-table .td-mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.data-table .td-name { min-width: 220px; }
.td-rank { font-weight: 700; color: var(--muted); }
.row-kev { background: #fff8f7; }
.score-chip { display: inline-block; min-width: 34px; text-align: center; color: #fff; font-weight: 800; border-radius: 6px; padding: 3px 8px; font-size: .82rem; }
.sev-pill { font-weight: 700; }
.kev-pill { background: var(--sev-critical); color: #fff; font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 10px; letter-spacing: .5px; }
.data-table--poam .td-comment { min-width: 320px; font-size: .8rem; color: var(--ink-soft); }
.table-cap { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }

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

/* Responsive */
@media (max-width: 880px) {
  .gate, .panel-grid, .top-cards { grid-template-columns: 1fr; }
  .exec__stats { grid-template-columns: repeat(2, 1fr); }
  .detected__list { grid-template-columns: 1fr; }
  .env-grid { grid-template-columns: 1fr; }
}
