/* Look: calm "official document" feel. Ink-navy text, one confident blue for actions,
   a passport-photo illustration with real millimetre guides as the hero. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --band: #eaeef6;
  --fg: #142038;
  --muted: #56617a;
  --line: #dce1ea;
  --accent: #2448c9;
  --accent-soft: #e3e9fb;
  --accent-ink: #ffffff;
  --ok: #1b7a4b;
  --warn: #9a5b00;
  --bad: #b3261e;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320; --surface: #151c2c; --band: #111827; --fg: #edf1f8; --muted: #9aa5ba;
    --line: #26304a; --accent: #7f9cff; --accent-soft: #1d2747; --accent-ink: #0b1020;
    --ok: #6fd39b; --warn: #f0c060; --bad: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 17px; line-height: 1.55;
}
.wrap {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; text-wrap: balance; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); font-family: var(--display); font-weight: 600; font-size: 22px; }
.brand b { font-weight: 800; color: var(--accent); }
.brand.small { font-size: 18px; }
.lang select { font: inherit; font-size: 15px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }

/* hero */
.hero { background: linear-gradient(180deg, var(--surface), var(--bg)); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 40px; align-items: center; padding-block: 56px 48px; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-weight: 800; font-size: clamp(36px, 5.6vw, 62px); line-height: 1.02; margin: 0; }
.sub { color: var(--muted); font-size: 20px; max-width: 34em; margin: 18px 0 26px; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.badges li { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; }
.badges svg { width: 18px; height: 18px; color: var(--ok); flex: none; }

.hero-art { margin: 0; display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 300px; height: auto; }
.art-paper { fill: var(--surface); stroke: var(--line); stroke-width: 2; filter: drop-shadow(0 10px 24px rgba(20, 32, 56, 0.12)); }
.art-photo { fill: var(--band); }
.art-head { fill: var(--muted); opacity: 0.55; }
.art-guide { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.art-measure { stroke: var(--fg); stroke-width: 1.5; fill: none; }
.art-label { font: 600 12px var(--body); fill: var(--fg); }
.art-stamp circle { fill: var(--ok); }
.art-stamp path { fill: none; stroke: #ffffff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* tool */
.tool { padding-block: 40px 56px; scroll-margin-top: 80px; }
.steps { list-style: none; margin: 0 0 20px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.steps li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--band); font-weight: 700; font-size: 14px; }
.steps li.active { color: var(--fg); border-color: var(--accent); }
.steps li.active span { background: var(--accent); color: var(--accent-ink); }
.steps li.done span { background: var(--ok); color: #ffffff; }

.layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: 0 1px 2px rgba(20, 32, 56, 0.04); }

.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
select#doc { width: 100%; font: inherit; font-size: 17px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.doc-info { font-size: 14px; color: var(--muted); margin: 8px 0 18px; font-variant-numeric: tabular-nums; }

.dropzone { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 22px 16px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--accent); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.upload-row { display: grid; gap: 10px; width: 100%; }
.upload { display: block; position: relative; cursor: pointer; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 14px; border-radius: 10px; transition: transform .1s; }
.upload:hover { transform: translateY(-1px); }
.upload.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload:focus-within { outline: 2px solid var(--fg); outline-offset: 2px; }
.drop-hint { margin: 0; font-size: 14px; color: var(--muted); }
.tips { font-size: 14px; color: var(--muted); margin: 16px 0 0; }
.status { margin: 12px 0 0; font-weight: 700; min-height: 1.5em; }
.status.error { color: var(--bad); }

.empty-state h2 { font-size: 22px; margin: 0 0 12px; }
.dos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dos li { position: relative; padding-left: 30px; }
.dos li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }

.editor h2 { font-size: 19px; margin: 22px 0 10px; }
.preview-stage { display: grid; justify-items: center; gap: 10px; background: var(--band); border-radius: 10px; padding: 24px 16px 16px; }
.preview-frame { background: #ffffff; padding: 10px; border-radius: 4px; box-shadow: 0 12px 30px rgba(20, 32, 56, 0.18); max-width: 100%; }
#preview { display: block; max-width: 100%; max-height: 480px; height: auto; touch-action: none; cursor: grab; }
#preview:active { cursor: grabbing; }
.frame-size { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.controls { display: grid; gap: 12px; margin-top: 18px; }
.range { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.range input { flex: 1; min-width: 0; accent-color: var(--accent); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.check { display: flex; align-items: center; gap: 6px; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.checks li { position: relative; padding: 8px 12px 8px 40px; border-radius: 8px; background: var(--bg); }
.checks li::before { position: absolute; left: 10px; top: 8px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #ffffff; }
.checks li.ok::before { content: "✓"; background: var(--ok); }
.checks li.warn::before { content: "!"; background: var(--warn); }
.checks li.bad::before { content: "✕"; background: var(--bad); }
.checks li.bad { color: var(--bad); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 13px 20px; cursor: pointer; background: var(--accent); color: var(--accent-ink); transition: transform .1s; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.btn.link { background: none; color: var(--accent); padding-inline: 8px; }

/* how it works */
.band { background: var(--band); border-block: 1px solid var(--line); }
.band .wrap { padding-block: 56px; }
.section-title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin: 0 0 28px; }
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.how li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.how .num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-family: var(--display); }
.how h3 { font-size: 21px; margin: 14px 0 6px; }
.how p { margin: 0; color: var(--muted); }

/* faq */
.faq { padding-block: 56px; max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 4px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 700; font-size: 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 24px; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 65ch; }

/* country pages */
.top-link { font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; }
.hero-single { padding-block: 36px 40px; max-width: 820px; margin-left: 0; }
.hero-single .btn { display: inline-block; text-decoration: none; margin-top: 22px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: inherit; }
.reqs { padding-block: 40px 8px; }
.facts-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts { width: 100%; border-collapse: collapse; font-size: 16px; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th { width: 32%; font-weight: 700; white-space: nowrap; }
.checked { font-size: 14px; color: var(--muted); margin: 12px 0 0; max-width: 75ch; }
.checked a { color: var(--accent); }
.tips-list { margin: 0; padding-left: 22px; display: grid; gap: 10px; max-width: 70ch; }

.countries { padding-block: 56px 0; }
.country-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.country-links a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--fg); text-decoration: none; font-weight: 600; }
.country-links a:hover { border-color: var(--accent); }
.country-links .flag { font-size: 22px; line-height: 1; }
.country-links small { margin-left: auto; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .facts th { width: auto; white-space: normal; }
  .facts th, .facts td { display: block; padding: 10px 16px; }
  .facts th { padding-bottom: 0; border-bottom: 0; }
}

/* legal pages */
.legal { max-width: 760px; padding-block: 40px 56px; }
.legal h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 8px; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal p { margin: 0 0 12px; color: var(--fg); }
.legal-note { color: var(--muted) !important; }
.foot a { color: inherit; }

.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { display: grid; gap: 8px; padding-block: 28px 40px; font-size: 14px; color: var(--muted); }
.foot-inner p { margin: 0; max-width: 70ch; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: 36px 32px; gap: 28px; }
  .hero-art svg { max-width: 220px; }
  .layout { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-art { display: none; }  /* on phones the tool itself should be visible without scrolling far */
  .hero-grid { padding-block: 28px 24px; }
  .sub { font-size: 18px; margin-bottom: 20px; }
  .tool { padding-top: 24px; }
}
@media (max-width: 480px) {
  .steps li:not(.active) b { display: none; }
  .steps li { padding-right: 8px; }
  .panel { padding: 18px; }
}
