/* Цвета задаются переменными: тёмная тема меняет только их. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --border: #dde1e6;
  --accent: #2856d9;
  --accent-text: #ffffff;
  --danger: #c62f2f;
  --danger-bg: #fdecec;
  --safe: #1f7a45;
  --safe-bg: #e8f5ee;
  --warning: #9a6200;
  --hero: linear-gradient(160deg, #1d2b53 0%, #2856d9 100%);
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 10%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --surface: #1b2028;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --border: #2c333d;
    --accent: #6f95ff;
    --accent-text: #0d1220;
    --danger: #ff7b7b;
    --danger-bg: #3a1d1f;
    --safe: #5fd394;
    --safe-bg: #17301f;
    --warning: #f2b552;
    --hero: linear-gradient(160deg, #0f1730 0%, #1f3b8f 100%);
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.container { width: min(820px, 100% - 32px); margin-inline: auto; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: .95rem; color: var(--muted); font-weight: 600; }

a { color: var(--accent); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* --- шапка с формой --- */
.hero { background: var(--hero); color: #fff; padding: 48px 0 40px; margin-bottom: 24px; }
.lead { color: rgb(255 255 255 / 85%); max-width: 60ch; margin: 0 0 20px; }

.check-form { display: flex; gap: 8px; }
.check-form input {
  flex: 1; min-width: 0; padding: 12px 14px; font: inherit; border-radius: 10px;
  border: 1px solid transparent; background: #fff; color: #1b1f24;
}
.check-form input:focus-visible { outline: 3px solid rgb(255 255 255 / 55%); outline-offset: 1px; }
.check-form button {
  padding: 12px 20px; font: inherit; font-weight: 600; border: 0; border-radius: 10px; cursor: pointer;
  background: #ffd84d; color: #1b1f24;
}
.check-form button:disabled { opacity: .7; cursor: progress; }

.examples { margin: 12px 0 0; font-size: .875rem; color: rgb(255 255 255 / 80%); }
.link {
  background: none; border: 0; padding: 0 0 0 6px; font: inherit; color: #fff; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}

/* --- карточки --- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px;
}
.card--error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }

/* --- результат --- */
.result__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.result__host { color: var(--muted); }
.verdict { font-weight: 700; font-size: 1.15rem; padding: 4px 12px; border-radius: 999px; }
.verdict--phishing { color: var(--danger); background: var(--danger-bg); }
.verdict--safe { color: var(--safe); background: var(--safe-bg); }

.score__bar { position: relative; height: 10px; border-radius: 999px; background: var(--border); overflow: visible; }
.score__fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transition: width .4s ease; }
.score__fill--phishing { background: var(--danger); }
.score__fill--safe { background: var(--safe); }
.score__threshold { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .6; }
.score__text { margin: 8px 0 16px; }

.result__lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 24px; }
.list { margin: 0 0 12px; padding-left: 1.1em; }
.list li { margin-bottom: 4px; }
.list--warning li::marker { color: var(--warning); }
.list:empty::before { content: "—"; color: var(--muted); margin-left: -1.1em; }

/* --- история --- */
.table-wrap { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: .9rem; }
.history th, .history td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.history th { color: var(--muted); font-weight: 600; }
.history td:first-child { white-space: normal; overflow-wrap: anywhere; }
.history .num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag--phishing { color: var(--danger); background: var(--danger-bg); }
.tag--safe { color: var(--safe); background: var(--safe-bg); }

/* --- о модели --- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.facts div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.footer { padding: 8px 0 32px; }

@media (max-width: 560px) {
  .check-form { flex-direction: column; }
  .hero { padding: 32px 0 28px; }
}
