:root {
    --teal: #3A9B94;
    --teal-dark: #2F7F79;
    --teal-light: #E8F3F2;
    --ink: #142826;
    --ink-soft: #4A5C5A;
    --bg: #F7FBFA;
    --warn: #C44536;
    --line: #DDE8E6;
    --shadow: 0 6px 22px rgba(20, 40, 38, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

a { color: var(--teal-dark); }

header.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: white;
}

header.nav .brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -.01em;
}

header.nav .brand .accent { color: var(--teal); }

header.nav nav a {
    margin-left: 22px;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: .95rem;
}

header.nav nav a:hover { color: var(--teal-dark); }

main {
    max-width: 980px;
    margin: 0 auto;
    padding: 56px 28px 80px;
}

h1 {
    font-size: 2.4rem;
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -.02em;
}

h1 .accent { color: var(--teal); }

h2 {
    font-size: 1.35rem;
    margin: 36px 0 14px;
    letter-spacing: -.01em;
}

p.lead {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 64ch;
}

.button {
    display: inline-block;
    background: var(--teal);
    color: white;
    padding: 12px 22px;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
}

.button:hover { background: var(--teal-dark); }

.button.secondary {
    background: white;
    color: var(--teal-dark);
    border: 1px solid var(--line);
}

.cta-row { margin: 28px 0 8px; display: flex; gap: 12px; flex-wrap: wrap; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 28px 0;
}

.card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: .95rem;
}

.compare {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.compare th, .compare td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: .98rem;
}

.compare th {
    background: var(--teal-light);
    color: var(--ink);
    font-weight: 600;
}

.compare td.bad { color: var(--warn); }
.compare td.good { color: var(--teal-dark); font-weight: 600; }

label.field {
    display: block;
    margin: 14px 0;
}

label.field span {
    display: block;
    font-size: .9rem;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--ink);
}

textarea { min-height: 90px; resize: vertical; }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(58, 155, 148, .18);
}

.password-display {
    background: var(--ink);
    color: #BFF0EB;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.5rem;
    letter-spacing: .12em;
    padding: 18px 20px;
    border-radius: 12px;
    text-align: center;
    word-break: break-all;
    user-select: all;
}

.callout {
    background: var(--teal-light);
    border-left: 4px solid var(--teal);
    padding: 14px 18px;
    border-radius: 8px;
    margin: 18px 0;
    color: var(--ink);
}

.callout.warn {
    background: #FCEDEA;
    border-left-color: var(--warn);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid var(--teal-light);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

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

pre.code {
    background: #0F1F1D;
    color: #BFF0EB;
    padding: 14px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: .82rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- Print card layout — Dollar-bill format (USD bill ≈ 156×66 mm) ----------
   Single-sided (Peter 2026-05-04: "ikke alle kan printe på 2 sider").
   Layout: VENSTRE = identitet + QR. HØJRE = stor PIN + Apple-comparison.
   Klipbar med saks. Selv en stresset paramediciner kan læse PIN'en på 1 sek. */
.mm-bill {
    width: 156mm;
    height: 66mm;
    background: white;
    border: 1px dashed #c9d4d2;
    padding: 4mm 5mm;
    margin: 18px auto;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    page-break-inside: avoid;
    box-sizing: border-box;
    border-radius: 2mm;
    display: grid;
    grid-template-columns: 38mm 1fr 64mm;
    gap: 4mm;
    align-items: stretch;
}

.mm-bill::before {
    /* Subtle teal frame — like real currency. */
    content: '';
    position: absolute;
    inset: 2mm;
    border: 0.5mm solid var(--teal);
    border-radius: 1mm;
    pointer-events: none;
    opacity: 0.5;
}

/* ----- LEFT: QR ----- */
.mm-bill .qr-block {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 2mm;
    padding: 2mm;
    border: 0.4mm solid var(--teal);
    z-index: 1;
}

.mm-bill .qr-block img {
    width: 100%;
    height: auto;
    display: block;
}

/* ----- MIDDLE: identity ----- */
.mm-bill .id-block {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2mm 0;
    z-index: 1;
}

.mm-bill .brand {
    font-size: 16pt;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
    line-height: 1;
}

.mm-bill .brand .accent { color: var(--teal); }

.mm-bill .tag {
    font-size: 7pt;
    color: var(--ink-soft);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: 1mm;
    line-height: 1.3;
}

.mm-bill .name-line {
    font-size: 12pt;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    margin-top: 2mm;
}

.mm-bill .blood-strip {
    margin-top: 1.5mm;
    font-size: 8pt;
    color: var(--ink-soft);
}

.mm-bill .blood-strip strong { color: var(--ink); }

.mm-bill .id-tag {
    font-family: ui-monospace, monospace;
    font-size: 6.5pt;
    color: var(--ink-soft);
    letter-spacing: .05em;
    margin-top: auto;
}

/* ----- RIGHT: giant PIN + Apple-comparison ----- */
.mm-bill .pin-block {
    display: flex;
    flex-direction: column;
    z-index: 1;
    gap: 2mm;
}

.mm-bill .pin-zone {
    background: var(--ink);
    color: #BFF0EB;
    border-radius: 2mm;
    padding: 2.5mm 3mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mm-bill .pin-label {
    font-size: 7pt;
    letter-spacing: .12em;
    color: #7DD3CC;
    text-transform: uppercase;
    margin-bottom: 0.8mm;
}

.mm-bill .pin-digits {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 28pt;
    font-weight: 800;
    letter-spacing: .12em;
    color: #FFFFFF;
    line-height: 1;
    user-select: all;
}

.mm-bill .why-zone {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1mm;
}

.mm-bill .why-zone h3 {
    margin: 0;
    font-size: 7pt;
    color: var(--teal-dark);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.mm-bill .why-zone ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 7.5pt;
    line-height: 1.35;
    color: var(--ink);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 3mm;
}

.mm-bill .why-zone li {
    padding-left: 4mm;
    position: relative;
    margin-bottom: 0.4mm;
}

.mm-bill .why-zone li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

/* ---------- A4 medical poster (Side 1 — full info) ----------
   Single A4 page. Patient's photo + name + RED critical info (blood/allergy/medicine)
   + emergency contacts + 112-row + QR + PIN. Designed to be put on the fridge,
   in the glove box, or with travel papers. */
.med-poster {
    width: 200mm;
    min-height: 270mm;
    background: white;
    border: 2px solid var(--teal);
    border-radius: 4mm;
    padding: 8mm 10mm;
    margin: 18px auto;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6mm;
    page-break-inside: avoid;
}

.med-poster .poster-header {
    border-bottom: 2px solid var(--teal);
    padding-bottom: 4mm;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8mm;
    flex-wrap: wrap;
}

.med-poster .poster-brand {
    font-size: 24pt;
    font-weight: 800;
    letter-spacing: -.02em;
}

.med-poster .poster-brand .accent { color: var(--teal); }

.med-poster .poster-tagline {
    font-size: 10pt;
    color: var(--ink-soft);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.med-poster .poster-body {
    display: grid;
    grid-template-columns: 55mm 1fr 55mm;
    gap: 8mm;
    align-items: stretch;
}

.med-poster .poster-photo {
    width: 55mm;
    height: 55mm;
    border: 2px solid var(--teal);
    border-radius: 3mm;
    background: var(--teal-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.med-poster .poster-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.med-poster .photo-placeholder {
    font-size: 60pt;
    color: var(--teal);
    opacity: 0.45;
}

.med-poster .poster-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2mm 0;
    gap: 3mm;
}

.med-poster .poster-name {
    font-size: 28pt;
    font-weight: 800;
    line-height: 1.05;
    color: var(--ink);
    letter-spacing: -.01em;
}

.med-poster .poster-dob {
    font-size: 11pt;
    color: var(--ink-soft);
}

.med-poster .poster-dob strong { color: var(--ink); }

.med-poster .poster-qr {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3mm;
}

.med-poster .poster-qr img {
    width: 55mm;
    height: 55mm;
    object-fit: contain;
    border: 2px solid var(--teal);
    border-radius: 3mm;
    padding: 1.5mm;
    background: white;
    box-sizing: border-box;
}

.med-poster .poster-pin-box {
    background: var(--ink);
    color: #FFFFFF;
    border-radius: 2mm;
    padding: 3mm 4mm;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.med-poster .poster-pin-label {
    font-size: 8pt;
    color: #7DD3CC;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1.5mm;
}

.med-poster .poster-pin {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 26pt;
    font-weight: 800;
    letter-spacing: .12em;
}

/* CRITICAL info — RED so paramedics see it instantly */
.med-poster .critical-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4mm;
    background: #FFF4F0;
    border: 2px solid #C44536;
    border-radius: 3mm;
    padding: 5mm 6mm;
}

.med-poster .critical-cell {
    padding: 2mm 0;
}

.med-poster .critical-label {
    font-size: 9pt;
    color: #8B2A1F;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    margin-bottom: 1.5mm;
}

.med-poster .critical-value {
    font-size: 14pt;
    font-weight: 700;
    color: #8B2A1F;
    line-height: 1.25;
}

.med-poster .poster-contacts {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 5mm;
    border-top: 1px solid var(--line);
    padding-top: 5mm;
}

.med-poster .contact-block {
    display: flex;
    flex-direction: column;
    gap: 1mm;
}

.med-poster .contact-label {
    font-size: 9pt;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.med-poster .contact-value {
    font-size: 11pt;
    color: var(--ink);
    line-height: 1.4;
}

.med-poster .contact-value strong { color: #C44536; }

.med-poster .poster-why {
    background: var(--teal-light);
    border-left: 4px solid var(--teal);
    padding: 3mm 5mm;
    border-radius: 2mm;
    font-size: 10pt;
    color: var(--ink);
}

.med-poster .poster-footer {
    margin-top: auto;
    padding-top: 4mm;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
    color: var(--ink-soft);
    flex-wrap: wrap;
    gap: 4mm;
}

.med-poster .poster-id { font-family: ui-monospace, monospace; }

/* Critical info compact strip on dollar-bill (back of small cards) */
.mm-bill .bill-critical {
    margin-top: 1mm;
    font-size: 8pt;
    font-weight: 700;
    color: #C44536;
    line-height: 1.3;
}

/* ----- 4-up sheet: smaller bills (extras for family / car / golf bag) ----- */
.bill-sheet-4up {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 4mm;
    width: 200mm;
    margin: 18px auto;
    page-break-inside: avoid;
}

.bill-sheet-4up .mm-bill {
    margin: 0;
    width: 100%;
    height: 60mm;
    grid-template-columns: 32mm 1fr 56mm;
    padding: 3mm 4mm;
}

.bill-sheet-4up .mm-bill .brand { font-size: 13pt; }
.bill-sheet-4up .mm-bill .name-line { font-size: 10pt; }
.bill-sheet-4up .mm-bill .pin-digits { font-size: 24pt; }
.bill-sheet-4up .mm-bill .why-zone ul { font-size: 6.5pt; }

.print-page {
    margin: 0 auto 30px;
    padding: 12px 0;
}

.print-page-label {
    text-align: center;
    color: var(--ink-soft);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
}

@media print {
    body { background: white; }
    header.nav, .no-print { display: none !important; }
    main { padding: 0; max-width: none; }
    .mm-bill {
        box-shadow: none;
        border: 1px dashed #c9d4d2;
    }
    .print-page { page-break-after: always; padding: 0; }
    .print-page:last-child { page-break-after: auto; }
    .print-page-label { display: none; }
    @page { size: A4; margin: 12mm; }
}

@media (max-width: 700px) {
    .mm-bill {
        width: 100%;
        max-width: 156mm;
        height: auto;
        min-height: 60mm;
        grid-template-columns: 1fr;
    }
    .bill-sheet-4up { width: 100%; }
}

.muted { color: var(--ink-soft); font-size: .9rem; }
.danger { color: var(--warn); }
.center { text-align: center; }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 32px 0; }
