/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-900: #004628;
    --blue-700: #1a3a6b;
    --blue-500: #2563eb;
    --blue-100: #dbeafe;
    --blue-50:  #eff6ff;
    --yellow:   #f5c400;
    --green:    #16a34a;
    --red:      #dc2626;
    --grey-800: #1e293b;
    --grey-600: #475569;
    --grey-300: #cbd5e1;
    --grey-100: #f1f5f9;
    --white:    #ffffff;
    --radius:   10px;
    --shadow:   0 4px 24px rgba(13,31,60,.10);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-serif:'DM Serif Display', Georgia, serif;
}

html { font-size: 16px; }

body {
    font-family: var(--font-sans);
    background: var(--blue-50);
    color: var(--grey-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.site-header {
    background: var(--blue-900);
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0 1.5rem;
}
.header-inner {
    max-width: 780px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #004628;
    padding: 0 1.5rem;
    height: 60px;
    border-radius: 6px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.header-doc-link {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px;
    padding: .3rem .65rem;
    transition: color .15s, border-color .15s, background .15s;
}
.header-doc-link:hover,
.header-doc-link--active {
    color: #00c800;
    border-color: #00c800;
    background: rgba(0,200,0,.08);
}

/* ── Main ── */
.site-main {
    flex: 1;
    padding: 3rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#page-alerts {
    width: 100%;
    max-width: 620px;
    margin-bottom: .25rem;
}

/* ── Form card ── */
.form-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-width: 620px;
    width: 100%;
    padding: 2.5rem 2.75rem;
}
.form-header { margin-bottom: 2rem; }
.form-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--blue-500);
    background: var(--blue-100);
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: .6rem;
}
.form-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--blue-900);
    line-height: 1.2;
    margin-bottom: .4rem;
}
.form-intro { color: var(--grey-600); font-size: 0.95rem; }

/* ── Field groups ── */
.field-group { margin-bottom: 1.25rem; }
.field-group label:not(.radio-option):not(.toggle-row),
.group-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--grey-800);
    margin-bottom: .35rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"] {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--grey-800);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
input.input-error { border-color: var(--red); }
input.input-error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

.field-error {
    display: block;
    font-size: 0.8125rem;
    color: var(--red);
    margin-top: .25rem;
    min-height: 1rem;
}

/* ── Phone input ── */
.phone-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.phone-input-wrap:focus-within {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.phone-prefix {
    background: var(--grey-100);
    padding: .625rem .75rem;
    font-size: 0.875rem;
    color: var(--grey-600);
    border-right: 1.5px solid var(--grey-300);
    white-space: nowrap;
    user-select: none;
}
.phone-input-wrap input[type="tel"] { border: none; border-radius: 0; flex: 1; }
.phone-input-wrap input[type="tel"]:focus { box-shadow: none; }

/* ── Radio groups ── */
.radio-group { display: flex; flex-direction: column; gap: .5rem; }
.radio-group--horizontal { flex-direction: row; flex-wrap: wrap; gap: .5rem; }

.radio-option {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .875rem;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.radio-option:hover { border-color: var(--blue-500); background: var(--blue-50); }
.radio-option--selected { border-color: var(--blue-500); background: var(--blue-50); }

.radio-option--payment {
    flex: 1 1 calc(50% - .25rem);
    min-width: 130px;
    justify-content: center;
    text-align: center;
}
.radio-option input[type="radio"] {
    accent-color: var(--blue-500);
    width: 16px; height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}
.radio-option--payment input[type="radio"] { display: none; }
.radio-option--payment.radio-option--selected {
    border-color: var(--blue-500);
    background: var(--blue-100);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    font-weight: 600;
}
.radio-option--payment.radio-option--selected .radio-label { color: var(--blue-700); }
.radio-label { font-size: 0.9rem; font-weight: 500; line-height: 1.3; }

/* ── Toggle switch ── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .875rem;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
}
.toggle-text { font-size: 0.9rem; font-weight: 500; color: var(--grey-800); }
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px; height: 26px;
    flex-shrink: 0;
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--grey-300);
    border-radius: 26px;
    transition: background .15s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px; height: 20px;
    left: 3px; top: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: transform .15s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue-500); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-slider { box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ── Divider ── */
.section-divider { border: none; border-top: 1px solid var(--grey-100); margin: 1.75rem 0; }

/* ── Submit ── */
.form-actions { margin-top: 2rem; }
.btn-submit {
    width: 100%;
    padding: .875rem 1.5rem;
    background: var(--blue-900);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .01em;
}
.btn-submit:hover { background: var(--blue-700); }
.btn-submit:active { transform: scale(.98); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Success banner ── */
.success-banner {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}
.success-icon {
    width: 64px; height: 64px;
    background: var(--green);
    color: var(--white);
    border-radius: 50%;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}
.success-banner h2 { font-family: var(--font-serif); font-size: 1.75rem; color: var(--blue-900); margin-bottom: .5rem; }
.success-banner p { color: var(--grey-600); }

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8125rem;
    color: var(--grey-600);
    border-top: 1px solid var(--grey-300);
    background: var(--white);
}

/* ── Adressevælger overrides ── */
.autocomplete-container { position: relative; width: 100%; }
.autocomplete-container input[type="search"] {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--grey-800);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.autocomplete-container input[type="search"]:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.autocomplete-container.autocomplete-error input[type="search"] { border-color: var(--red); }

.adressevaelger-suggestions {
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 24px rgba(13,31,60,.12) !important;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    z-index: 9999;
}
.adressevaelger-suggestion {
    padding: .5rem .875rem !important;
    border-color: var(--grey-100) !important;
    color: var(--grey-800) !important;
    transition: background .1s;
}
.adressevaelger-suggestion.dawa-selected,
.adressevaelger-suggestion:hover {
    background: var(--blue-50) !important;
    color: var(--blue-700) !important;
}

/* ── Address confirmation badge ── */
.address-badge {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
    padding: .45rem .75rem;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #166534;
    animation: fadeIn .2s ease;
}
.address-badge__icon { font-size: 0.9rem; flex-shrink: 0; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.radio-option--disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}
.radio-option--disabled .radio-label::after {
    content: ' (snart)';
    font-size: .75rem;
    font-weight: 400;
    color: var(--grey-600);
}

/* ── Validation error messages ── */
.error-msg {
    display: none;
    font-size: 0.8125rem;
    color: var(--red);
    margin-top: .25rem;
}
.error-msg.visible { display: block; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .form-card { padding: 1.5rem 1.25rem; }
    .form-header h1 { font-size: 1.6rem; }
    .radio-option--payment { flex: 1 1 100%; }
}
