/* AI Visibility Tracker - look and feel.
   EDIT HERE: brand colours are the first few lines. */
:root {
  --blue: #1e88f0;
  --blue-dark: #1569c4;
  --ink: #1d2026;
  --ink-2: #4a505c;
  --muted: #6b7280;
  --line: #e4e7ec;
  --bg: #f5f6f8;
  --card: #ffffff;
  --good: #12925a;
  --ok: #1e88f0;
  --warn: #d98a0b;
  --bad: #d64545;
  --radius: 14px;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); }
a { color: var(--blue-dark); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 22px; }
.h3 { font-size: 18px; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 4vw, 40px); background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 15px; }
.brand strong { font-family: var(--display); font-weight: 700; }
.logo { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav .linkish { color: #cfd5de; text-decoration: none; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: 14px; }
.nav a:hover, .nav .linkish:hover { color: #fff; background: rgba(255,255,255,.08); }

.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); margin-bottom: 16px; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--blue-dark); margin-bottom: 8px; }
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--ink); }

/* forms + buttons */
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 12px; color: var(--ink-2); }
.opt { font-weight: 400; color: var(--muted); }
input, select { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd4dc; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,136,240,.18); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; font: 600 14px var(--body); color: var(--ink); background: #fff; border: 1px solid #cfd4dc; border-radius: 10px; cursor: pointer; transition: background .15s, transform .1s, border-color .15s; text-decoration: none; }
.btn:hover { background: #f1f3f6; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.big { width: 100%; padding: 13px; font-size: 15px; }
.btn.ghost { background: transparent; }
.danger { color: var(--bad) !important; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--blue-dark); }
.form-error { color: var(--bad); font-size: 14px; margin-top: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 3px; }

/* login */
.login { max-width: 380px; margin: 8vh auto 0; }

/* home */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; margin-bottom: 36px; }
.hero-copy { padding-top: 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); }
.lede { font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.newcheck { box-shadow: 0 10px 30px -18px rgba(29,32,38,.35); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.blist { display: grid; gap: 8px; }
.bcard { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.bcard:hover { border-color: #b9c2cf; transform: translateY(-1px); }
.bmain { display: flex; flex-direction: column; min-width: 0; }
.bmain strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bmain .muted { font-size: 13px; }
.bmeta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; gap: 2px; text-align: right; }
.bscore { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; font: 700 20px var(--display); background: #eef0f3; color: var(--muted); }
.bscore.bad { background: #fde8e8; color: var(--bad); }
.bscore.warn { background: #fdf1dc; color: #a86a05; }
.bscore.ok { background: #e3f0fd; color: var(--blue-dark); }
.bscore.good { background: #e0f4ea; color: var(--good); }
.delta { font-weight: 600; font-size: 13px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); font-weight: 500; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .actions { margin-top: 0; }
.trend { width: 100%; height: auto; }
.trend .grid { stroke: var(--line); }
.trend .axis { fill: var(--muted); font-size: 11px; }
.trend .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.trend .dot { fill: #fff; stroke: var(--blue); stroke-width: 2.5; }

/* progress */
.progress-card h1 { font-size: clamp(22px, 3vw, 28px); }
.bar { height: 8px; background: #eaedf1; border-radius: 99px; overflow: hidden; margin: 18px 0 8px; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .4s ease; }
.qlist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; font-size: 14px; }
.qlist li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; background: #f8f9fb; border-radius: 8px; }
.qdots { display: flex; gap: 4px; flex: none; }
.qdots i { width: 11px; height: 11px; border-radius: 50%; background: #dfe3e8; }
.qdots i.busy { background: var(--blue); animation: pulse 1s ease-in-out infinite; }
.qdots i.yes { background: var(--good); }
.qdots i.no { background: #aab1bc; }
.qdots i.err { background: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: #eef0f3; color: var(--ink-2); vertical-align: middle; }
.tag.good { background: #e0f4ea; color: var(--good); }

/* report */
.report-head { margin-bottom: 18px; }
.print-brand { display: none; }
.score-row { display: flex; gap: clamp(16px, 4vw, 40px); align-items: center; }
.ring .ring-bg { fill: none; stroke: #edf0f3; stroke-width: 14; }
.ring .ring-fg { fill: none; stroke: var(--muted); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring.bad .ring-fg { stroke: var(--bad); }
.ring.warn .ring-fg { stroke: var(--warn); }
.ring.ok .ring-fg { stroke: var(--ok); }
.ring.good .ring-fg { stroke: var(--good); }
.ring-num { font: 700 46px var(--display); fill: var(--ink); }
.ring-of { font-size: 12px; fill: var(--muted); }
.band { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 10px; align-items: center; }
.band.bad { color: var(--bad); } .band.warn { color: #a86a05; } .band.ok { color: var(--blue-dark); } .band.good { color: var(--good); }
.headline { font: 600 clamp(18px, 2.4vw, 23px)/1.3 var(--display); margin: 6px 0 10px; }

.engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.engines .card { margin: 0; }
.engine-name { font-weight: 600; margin-bottom: 4px; }
.engine-score { font: 700 34px var(--display); margin: 0 0 6px; color: var(--muted); }
.engine-score span { font-size: 15px; color: var(--muted); font-weight: 500; }
.engine-score.bad { color: var(--bad); } .engine-score.warn { color: #a86a05; } .engine-score.ok { color: var(--blue-dark); } .engine-score.good { color: var(--good); }
.engine .small { margin-bottom: 2px; }
strong.yes { color: var(--good); } strong.no { color: var(--bad); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col .card { margin-bottom: 16px; }
.comp { list-style: none; counter-reset: c; padding: 0; margin: 0; display: grid; gap: 8px; }
.comp li { counter-increment: c; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.comp-name::before { content: counter(c) ". "; color: var(--muted); }
.comp-bar { height: 8px; background: #eef0f3; border-radius: 99px; overflow: hidden; }
.comp-bar i { display: block; height: 100%; background: #9aa6b6; border-radius: 99px; }
.comp li:first-child .comp-bar i { background: var(--bad); }
.comp-n { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.means { padding-left: 18px; margin: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrix th { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.matrix th:first-child { text-align: left; }
.matrix td { padding: 9px 6px; border-bottom: 1px solid #f0f2f5; text-align: center; font-weight: 700; width: 84px; }
.matrix td.q { text-align: left; font-weight: 400; width: auto; color: var(--ink-2); }
.matrix tr.sub td { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-top: 16px; }
.c-yes { color: var(--good); } .c-no { color: #b4bac4; } .c-err { color: var(--warn); } .c-na { color: #c7ccd4; }
.key { margin-left: 10px; white-space: nowrap; }
.key b { margin-right: 3px; }

.answers details { border-top: 1px solid var(--line); padding: 10px 0; }
.answers summary { cursor: pointer; font-weight: 500; }
.answer { margin: 12px 0 0 14px; padding-left: 14px; border-left: 3px solid var(--line); }
.answer-engine { font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.answer-text { font-size: 14px; color: var(--ink-2); max-height: 340px; overflow: auto; }
mark { background: #fff2b3; padding: 0 2px; border-radius: 3px; }
.cta { background: var(--ink); color: #fff; border-color: var(--ink); }
.cta a { color: #8cc4ff; }
.report-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; }

/* settings */
.engines-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.engines-settings .card { margin: 0; }
.eset-head { display: flex; justify-content: space-between; align-items: center; }
.status.yes { color: var(--good); font-weight: 600; } .status.no { color: var(--muted); font-weight: 600; }
.eset details { margin-top: 10px; }
.eset summary { cursor: pointer; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd4dc; border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(30,136,240,.3); }
.pw { margin-top: 24px; }
.pw .row2 { grid-template-columns: 1fr 1fr auto; }
.pw label { margin-bottom: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.toast.bad { background: var(--bad); }

/* public report */
body.public .topbar { justify-content: center; }

@media (max-width: 820px) {
  .hero, .two-col { grid-template-columns: 1fr; }
  .score-row { flex-direction: column; text-align: center; }
  .band { justify-content: center; }
  .pw .row2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .bcard { grid-template-columns: 48px 1fr; }
  .bscore { width: 46px; height: 46px; font-size: 18px; }
  .bmeta { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; text-align: left; }
  .matrix td { width: 46px; padding: 8px 3px; }
  .matrix th { font-size: 11px; white-space: normal; }
  .comp li { grid-template-columns: 1fr 70px auto; }
  .nav a, .nav .linkish { padding: 8px 8px; }
  .brand span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* PDF / print: clean A4 report */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .no-print, .toast, .back { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .card { border: 1px solid #dde1e6; break-inside: avoid; padding: 14px; margin-bottom: 10px; }
  .print-brand { display: flex; align-items: center; gap: 8px; font: 700 14px var(--display); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 3px solid var(--blue); }
  .print-brand .logo { width: 24px; height: 24px; }
  .score-row { flex-direction: row; text-align: left; }
  .band { justify-content: flex-start; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .engines { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .matrix { font-size: 11px; }
  .matrix td { padding: 5px 4px; }
  .cta { background: #fff; color: var(--ink); border: 2px solid var(--blue); }
  .cta a { color: var(--blue-dark); }
  .ring .ring-fg { transition: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
