/* "Boks"-designet: lyst tema på :root, mørkt via systemet eller temaknappen. Boksen er altid mørk, QR-koden altid hvid. */
:root {
  color-scheme: light;
  --bg: #eef1f8;
  --dot: rgb(15 21 48 / 0.07);
  --surface: #ffffff;
  --surface-2: #e6eaf4;
  --border: #d6dcea;
  --text: #0f1530;
  --muted: #566086;
  --accent: #3ce0b0;
  --on-accent: #04241b;
  --accent-text: #0b7a5c;
  --focus: #0b7a5c;
  --danger: #c2255c;
  --shadow: 0 1px 2px rgb(15 21 48 / 0.06), 0 12px 32px rgb(15 21 48 / 0.08);

  --vault: #070b18;
  --vault-border: #24305a;
  --vault-text: #e6ecff;
  --vault-muted: #8a94b8;
  --vault-error: #ff6b9a;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1020;
    --dot: rgb(140 160 255 / 0.07);
    --surface: #121a33;
    --surface-2: #1b2545;
    --border: #26315a;
    --text: #e6ecff;
    --muted: #8a94b8;
    --accent-text: #3ce0b0;
    --focus: #3ce0b0;
    --danger: #ff6b9a;
    --shadow: none;
    --vault: #050814;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --dot: rgb(140 160 255 / 0.07);
  --surface: #121a33;
  --surface-2: #1b2545;
  --border: #26315a;
  --text: #e6ecff;
  --muted: #8a94b8;
  --accent-text: #3ce0b0;
  --focus: #3ce0b0;
  --danger: #ff6b9a;
  --shadow: none;
  --vault: #050814;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.sprite { display: none; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a { color: var(--accent-text); }

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Header */
.site-header {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand img { border-radius: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge .icon { width: 15px; height: 15px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.icon-button:active { transform: scale(0.96); }

.theme-toggle .icon { display: none; }
.theme-toggle[data-mode="auto"] .icon-auto,
.theme-toggle[data-mode="light"] .icon-light,
.theme-toggle[data-mode="dark"] .icon-dark { display: block; }

/* Layout */
main { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.hero { display: grid; gap: 28px; padding: 6px 0 48px; }
.intro { order: 2; }
.intro h1 { font-size: clamp(1.8rem, 7vw, 3.2rem); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 14px; }
.intro h1 span { color: var(--muted); }
.intro p { color: var(--muted); font-size: 1.05rem; margin: 0; max-width: 38ch; }

@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) 480px; align-items: center; gap: 56px; padding: 40px 0 72px; }
  .intro { order: 0; }
}

/* Generator */
.generator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 14px;
}
.tabs button { min-height: 44px; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--vault); color: var(--vault-text); }

.tab-hint { margin: 0 4px; color: var(--muted); font-size: 0.9rem; }

/* Felter */
.panel { display: grid; gap: 8px; }
.panel[hidden] { display: none; }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-weight: 600; font-size: 0.92rem; }
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* under 16 px zoomer iPhone ind på feltet */
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 132px; resize: vertical; line-height: 1.45; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field-hint { margin: 0 4px; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.field-hint[hidden] { display: none; }

/* QR-boksen: mørk Boks-ramme, koden selv altid sort på hvid */
.vault {
  background: var(--vault);
  border: 1px solid var(--vault-border);
  border-radius: 18px;
  padding: 14px;
  color: var(--vault-text);
}

.code {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.code[hidden] { display: none; }
.code svg { display: block; width: 100%; height: 100%; }

.placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 0;
  padding: 24px 12px;
  border: 2px dashed var(--vault-border);
  border-radius: 12px;
  color: var(--vault-muted);
  text-align: center;
}
.placeholder[hidden] { display: none; }
.placeholder.error { color: var(--vault-error); border-color: var(--vault-error); }

/* Knapper */
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 6px 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}
.action:active:not(:disabled) { transform: scale(0.97); }
.action:disabled { opacity: 0.45; cursor: not-allowed; }

.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.primary:hover:not(:disabled) { filter: brightness(1.05); }
.primary .icon-check, .primary.copied .icon-copy { display: none; }
.primary.copied .icon-check { display: block; }

.message { margin: 0; font-size: 0.9rem; color: var(--muted); }
.message:empty { display: none; }
.message.error { color: var(--danger); }

/* Stor visning: hele skærmen hvid, koden så stor som muligt */
.big {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0;
  background: #fff;
  color: #566086;
  cursor: pointer;
}
.big[open] { display: grid; place-items: center; align-content: center; gap: 16px; }
.big::backdrop { background: #fff; }
.big-code { width: min(92vw, 80dvh); aspect-ratio: 1 / 1; }
.big-code svg { display: block; width: 100%; height: 100%; }
.big p { margin: 0; font-size: 0.95rem; }

/* Landingsindhold */
.section { padding: 44px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: clamp(1.4rem, 4.5vw, 1.9rem); letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 20px; }

.cards { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .cards.three, .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--accent-text);
}

.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
/* Hvert trin er bygget som fakta-kortene: [nummer] [ikon] øverst, teksten på egen linje under. */
.steps li { counter-increment: step; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 14px 12px; }
.steps .feature-icon { margin: 0; flex: none; }
.steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.steps p { flex-basis: 100%; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.note { margin: 16px 0 0; color: var(--muted); font-size: 0.9rem; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--accent-text); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

.site-footer { max-width: 1040px; margin: 0 auto; padding: 28px 16px 36px; border-top: 1px solid var(--border); }
.site-footer p { margin: 0; text-align: center; color: var(--muted); font-size: 0.85rem; }
.version { font-family: var(--mono); color: var(--accent-text); white-space: nowrap; }

@media (max-width: 359px) {
  .badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
