:root {
  --bg: #0b1020;
  --bg2: #121a33;
  --card: #151d36;
  --line: #243054;
  --txt: #e8ecf8;
  --muted: #94a0c0;
  --acc: #7c5cff;
  --acc2: #22d3ee;
  --pass: #22c55e;
  --warn: #f59e0b;
  --fail: #ef4444;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font: 16px/1.6 "Segoe UI", Inter, Rubik, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 92, 255, .25), transparent 60%),
    radial-gradient(800px 500px at 90% 0%, rgba(34, 211, 238, .16), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

html[dir="rtl"] body { font-family: Rubik, "Segoe UI", Arial, sans-serif; }

a { color: var(--acc2); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px clamp(16px, 5vw, 48px);
  max-width: 1100px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--txt); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 10px; }

button, .cta, .cta-sm {
  font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent;
}
.ghost {
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  color: var(--txt); padding: 8px 14px; transition: background .15s, border-color .15s;
}
.ghost:hover { background: rgba(255, 255, 255, .1); border-color: var(--acc); }
.cta, .cta-sm {
  background: linear-gradient(135deg, var(--acc), #5b8cff); color: #fff;
  padding: 10px 18px; font-weight: 600; display: inline-block;
}
.cta-sm { padding: 8px 14px; font-size: 14px; }
.cta:hover, .cta-sm:hover { text-decoration: none; filter: brightness(1.08); }

main { max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 48px) 80px; }

/* ------------------------------------------------------------------ hero */
.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 {
  font-size: clamp(30px, 5.2vw, 52px); line-height: 1.12; margin: 0 0 18px;
  letter-spacing: -.02em;
  background: linear-gradient(120deg, #fff 20%, #b9c6ff 60%, var(--acc2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { max-width: 680px; margin: 0 auto 30px; color: var(--muted); font-size: clamp(15px, 2vw, 18px); }

.scanbox {
  display: flex; gap: 10px; max-width: 620px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.scanbox input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--txt); font-size: 17px; padding: 12px 14px;
}
.scanbox input::placeholder { color: #5e6b8e; }
.scanbox button {
  background: linear-gradient(135deg, var(--acc), #5b8cff); color: #fff;
  font-weight: 650; padding: 12px 22px; white-space: nowrap;
}
.scanbox button:disabled { opacity: .55; cursor: wait; }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 12px; }

.logos {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; padding: 0; margin: 26px 0 0;
}
.logos li {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---------------------------------------------------------------- panels */
.panel {
  margin: 32px auto; max-width: 620px; text-align: center; color: var(--muted);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.panel.error { border-color: #5b2330; color: #ffb4b4; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--acc); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- scorecard */
.scorecard {
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(160deg, var(--card), var(--bg2));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px; margin-top: 30px;
}
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring-bg { stroke: #223; }
.ring-fg { stroke: var(--pass); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s cubic-bezier(.2, .9, .2, 1), stroke .4s; }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text strong { font-size: 42px; line-height: 1; display: block; }
.ring-text span { color: var(--muted); font-size: 14px; letter-spacing: .14em; }

.scoremeta { flex: 1; min-width: 260px; }
.scoremeta h2 { margin: 0 0 4px; font-size: 24px; word-break: break-all; }
.verdict { margin: 12px 0 16px; font-size: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- pillars */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 18px; }
.pillar { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.pillar h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.pillar .val { font-size: 21px; font-weight: 700; }
.pillar .val small { color: var(--muted); font-size: 13px; font-weight: 400; }
.bar { height: 6px; border-radius: 99px; background: #223; margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.2, .9, .2, 1); }

.sect { margin: 38px 0 14px; font-size: 19px; }

/* ---------------------------------------------------------------- agents */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.agent {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 14.5px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--pass); box-shadow: 0 0 10px rgba(34, 197, 94, .7); }
.dot.partial { background: var(--warn); }
.dot.no { background: var(--fail); box-shadow: 0 0 10px rgba(239, 68, 68, .6); }
.agent small { color: var(--muted); display: block; font-size: 12px; }

/* ---------------------------------------------------------------- checks */
.checks { display: flex; flex-direction: column; gap: 10px; }
.check {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
html[dir="rtl"] .check { border-left: 1px solid var(--line); border-right: 4px solid var(--line); }
.check.pass { border-left-color: var(--pass); }
.check.warn { border-left-color: var(--warn); }
.check.fail { border-left-color: var(--fail); }
html[dir="rtl"] .check.pass { border-right-color: var(--pass); }
html[dir="rtl"] .check.warn { border-right-color: var(--warn); }
html[dir="rtl"] .check.fail { border-right-color: var(--fail); }
.check-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.check-title { font-weight: 600; display: flex; align-items: center; gap: 9px; }
.check-pts { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.check p { margin: 7px 0 0; font-size: 14.5px; color: var(--muted); }
.check .fix { color: #cfd7f0; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 9px; }
.check .fix b { color: var(--acc2); font-weight: 600; }
.icon { width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------- pricing */
.upsell {
  margin-top: 34px; background: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(34, 211, 238, .1));
  border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-align: center;
}
.upsell h3 { margin: 0 0 8px; }
.upsell p { color: var(--muted); max-width: 560px; margin: 0 auto 16px; }

.pricing { margin-top: 70px; text-align: center; }
.pricing h3, .faq h3 { font-size: 24px; margin-bottom: 18px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-align: start; }
.plan.featured { border-color: var(--acc); box-shadow: 0 16px 50px rgba(124, 92, 255, .22); }
.plan h4 { margin: 0; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.price { font-size: 38px; font-weight: 700; margin: 6px 0 14px; }
.price span { font-size: 15px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0 0 18px; }
.plan li { padding: 6px 0 6px 24px; color: var(--muted); font-size: 14.5px; position: relative; }
html[dir="rtl"] .plan li { padding: 6px 24px 6px 0; }
.plan li::before { content: "✓"; color: var(--pass); position: absolute; inset-inline-start: 0; }

.faq { margin-top: 70px; max-width: 760px; margin-inline: auto; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 10px 0 0; }

footer { text-align: center; color: var(--muted); padding: 30px 16px 50px; font-size: 14px; }

/* ----------------------------------------------------------------- modal */
dialog {
  background: var(--card); color: var(--txt); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; max-width: min(720px, 92vw); width: 100%;
}
dialog::backdrop { background: rgba(4, 7, 18, .72); backdrop-filter: blur(3px); }
dialog h4 { margin: 0 0 12px; }
dialog textarea {
  width: 100%; background: #0d1326; color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font: 13px/1.6 ui-monospace, "Cascadia Code", Consolas, monospace;
  resize: vertical; direction: ltr; text-align: left;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

@media (max-width: 560px) {
  .scanbox { flex-direction: column; }
  .scanbox button { width: 100%; }
  .scorecard { justify-content: center; text-align: center; }
  .actions { justify-content: center; }
}
