@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --red: #DC0023;
  --red-dark: #b3001c;
  --red-soft: #fde8eb;
  --blue: #0073AF;
  --blue-dark: #005b8b;
  --blue-soft: #e6f2f9;
  --green: #12805c;
  --green-soft: #e3f4ed;
  --ink: #1b2430;
  --ink-2: #4a5564;
  --ink-3: #7a8594;
  --line: #dde3ea;
  --bg: #f4f6f9;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 8px 28px rgba(20, 30, 45, .08);
  --t: .25s ease;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; }
img { max-width: 100%; }
a { color: var(--blue); }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 800; }
h2 { font-weight: 700; }
.lead { color: var(--ink-2); font-size: clamp(15px, 1.6vw, 17px); max-width: 640px; margin: 0 auto 12px; }

/* Pasek górny */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 4vw, 32px);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-logo img { display: block; height: 28px; width: auto; }
.topbar-title { color: var(--ink-2); font-weight: 600; font-size: 15px; padding-left: 16px; border-left: 1px solid var(--line); }
.topbar-progress { margin-left: auto; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.topbar-progress b { color: var(--blue); }
.progress-track { height: 3px; background: transparent; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--red)); transition: width .5s ease; }

/* Ekrany */
.screen { display: none; padding: clamp(28px, 6vw, 56px) clamp(16px, 4vw, 32px) 40px; text-align: center; max-width: 960px; margin: 0 auto; }
body[data-screen="start"] .screen-start,
body[data-screen="form"] .screen-form,
body[data-screen="quiz"] .screen-quiz,
body[data-screen="end"] .screen-end { display: block; animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hero-art { width: min(360px, 80vw); height: auto; margin: 0 auto 18px; display: block; }
.hero-art path:nth-of-type(4), .hero-art path:nth-of-type(5) { transform-origin: 180px 0; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.screen-start .btn { margin-top: 18px; }

/* Przyciski */
.btn {
  font: inherit; font-weight: 600; font-size: 15px;
  border: 1.5px solid transparent; border-radius: 999px;
  padding: 10px 22px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  transition: background var(--t), border-color var(--t), color var(--t), transform .15s ease, box-shadow var(--t);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(0, 115, 175, .35); outline-offset: 2px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 6px 18px rgba(0, 115, 175, .28); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); box-shadow: 0 6px 18px rgba(220, 0, 35, .25); }
.btn-ghost { background: transparent; color: var(--blue); border-color: #b9d3e4; }
.btn-ghost:hover { background: var(--blue-soft); border-color: var(--blue); }
.btn[disabled] { opacity: .45; cursor: default; box-shadow: none; }

/* Formularz */
.user-form { max-width: 380px; margin: 26px auto 0; text-align: left; display: grid; gap: 16px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 16px;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 115, 175, .14); }
.form-hint { margin: -4px 0 0; font-size: 13px; color: var(--ink-3); }
.form-error { margin: 0; min-height: 1.2em; color: var(--red); font-size: 14px; font-weight: 600; }
.user-form .btn { justify-self: center; margin-top: 4px; }

/* Pytanie */
.q-head { max-width: 720px; margin: 0 auto 26px; }
.q-lead { font-size: 14px; color: var(--ink-3); }
.answer-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.verdict-title { font-size: clamp(22px, 3.2vw, 30px); margin: 0 0 8px; letter-spacing: -.01em; }
.verdict-mark { font-weight: 800; }
.verdict.is-ok .verdict-mark { color: var(--green); }
.verdict.is-bad .verdict-mark { color: var(--red); }
.verdict-summary { color: var(--ink-2); margin: 0 auto; max-width: 620px; }

.stage { position: relative; max-width: 760px; margin: 0 auto; text-align: left; }

/* Okno poczty */
.mail {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.mail-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: #f7f9fb; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3);
}
.mail-bar i { width: 11px; height: 11px; border-radius: 50%; background: #d9dee5; display: inline-block; }
.mail-bar span { margin-left: 10px; }
.mail-head { padding: 18px 22px 8px; }
.mail-subject { font-size: 20px; font-weight: 600; margin: 0 0 14px; line-height: 1.3; }
.mail-from { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 17px; background: var(--ink-3);
}
.from-line { font-size: 14px; line-height: 1.35; word-break: break-word; }
.from-name { font-weight: 700; }
.from-addr { color: var(--ink-3); }
.to-me {
  font: inherit; font-size: 13px; color: var(--ink-3); background: none; border: 0; padding: 2px 0;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.to-me:hover { color: var(--ink); }
.to-me svg { width: 10px; height: 10px; transition: transform var(--t); }
.to-me[aria-expanded="true"] svg { transform: rotate(180deg); }
.mail-time { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.mail-details {
  margin: 10px 0 4px 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; background: #fbfcfd;
}
.mail-details[hidden] { display: none; }
.mail-details dt { color: var(--ink-3); text-align: right; }
.mail-details dd { margin: 0; word-break: break-all; }
.mail-details .none { color: var(--ink-3); font-style: italic; }

.mail-body { padding: 10px 22px 26px; font-size: 15px; }
.mail-body > * { margin: 0 0 14px; }
.mb-brand {
  padding: 14px 18px; border-radius: var(--radius-sm); font-weight: 800; font-size: 20px; letter-spacing: -.01em;
  margin-bottom: 18px; border: 1px solid rgba(0, 0, 0, .06);
}
.mb-strong { font-weight: 700; font-size: 17px; }
.mb-box { background: #fff7e6; border-left: 4px solid #f0a500; padding: 12px 14px; border-radius: 4px; }
.mb-small { font-size: 12.5px; color: var(--ink-3); }
.mb-sig { color: var(--ink-2); white-space: pre-line; }
.mb-table { border-collapse: collapse; width: 100%; max-width: 420px; font-size: 14px; }
.mb-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.mb-table td:first-child { color: var(--ink-3); width: 40%; }
.mb-button {
  display: inline-block; background: var(--mb-btn, #1a73e8); color: #fff; font-weight: 600;
  padding: 11px 22px; border-radius: 6px; cursor: pointer; text-decoration: none;
}
.mb-link { color: #1a62c9; text-decoration: underline; cursor: pointer; }
.mb-button:focus-visible, .mb-link:focus-visible, .att:focus-visible { outline: 3px solid rgba(0, 115, 175, .4); outline-offset: 2px; }

.mail-atts { padding: 0 22px 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.att {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fafbfc; cursor: pointer; font-size: 13.5px; max-width: 100%;
}
.att svg { width: 26px; height: 26px; flex: none; }
.att-name { font-weight: 600; word-break: break-all; }
.att-size { color: var(--ink-3); font-size: 12px; }

.mail-status {
  position: absolute; left: 0; bottom: 0; max-width: 92%;
  background: #eef1f4; border: 1px solid var(--line); border-left: 0; border-bottom: 0;
  border-top-right-radius: 6px; padding: 3px 10px; font-size: 12px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s ease;
  pointer-events: none;
}
.mail-status.on { opacity: 1; }

/* Dymek z adresem linku */
.url-tip {
  position: absolute; z-index: 40; max-width: min(420px, 90vw);
  background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4;
  padding: 8px 12px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  word-break: break-all; pointer-events: none;
}
.url-tip small { display: block; color: #c4ccd6; word-break: normal; margin-top: 4px; }

/* Podpowiedzi po odpowiedzi */
.hint-target { position: relative; z-index: 2; border-radius: 6px; box-shadow: 0 0 0 3px var(--red), 0 0 0 9px rgba(220, 0, 35, .16); animation: hintPulse 1.6s ease-in-out infinite; }
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--red), 0 0 0 7px rgba(220, 0, 35, .18); }
  50% { box-shadow: 0 0 0 3px var(--red), 0 0 0 12px rgba(220, 0, 35, .06); }
}
.tour-card {
  position: absolute; z-index: 30; width: min(340px, calc(100% - 16px));
  background: var(--card); border-radius: 12px; padding: 16px 18px 14px;
  box-shadow: 0 14px 40px rgba(20, 30, 45, .22); border: 1px solid var(--line);
  animation: fadeUp .3s ease both;
}
.tour-card[hidden] { display: none; }
.tour-arrow {
  position: absolute; width: 14px; height: 14px; background: var(--card);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg); top: -8px; left: 24px;
}
.tour-card.above .tour-arrow { top: auto; bottom: -8px; transform: rotate(225deg); }
.tour-count { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: .04em; text-transform: uppercase; }
.tour-text { margin: 0 0 12px; font-size: 14.5px; color: var(--ink); }
.tour-card .btn { float: right; padding: 8px 18px; font-size: 14px; }
.tour-card::after { content: ""; display: block; clear: both; }

/* Wynik */
.score-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 18px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e3e8ee; stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--blue); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1.2s ease .2s; }
.score-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.results { list-style: none; padding: 0; margin: 28px auto 8px; max-width: 620px; text-align: left; display: grid; gap: 8px; }
.results li {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14.5px;
}
.results .ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.results .ico svg { width: 14px; height: 14px; }
.results .ok .ico { background: var(--green-soft); color: var(--green); }
.results .bad .ico { background: var(--red-soft); color: var(--red); }
.results .tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.results .tag-phishing { background: var(--red-soft); color: var(--red-dark); }
.results .tag-legit { background: var(--blue-soft); color: var(--blue-dark); }
.results .sub { display: block; color: var(--ink-3); font-size: 12.5px; }

.tips-title { font-size: 22px; margin: 40px 0 16px; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; text-align: left; }
.tip { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; border-top: 3px solid var(--blue); }
.tip:nth-child(odd) { border-top-color: var(--red); }
.tip strong { display: block; margin-bottom: 6px; }
.tip p { margin: 0; color: var(--ink-2); font-size: 14px; }
.screen-end > .answer-row { margin-top: 32px; }
.cta { margin: 40px auto 0; max-width: 620px; padding: 20px 22px; border-radius: 12px; background: var(--blue-soft); }
.cta p { margin: 0 0 12px; color: var(--ink-2); }

.footer { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 22px 16px 28px; }

@media (max-width: 600px) {
  .topbar-title { display: none; }
  .mail-head, .mail-body { padding-left: 16px; padding-right: 16px; }
  .mail-atts { padding: 0 16px 18px; }
  .mail-details { margin-left: 0; grid-template-columns: 1fr; }
  .mail-details dt { text-align: left; margin-top: 4px; }
  .answer-row .btn-lg { flex: 1 1 100%; }
}
