/* Vianomo registrering – oven på Bootstrap 6 (alpha.1).
   Brand-farver kommer fra SocialEvent-tabellen via CSS-variabler i _Layout og er kontrastjusteret server-side. */

body {
    background-color: var(--brand-body-bg, #fff);
    color: var(--brand-text, #1d1f23);
    font-family: var(--brand-font, inherit);
}

h1, h2, h3, h4, legend.h2, legend.h3 {
    color: var(--brand-heading, inherit);
}

/* Primærknapper i eventets farve */
.btn.theme-primary {
    --bs-theme-bg: var(--brand-accent);
    --bs-theme-contrast: var(--brand-accent-contrast);
    --bs-theme-border: var(--brand-accent);
}

/* Tydeligt fokus på alt interaktivt (WCAG 2.4.7 / 2.4.11) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--brand-accent, #0b5cad);
    outline-offset: 2px;
}

/* Spring-til-indhold-link: skjult indtil fokus */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 1000;
    padding: .75rem 1rem;
    background: #000;
    color: #fff;
    border-radius: .25rem;
}
.skip-link:focus { top: 1rem; }

main:focus { outline: none; }

.mode-banner {
    padding: .5rem 1rem;
    text-align: center;
    background: #fff3cd;
    color: #4d3800;
    border-bottom: 1px solid #e6c65c;
}
.mode-banner-dryrun {
    background: #1d1f23;
    color: #fff;
    border-bottom: 0;
}

/* Event-hoved */
.event-header {
    background-color: var(--brand-header-bg, #f4f5f7);
}
.event-logo {
    max-width: 250px;
    height: auto;
}
.event-title {
    text-transform: uppercase;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
}
.event-facts {
    font-weight: 600;
    margin-inline: 0;
}
.event-facts .bi {
    display: block;
    font-size: 2rem;
    margin-bottom: .25rem;
}

.page-content { max-width: 960px; }

/* Deltagertype-trin */
.type-choice legend { margin-bottom: 1.5rem; }
.type-options {
    display: grid;
    gap: .75rem;
}
.type-option {
    padding: 1rem;
    border: 1px solid var(--bs-border-color, #ccc);
    border-radius: .5rem;
    background: var(--bs-bg-body, #fff);
}
.type-option:has(input:checked) {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}
.type-option label {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    cursor: pointer;
}
.type-name { font-weight: 600; }
.selected-type { text-align: end; }

/* Handlingsknapper (Fortsæt / Tilmeld / Betal): fuld bredde på mobil, 50 % og centreret på desktop */
.form-actions { display: flex; justify-content: center; margin-block: 2.5rem 3rem; }
.form-actions .btn { width: 100%; }
@media (min-width: 768px) {
    .form-actions .btn { width: 50%; }
}

/* Tilvalg */
/* Hver valgmulighed: [input] [navn ...... pris], beskrivelse/tekstboks under navnet */
.addon {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .6rem;
    align-items: start;
    margin: 0 -.75rem;
    padding: .6rem .75rem;
    border-radius: .375rem;
    transition: background-color .15s ease;
}
.addon + .addon { margin-top: .35rem; }
.addon > label { cursor: pointer; }
.addon > :not(input):not(label) { grid-column: 2; }
.addon:hover,
.addon:has(input:focus-visible) {
    background-color: color-mix(in srgb, var(--brand-accent, #0b5cad) 9%, transparent);
}
.addon-name { font-weight: 600; }

/* Samme opbygning som deltagertype: navn til venstre, pris helt til højre */
.form-field.addon > label {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: .25rem 1rem;
    width: 100%;
    justify-self: stretch;
}
.addon-price {
    margin-inline-start: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .addon { transition: none; }
}

.addon-group {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color, #ddd);
    border-radius: .5rem;
}
.addon-group legend {
    float: none;
    width: auto;
    padding: 0 .25rem;
    margin-bottom: .5rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.addon-group-desc {
    margin: 0 0 .75rem;
    color: var(--bs-fg-2, inherit);
    white-space: pre-line;
}

.addon-comment {
    margin-top: .5rem;
    width: 100%;
}
.addon-group > .addon-comment { margin-top: .75rem; }

/* Tilvalg pr. deltager */
.participant-addons:focus { outline: none; }
.addons-title { font-size: 1.15rem; margin-bottom: .25rem; }
.addon-group-title { font-size: 1rem; font-weight: 700; }

/* Gæster */
.guest {
    margin-top: 1.25rem;
    padding: 1rem;
    /* Fast 2px ramme, så intet hopper ved hover – kun farven skifter. */
    border: 2px solid var(--bs-border-color, #ddd);
    border-radius: .5rem;
}
.guest { transition: border-color .15s ease; }
.guest:hover,
.guest:focus-within {
    border-color: var(--brand-accent);
}
@media (prefers-reduced-motion: reduce) {
    .guest { transition: none; }
}
.guest legend {
    float: none;
    width: auto;
    padding: 0 .25rem;
    font-size: 1.05rem;
    font-weight: 700;
}

/* Betalingsmetode */
.paymethod-options {
    display: grid;
    gap: .75rem;
}
.paymethod-option {
    padding: 1rem;
    border: 1px solid var(--bs-border-color, #ccc);
    border-radius: .5rem;
}
.paymethod-option:has(input:checked) {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}
.paymethod-option label { font-weight: 600; cursor: pointer; }

/* Hele kortet er klikbart: labelens klikflade strækkes over kortet (form-field er position: relative).
   Labelen forbliver kort, så skærmlæsere kun læser "Betalingskort"/"Faktura / EAN" som navn. */
.paymethod-option,
.type-option {
    position: relative;
    cursor: pointer;
}
.paymethod-option > label::after,
.type-option > label::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}
.paymethod-option:hover,
.type-option:hover {
    border-color: var(--brand-accent);
}
/* Fokusmarkering på hele kortet ved tastaturnavigation */
.paymethod-option:has(input:focus-visible),
.type-option:has(input:focus-visible) {
    outline: 3px solid var(--brand-accent, #0b5cad);
    outline-offset: 2px;
}
.pay-logos { display: inline-flex; gap: .5rem; vertical-align: middle; margin-inline-start: .5rem; }
.pay-logos .pay-logo { height: 24px; }
[hidden] { display: none !important; }

/* Pris */
.price-table { margin-bottom: 0; }
.price-table .price-total th,
.price-table .price-total td,
.receipt-table .price-total th,
.receipt-table .price-total td {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Formular */
/* Ekstra luft over hovedafsnit som Faktureringsoplysninger og Betalingsmetode */
.form-section-spaced { margin-top: 4rem; }
.form-section-spaced > h2,
.form-section-spaced > fieldset > legend { margin-bottom: 1rem; }
.req { color: #b00020; }
.required-note { font-size: .95rem; }
.error-text { color: #b00020; font-weight: 600; }
.error-summary a { color: inherit; font-weight: 600; }
.custom-field legend { font-size: 1rem; font-weight: 600; }

/* Knap, der ligner et link (til at åbne dialog) */
.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.pay-logo {
    height: 32px;
    width: auto;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--bs-border-color, #ddd);
}
.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
}
.site-footer address { font-style: normal; }

/* Dialog */
.terms-dialog { --bs-dialog-width: min(800px, 100%); }
.terms-dialog .dialog-body { overflow-y: auto; }
.terms-dialog h3 { font-size: 1.15rem; margin-top: 1.25rem; }
.terms-dialog h4 { font-size: 1rem; margin-top: 1rem; }

/* Kvittering */
.receipt {
    max-width: 820px;
    padding: 1.5rem;
    background: var(--bs-bg-body, #fff);
    border-radius: .5rem;
    box-shadow: 0 .25rem 1rem rgb(0 0 0 / .08);
}
.receipt-title { font-size: 1.35rem; text-transform: uppercase; }
.receipt-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .25rem 1rem;
    margin: 0;
}
.receipt-meta dd { margin: 0; text-align: end; }
.receipt-status,
.receipt-manage {
    padding: .75rem;
    border-radius: .5rem;
    text-align: center;
}
.receipt-status-paid,
.receipt-status-registered { background: #e3f4e8; color: #0f4d24; }
.receipt-status-pending,
.receipt-status-invoice { background: #fff3cd; color: #4d3800; }
.receipt-manage { background: #e2f0fb; color: #0b3d63; }
.receipt address { font-style: normal; }

/* Dry run-rapport */
.dryrun-report { border: 2px dashed #1d1f23; }
.dryrun-facts dt { font-weight: 700; margin-top: .5rem; }
.dryrun-log pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .8rem;
    background: #f4f5f7;
    color: #1d1f23;
    padding: .5rem;
    border-radius: .25rem;
}

@media print {
    .skip-link, .mode-banner, .receipt-tools, .site-footer { display: none !important; }
    .receipt { box-shadow: none; padding: 0; max-width: none; }
}
