/*
 * Public page in the style of the Remember Party flyer: dark red silk, white type, one column.
 * No external resources, no web fonts (system font stack). Optional images are activated by
 * body classes set in app/templates/layouts/public.php when the files exist:
 *   body.has-flyer-bg         -> assets/img/flyer-bg.jpg
 *   body.has-wordmark-image   -> assets/img/wordmark-remember-party.png
 * Contrast (WCAG 2.x, computed): white on #a3182a 7.7:1, on #8c1220 9.5:1, on #5a0a12 14.1:1,
 * on #3a060c 17.3:1; #2b0306 on white 18.8:1, on cream 16.8:1; #5a0a12 on white 14.1:1,
 * on cream 12.7:1. All text pairs are well above 4.5:1.
 */

:root {
    --red-darkest: #3a060c;
    --red-deep: #5a0a12;
    --red: #8c1220;
    --red-light: #a3182a;
    --white: #ffffff;
    --ink: #2b0306;
    --cream: #fbf1e4;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --focus: 3px solid var(--white);
}

/* Reset (small) */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background-color: var(--red-darkest);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body,
h1,
h2,
p,
fieldset,
legend {
    margin: 0;
    padding: 0;
}

fieldset {
    border: 0;
    min-width: 0;
}

[hidden] {
    display: none !important;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
textarea,
button {
    font: inherit;
}

/* Page: dark red silk gradient built in CSS */
body {
    min-height: 100vh;
    color: var(--white);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.5;
    background-color: var(--red-deep);
    background-image:
        linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.05) 40%, transparent 52%),
        linear-gradient(245deg, transparent 50%, rgba(255, 255, 255, 0.035) 62%, transparent 74%),
        radial-gradient(120% 60% at 15% 0%, rgba(163, 24, 42, 0.6), transparent 60%),
        radial-gradient(90% 50% at 100% 40%, rgba(140, 18, 32, 0.65), transparent 65%),
        radial-gradient(110% 70% at 0% 100%, rgba(58, 6, 12, 0.9), transparent 70%),
        linear-gradient(160deg, #6e0e18 0%, var(--red) 30%, var(--red-deep) 62%, var(--red-darkest) 100%);
    background-repeat: no-repeat;
    background-size: cover;
}

body.has-flyer-bg {
    background-image:
        linear-gradient(rgba(58, 6, 12, 0.35), rgba(58, 6, 12, 0.6)),
        url("../img/flyer-bg.jpg");
    background-position: center top;
}

.page {
    max-width: 40rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 2.5rem;
}

a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

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

/* Head: date, doors, logo, wordmark */
.flyer-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.flyer-head__date {
    font-size: clamp(2rem, 9.5vw, 4.25rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.05;
}

.flyer-head__doors {
    margin-top: 0.35rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.flyer-head__logo {
    width: 15rem;
    margin: 1.75rem auto 1rem;
}

.flyer-head__title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

/* Placeholder for the brush lettering: bold italic system font, replaced by an image when present */
.wordmark {
    /* One line at every width: the text is about 8.3em wide. */
    font-size: clamp(1.5rem, 7.4vw, 3rem);
    font-style: italic;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 0.95;
    white-space: nowrap;
}

body.has-wordmark-image .wordmark {
    height: clamp(5rem, 24vw, 8rem);
    background: url("../img/wordmark-remember-party.png") center / contain no-repeat;
}

body.has-wordmark-image .wordmark__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Content */
.lead {
    font-size: 1.1875rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.form {
    display: grid;
    gap: 1.5rem;
}

/* Fields: white bars on red, label always visible above */
.field {
    display: grid;
    gap: 0.4rem;
}

.field__label,
.companions__legend {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.field__input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 1rem;
    font-size: 1.125rem;
    color: var(--ink);
    background: var(--white);
    border: 0;
    border-radius: 2px;
}

.field__input--text {
    min-height: 6.5rem;
    resize: vertical;
    line-height: 1.4;
}

.field__input--code {
    max-width: 13rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    font-variant-numeric: tabular-nums;
}

.field__input:focus-visible {
    outline: var(--focus);
    outline-offset: 3px;
}

.field__hint {
    font-size: 0.9375rem;
}

.field__error {
    font-weight: 700;
    padding-left: 0.6rem;
    border-left: 4px solid var(--white);
}

.field--invalid .field__input {
    border-bottom: 5px solid var(--red-darkest);
}

/* Phone field with country selector (intl-tel-input, local copy in assets/vendor/). The library
   wraps the input in .iti and sets its left padding from JavaScript (no inline style in the markup).
   The country list is white with dark text, also as full-screen list on small screens. */
.iti {
    --iti-border-color: #8e8e96;
    --iti-hover-color: #f3e3e5;
    --iti-icon-color: var(--ink);
    --iti-country-selector-bg: var(--white);
}

.field .iti {
    display: block;
    width: 100%;
}

.iti__selected-country {
    color: var(--ink);
    font-size: 1.125rem;
}

.iti__selected-country:focus-visible {
    outline: var(--focus);
    outline-offset: 3px;
}

.iti__country-selector {
    color: var(--ink);
    font-size: 1rem;
}

.iti__search-input {
    font: inherit;
    color: var(--ink);
    background: var(--white);
}

.iti__search-input:focus-visible,
.iti__country-selector :focus-visible {
    outline: 3px solid var(--red-deep);
    outline-offset: -3px;
}

.iti__country.iti__highlight {
    color: var(--ink);
}

.iti__country-list .iti__dial-code {
    color: #5c4a4c;
}

/* Companions: large tappable numbers (radio buttons) */
.companions {
    display: grid;
    gap: 0.5rem;
}

.companions__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.companions__option {
    position: relative;
}

.companions__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.companions__label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.25rem;
    height: 4.25rem;
    font-size: 2rem;
    font-weight: 800;
    border: 3px solid var(--white);
    border-radius: 2px;
    cursor: pointer;
}

.companions__input:hover + .companions__label {
    background: rgba(255, 255, 255, 0.15);
}

.companions__input:checked + .companions__label {
    background: var(--white);
    color: var(--red-deep);
}

.companions__input:focus-visible + .companions__label {
    outline: var(--focus);
    outline-offset: 4px;
}

.companions__summary {
    margin-top: 0.25rem;
    font-size: 1.125rem;
    font-weight: 700;
}

/* Consent checkbox */
.check {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.check__input {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.1rem 0 0;
    accent-color: var(--white);
}

/* The one main button */
.btn-primary {
    display: block;
    width: 100%;
    min-height: 3.5rem;
    padding: 0.9rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red-deep);
    background: var(--white);
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background: var(--cream);
}

.btn-primary:focus-visible {
    outline: var(--focus);
    outline-offset: 4px;
}

/* Locked by public.js after the first click (double-submit protection) */
.btn-primary:disabled {
    background: var(--cream);
    cursor: progress;
}

/* Notices: light boxes with dark red text, or white outline on red */
.notice {
    padding: 0.9rem 1rem;
    overflow-wrap: anywhere;
    font-weight: 600;
    border: 2px solid var(--white);
    border-radius: 2px;
}

.notice--error {
    color: var(--red-deep);
    background: var(--white);
    border-left-width: 8px;
    border-color: var(--red-darkest);
}

.notice--success {
    color: var(--ink);
    background: var(--cream);
    border-color: var(--cream);
}

/* Status pages (sold out, verification result) */
/* Pages without a form (sold out, closed, not open yet): centred like the flyer head. */
.status-block {
    text-align: center;
}

.status-title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.625rem, 7.5vw, 2.5rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lead--after,
.notice + .form {
    margin-top: 1.5rem;
}

/* Sign-up wizard: progress (text plus one bar segment per step), secondary actions as links */
.progress {
    margin-bottom: 1.25rem;
}

.progress__text {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.progress__bar {
    display: flex;
    gap: 0.375rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.progress__segment {
    flex: 1 1 0;
    height: 0.375rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
}

.progress__segment--done {
    background: rgba(255, 255, 255, 0.55);
}

.progress__segment--active {
    background: var(--white);
}

.field__value {
    font-size: 1.125rem;
    font-weight: 600;
}

.break-anywhere {
    overflow-wrap: anywhere;
}

.wizard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.9375rem;
}

.wizard-links__form {
    margin: 0;
}

/* A form button that looks like a link (secondary actions next to the one main button) */
.btn-link {
    padding: 0.25rem 0;
    font-size: inherit;
    font-weight: 600;
    color: var(--white);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.btn-link:focus-visible {
    outline: var(--focus);
    outline-offset: 3px;
}

/* Announces the wizard step to screen readers after public.js swapped the content */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* The step heading receives the focus after a step change (tabindex -1, no ring for the mouse) */
.status-title:focus {
    outline: none;
}

.status-title:focus-visible {
    outline: var(--focus);
    outline-offset: 4px;
}

/* Honeypot: off-screen for people, still filled in by simple bots */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Foot: venue with address and web address, as on the flyer */
.flyer-foot {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.flyer-foot__logo {
    width: 10rem;
    margin: 0 auto 0.75rem;
}

.flyer-foot__web {
    margin-top: 0.4rem;
    text-transform: none;
}

@media (min-width: 600px) {
    .page {
        padding: 3.5rem 2rem 3rem;
    }

    .flyer-head__logo {
        width: 18rem;
    }

    .companions__label {
        width: 5rem;
        height: 5rem;
        font-size: 2.25rem;
    }
}

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