/*
 * Public-facing styles — Theater bookings.
 * Aesthetic: editorial/playbill. Cormorant Garamond display, Inter body.
 * Deep burgundy (curtain) accent on warm parchment background.
 */
:root {
    --bg:           #faf6f0;          /* warm parchment */
    --bg-card:      #ffffff;
    --ink:          #1a1614;          /* near black with warmth */
    --ink-soft:     #5d534a;
    --rule:         #d9cfc1;
    --accent:       #5a1a1a;          /* burgundy */
    --accent-soft:  #f3e9e6;
    --accent-ink:   #3d0e0e;
    --gold:         #a87a3a;
    --shadow:       0 1px 2px rgba(60, 30, 20, .04), 0 12px 32px -8px rgba(60, 30, 20, .08);
    --radius:       6px;
    --serif:        'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
    --sans:         'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    font-size: 16px;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(168, 122, 58, .04), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(90, 26, 26, .03), transparent 50%);
    background-attachment: fixed;
}

.stage {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

/* ---------- Header (with logo) ---------- */
.stage-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
    position: relative;
}
.site-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 260px;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.stage-header h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    line-height: 1.15;
    margin: 0;
    color: var(--ink);
    letter-spacing: -.01em;
}
.stage-header .org {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-soft);
    margin: .5rem 0 0;
    font-size: 1.1rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

/* ---------- Step headings ---------- */
.step {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.5rem;
    margin: 0 0 1.25rem;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: .75rem;
    letter-spacing: -.005em;
}
.step-num {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    border-radius: 50%;
    font-family: var(--sans);
    font-size: .85rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ---------- Locked step state ---------- */
.step-locked[data-locked="true"] {
    opacity: .55;
    background: #faf7f2;
}
.step-locked[data-locked="true"] .seats-row,
.step-locked[data-locked="true"] .dates-for,
.step-locked[data-locked="true"] .total {
    pointer-events: none;
    filter: grayscale(.4);
}
.step-locked-msg {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ink-soft);
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: none;
}
.step-locked[data-locked="true"] .step-locked-msg {
    display: block;
}

/* ---------- Plays list ---------- */
.plays {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.play {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
    background: #fdfbf8;
}
.play:hover:not(.play-soldout) {
    border-color: var(--accent);
    background: #fff;
}
.play input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.play:has(input:checked) {
    border-color: var(--accent);
    border-width: 2px;
    padding: calc(1rem - 1px);
    background: var(--accent-soft);
}
.play-soldout {
    opacity: .55;
    cursor: not-allowed;
    background: #f5f1ec;
}

/* Poster thumbnail */
.play-thumb {
    flex-shrink: 0;
    width: 90px;
    height: 120px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--rule);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* When no poster — fallback to logo, styled differently to look intentional */
.play-thumb-fallback {
    background: #fbf7f2;
    border-color: var(--rule);
    padding: .5rem;
}
.play-thumb-fallback img {
    object-fit: contain;
    opacity: .85;
}

.play-body {
    flex: 1;
    min-width: 0;
}
.play-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: .3rem;
    color: var(--accent-ink);
}
.play-meta {
    font-size: .9rem;
    color: var(--ink-soft);
    margin-bottom: .25rem;
}
.play-meta .dot { margin: 0 .35rem; opacity: .5; }
.play-dates {
    font-weight: 500;
    color: var(--ink);
}
.play-notes {
    font-size: .88rem;
    color: var(--ink-soft);
    font-style: italic;
    margin: .35rem 0;
}
.play-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px dashed var(--rule);
    font-size: .9rem;
}
.price {
    font-weight: 600;
    color: var(--accent);
    font-family: var(--serif);
    font-size: 1.05rem;
}
.seats { color: var(--ink-soft); }

@media (max-width: 540px) {
    .play { padding: .85rem; }
    .play-thumb { width: 70px; height: 95px; }
    .play-title { font-size: 1.15rem; }
}

/* ---------- Date selector (step 2) ---------- */
.dates-for {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .65rem;
}
/* Critical: display:grid overrides [hidden], so we must force it */
.dates-for[hidden] {
    display: none !important;
}
.date-opt {
    cursor: pointer;
    position: relative;
}
.date-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.date-card {
    border: 1.5px solid var(--rule);
    border-radius: var(--radius);
    padding: .85rem .5rem;
    text-align: center;
    background: #fdfbf8;
    transition: border-color .15s, background .15s, transform .1s;
}
.date-opt:hover:not(.date-soldout) .date-card {
    border-color: var(--accent);
    background: #fff;
}
.date-opt input:checked + .date-card {
    border-color: var(--accent);
    border-width: 2px;
    padding: calc(.85rem - .5px) calc(.5rem - .5px);
    background: var(--accent-soft);
}
.date-opt.date-soldout {
    opacity: .5;
    cursor: not-allowed;
}
.date-opt.date-soldout .date-card {
    background: #f5f1ec;
}
.date-day {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 2rem;
    line-height: 1;
    color: var(--accent-ink);
}
.date-month {
    font-family: var(--sans);
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .12em;
    color: var(--ink-soft);
    font-weight: 600;
    margin-top: .15rem;
}
.date-weekday {
    font-family: var(--serif);
    font-style: italic;
    font-size: .85rem;
    color: var(--ink-soft);
    margin-top: .2rem;
}
.date-time {
    font-family: var(--sans);
    font-size: .85rem;
    color: var(--ink);
    margin-top: .35rem;
    font-weight: 500;
}
.date-seats {
    font-size: .75rem;
    color: var(--ink-soft);
    margin-top: .35rem;
    padding-top: .35rem;
    border-top: 1px dashed var(--rule);
}

/* ---------- Seats stepper ---------- */
.seats-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 240px;
}
.seat-btn {
    width: 44px; height: 44px;
    border: 1.5px solid var(--rule);
    background: var(--bg-card);
    border-radius: var(--radius);
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--accent);
    font-family: var(--serif);
    line-height: 1;
    transition: border-color .15s, background .15s;
}
.seat-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
#seats {
    flex: 1;
    text-align: center;
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 600;
    height: 44px;
    border: 1.5px solid var(--rule);
    border-radius: var(--radius);
    background: var(--bg-card);
}
.total {
    margin-top: 1rem;
    font-family: var(--serif);
    font-size: 1.2rem;
    color: var(--ink-soft);
}
.total strong { color: var(--accent); font-weight: 600; }

/* ---------- Form fields ---------- */
.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1rem;
}
.field > span {
    font-size: .88rem;
    color: var(--ink-soft);
    font-weight: 500;
    letter-spacing: .01em;
}
.field > span small { font-weight: 400; opacity: .8; }
.field input, .field textarea, .field select {
    padding: .7rem .85rem;
    font-size: 1rem;
    font-family: var(--sans);
    border: 1.5px solid var(--rule);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; font-family: var(--sans); }
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}
@media (max-width: 540px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- GDPR ---------- */
.gdpr-text {
    background: #fbf7f2;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: .92rem;
    line-height: 1.65;
    color: var(--ink-soft);
    margin-bottom: 1rem;
    max-height: 220px;
    overflow-y: auto;
}
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    cursor: pointer;
    font-size: .95rem;
    color: var(--ink);
}
.checkbox input { margin-top: .25rem; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Submit ---------- */
.submit {
    display: block;
    width: 100%;
    padding: 1.05rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: .02em;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 16px -4px rgba(90, 26, 26, .35);
}
.submit:hover { background: var(--accent-ink); box-shadow: 0 8px 24px -6px rgba(90, 26, 26, .45); }
.submit:active { transform: translateY(1px); }

/* ---------- Flash ---------- */
.flash {
    padding: .85rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .95rem;
    border-left: 3px solid;
}
.flash-error { background: #fdf2f0; border-color: #c0392b; color: #7d1f14; }
.flash-success { background: #f0f9f3; border-color: #2e7d4f; color: #1e5634; }
.flash-warning { background: #fdf6e8; border-color: #c98a16; color: #7d520e; }

/* ---------- Receipt (success page) ---------- */
.receipt { padding: 0; overflow: hidden; }
.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .9rem 1.5rem;
    border-bottom: 1px dashed var(--rule);
    font-size: 1rem;
    gap: 1rem;
}
.receipt-row:last-child { border-bottom: none; }
.receipt-row span { color: var(--ink-soft); font-size: .9rem; flex-shrink: 0; }
.receipt-row strong { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; text-align: right; }
.receipt-id { background: var(--accent-soft); }
.receipt-id code {
    background: #fff;
    padding: .2rem .5rem;
    border-radius: 3px;
    font-size: .85rem;
    color: var(--accent);
    border: 1px solid var(--rule);
}
.back { text-align: center; margin-top: 1.5rem; }
.back a { color: var(--accent); text-decoration: none; }
.back a:hover { text-decoration: underline; }

.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: 1.2rem;
    font-style: italic;
}

.stage-footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--ink-soft);
    font-size: .85rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}
.stage-footer a { color: var(--accent); text-decoration: none; }
.muted { color: var(--ink-soft); }

/* ---------- QR code on receipt ---------- */
.receipt-qr {
    padding: 1.25rem 1.5rem;
    text-align: center;
    border-top: 1px dashed var(--rule);
}
.receipt-qr canvas, .receipt-qr img {
    margin: 0 auto;
    display: block;
}

/* ---------- Booking policy card ---------- */
.policy-card {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, #fdfaf6 0%, #f9f3ea 100%);
}
.policy-text {
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ink);
    white-space: pre-line;
}

/* ---------- Cart items ---------- */
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--accent-soft);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin-bottom: .5rem;
}
.cart-item-info {
    flex: 1;
    min-width: 0;
    font-size: .92rem;
    line-height: 1.5;
}
.cart-remove {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border: 1.5px solid var(--rule);
    background: #fff;
    border-radius: 4px;
    color: var(--ink-soft);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color .12s, color .12s;
}
.cart-remove:hover {
    border-color: #c0392b;
    color: #c0392b;
}

/* Play cards as clickable (non-radio version) */
.play[tabindex] { cursor: pointer; }
.play[tabindex]:hover:not(.play-soldout) {
    border-color: var(--accent);
    background: #fff;
}
.play[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Seat stepper (redesigned) ---------- */
.seat-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 280px;
    margin: 0 auto;
    border: 2px solid var(--rule);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
}
.seat-stepper-btn {
    width: 64px;
    height: 64px;
    border: none;
    background: #fbf7f2;
    font-size: 1.8rem;
    font-family: var(--serif);
    color: var(--accent);
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.seat-stepper-btn:hover { background: var(--accent-soft); }
.seat-stepper-btn:active { background: var(--accent); color: #fff; }
.seat-stepper-value {
    flex: 1;
    text-align: center;
    border-left: 2px solid var(--rule);
    border-right: 2px solid var(--rule);
    padding: .5rem 0;
}
.seat-stepper-value input {
    width: 60px;
    text-align: center;
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--accent-ink);
    outline: none;
    -moz-appearance: textfield;
}
.seat-stepper-value input::-webkit-outer-spin-button,
.seat-stepper-value input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.seat-stepper-label {
    display: block;
    font-family: var(--sans);
    font-size: .8rem;
    color: var(--ink-soft);
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-top: -.15rem;
}
