/* Neue Campton from the empressia.pl theme (Latin + Polish subset). */
@font-face {
  font-family: "Campton";
  src: url("fonts/NeueCampton-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Campton";
  src: url("fonts/NeueCampton-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Campton";
  src: url("fonts/NeueCampton-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Campton";
  src: url("fonts/NeueCampton-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* Colors follow the empressia.pl palette: navy primary, red dot, cyan accent. */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #0c226e;
  --ink-2: #455796;
  --ink-3: #6b6f7d;
  --line: #d9e0ea;
  --field: #ffffff;
  --accent: #0c226e;
  --accent-hover: #1a3592;
  --dot: #ec3a47;
  --cyan: #97e6f5;
  --ok: #138a5e;
  --info: #707fa6;
  --warn: #c26a07;
  --err: #d42a37;
  --code-bg: #f3f5f9;
  --focus: #a0abc8;
  --shadow: 2px 2px 30px rgba(12, 34, 110, 0.08);
  font-family: "Campton", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050f2d;
    --surface: #0b1a4a;
    --ink: #f3f5f9;
    --ink-2: #b6c0dc;
    --ink-3: #8d97b1;
    --line: #22336b;
    --field: #071339;
    --accent: #f3f5f9;
    --accent-hover: #cbf3fa;
    --ok: #3cc28e;
    --info: #8d97b1;
    --warn: #f0a23b;
    --err: #ff6670;
    --code-bg: #071339;
    --focus: #455796;
    --shadow: 0 0 45px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

input,
button {
  font: inherit;
}

a,
button,
input {
  &:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 3px;
  }
}

.topbar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 0;
  text-align: center;
}

.brand {
  display: inline-flex;
  border-radius: 4px;
}

.brand img {
  display: block;
  height: 17px;
  width: auto;
}

@media (prefers-color-scheme: dark) {
  .brand img {
    filter: brightness(0) invert(0.95);
  }
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.page > .card,
.page > .panel {
  max-width: 820px;
  margin-inline: auto;
}

.intro {
  text-align: center;
}

/* Intro: light Campton with a semibold second line, as on empressia.pl. */
.label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
  font-size: 17px;
  font-weight: 400;
  color: var(--info);
}

.label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot);
}

.intro h1 {
  margin: 0 0 28px;
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.intro h1 span {
  display: block;
  font-weight: 600;
}

.intro .lead {
  max-width: 58ch;
  margin: 0 auto 48px;
  text-wrap: balance;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--ink-2);
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  gap: 12px;
}

input[type="url"],
input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 24px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  transition: border-color 200ms;

  &::placeholder {
    color: var(--ink-3);
    opacity: 1;
  }

  &:hover:not(:disabled) {
    border-color: var(--focus);
  }

  &:focus-visible {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(151, 230, 245, 0.7);
  }
}

input[type="email"] {
  height: 52px;
  padding: 0 20px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 36px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 500;
  font-size: 17px;
  cursor: pointer;
  transition:
    background-color 250ms,
    color 250ms,
    border-color 250ms;

  &:hover:not(:disabled) {
    background: var(--accent-hover);
  }
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#scan-submit:disabled {
  cursor: progress;
}

/* The outlined red pill of the "Wypełnij brief" button on empressia.pl. */
button.secondary {
  background: transparent;
  color: var(--err);
  border: 1px solid var(--dot);

  &:hover:not(:disabled) {
    background: var(--dot);
    color: #fff;
  }
}

.status {
  min-height: 1.4em;
  margin: 14px 0 0 24px;
  font-size: 14px;
  color: var(--ink-3);
}

.status:empty {
  min-height: 0;
  margin-top: 0;
}

.status.error {
  color: var(--err);
}

/* Turnstile shows itself only when Cloudflare wants a click. */
.turnstile {
  display: flex;
  justify-content: center;
}

.turnstile.shown {
  margin-top: 12px;
}

.status.busy::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 2px solid var(--ink-3);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 32px;
  list-style: none;
  padding: 24px 0 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-2);
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.facts li::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(151, 230, 245, 0.55)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c226e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 11px no-repeat;
}

/* Scan panel */
.panel:not(:empty) {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.notice {
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.notice-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 32px;
}

.notice p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.notice.failure {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 28px 32px;
}

.notice.failure strong {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 500;
}

.notice.failure strong::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
}

.notice.failure p {
  font-size: 15px;
  color: var(--ink-2);
}

.notice.failure button {
  margin-top: 8px;
}

/* A navy sweep with the cyan from the logo at its head. */
.scan-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ink-2) 60%, var(--cyan));
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: scan-bar 1.6s ease-in-out infinite;
}

@keyframes scan-bar {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}

.spinner {
  flex: none;
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border: 2px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.light {
  margin: 0;
  border-color: var(--surface);
  border-right-color: transparent;
}

button.small-button {
  height: 40px;
  padding: 0 20px;
  font-size: 15px;
}

/* E-mail form (popup and card) */
.lead-card-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
}

.lead-card-description,
.lead-description {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-2);
}

.lead-form {
  display: grid;
  gap: 14px;
}

.lead-form .status {
  margin: 0;
}

.lead-form button {
  height: 52px;
  min-width: 11rem;
  padding: 0 28px;
  font-size: 16px;
}

.hp {
  display: none;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.legal-notes {
  display: grid;
  gap: 6px;
}

.legal a {
  color: inherit;
  text-underline-offset: 2px;
}

.legal {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-3);
}

.lead-done {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.lead-done p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.lead-done-icon,
.lead-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: rgba(151, 230, 245, 0.5);
}

.lead-done-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.lead-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 50%;
}

dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(5, 15, 45, 0.3);
}

dialog::backdrop {
  background: rgba(5, 15, 45, 0.6);
}

.lead-popup {
  position: relative;
  display: grid;
  gap: 0;
  padding: 40px;
}

.lead-popup h2 {
  margin: 0 0 10px;
  padding-right: 32px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 500;
}

.lead-popup .lead-done {
  margin: 8px 0 24px;
}

button.wide {
  width: 100%;
}

button.close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;

  &:hover:not(:disabled) {
    background: var(--bg);
    color: var(--ink);
  }
}

/* Report */
.report {
  margin-top: 24px;
}

.report h2 {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 400;
  color: var(--info);
}

.report p {
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--ink-2);
  margin: 0 0 12px;
}

.report p strong {
  font-weight: 500;
  color: var(--ink);
}

.report p.small {
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}

/* The verdict: the empressia dot, coloured by the result. */
.verdict {
  margin: 0 0 28px;
}

.report .verdict-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 10px;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.2;
  font-weight: 500;
  color: var(--ink);
}

.verdict-title::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tone, var(--info));
  transform: translateY(-0.12em);
}

.verdict.ok { --tone: var(--ok); }
.verdict.info { --tone: var(--info); }
.verdict.warn { --tone: var(--warn); }
.verdict.err { --tone: var(--err); }

.report .verdict-description {
  margin: 0 0 0 26px;
  max-width: 60ch;
  font-size: 17px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
}

.checks li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.badge {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  line-height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
}

.badge.ok { --tone: var(--ok); }
.badge.info { --tone: var(--info); }
.badge.warn { --tone: var(--warn); }
.badge.err { --tone: var(--err); }

.check-label {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
}

.check-status {
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

.check-status.ok { color: var(--ok); }
.check-status.info { color: var(--info); }
.check-status.warn { color: var(--warn); }
.check-status.err { color: var(--err); }

.check-detail {
  max-width: 64ch;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--ink-2);
}

details.tech {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 16px;
  font-size: 13px;
}

details.tech summary {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 14px;
}

.tech-body {
  border-top: 1px solid var(--line);
  padding: 16px 18px;
  color: var(--ink-2);
}

.report .tech-section {
  margin: 12px 0 6px;
  line-height: 1.4;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.report .tech-section:first-child {
  margin-top: 0;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}

.kv span:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink);
  text-align: right;
}

.tech pre {
  max-height: 12rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.55;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.report-actions button {
  height: 48px;
  padding: 0 28px;
  font-size: 16px;
}

.muted {
  font-size: 13px;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 20px 16px 0;
  }
  .page {
    padding: 48px 16px 64px;
  }
  .label {
    margin-bottom: 20px;
    font-size: 15px;
  }
  .intro h1 {
    margin-bottom: 20px;
  }
  .intro .lead {
    margin-bottom: 32px;
    font-size: 16px;
  }
  .row {
    flex-direction: column;
  }
  .row input {
    flex: none;
  }
  .card {
    padding: 20px 16px;
    border-radius: 16px;
  }
  .status {
    margin-left: 0;
  }
  .facts {
    flex-direction: column;
    align-items: center;
  }
  .notice-row,
  .notice.failure {
    padding: 20px 16px;
  }
  .lead-popup {
    padding: 28px 16px 16px;
  }
  .report-actions button,
  .lead-form button {
    width: 100%;
  }
  .report .verdict-description {
    margin-left: 0;
  }
}
