/*
 * YDT theme for the checkout - loaded AFTER styles.css on every page.
 *
 * Restyles the legacy checkout in the language of ydt.am and the theatre's EPG
 * payment pages: #02030c ground with the ydt.am starfield and veil, white type,
 * translucent surfaces with hairline borders, gold #c9a84c actions, Montserrat +
 * Noto Sans Armenian.
 *
 * Colours, type, surfaces and corners ONLY. No layout, size or spacing changes,
 * except the three requested ones, marked REQUESTED below: the larger agreement
 * checkbox, the promo code behind "I have a promo code", and the card-logo block.
 * Borders are drawn as inset box-shadows wherever a real border would add pixels.
 * The hall map keeps its seat shapes and price-tier colours: they carry meaning.
 */

/* ── Fonts (self-hosted, same files as ydt.am) ───────────────────────────── */

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/montserrat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/montserrat-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Noto Sans Armenian';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/noto-sans-armenian-armenian.woff2') format('woff2');
    unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17;
}

/* ── Tokens (DESIGN_GUIDE section 1, as on ydt.am and the payment pages) ─── */

:root {
    --ydt-bg: #02030c;
    --ydt-text: #ffffff;
    --ydt-text-muted: rgba(255, 255, 255, .7);
    --ydt-text-faint: rgba(255, 255, 255, .5);
    --ydt-accent: #c9a84c;
    --ydt-accent-ink: #14110a;
    --ydt-surface: rgba(255, 255, 255, .06);
    --ydt-surface-sunk: rgba(255, 255, 255, .04);
    --ydt-surface-solid: #0d0e1a;
    --ydt-line: rgba(255, 255, 255, .12);
    --ydt-line-strong: rgba(255, 255, 255, .3);
    --ydt-error: #FF007A;
    --ydt-error-text: #ff5c9d;
    --ydt-font: 'Montserrat', 'Noto Sans Armenian', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* The legacy names the rest of styles.css reads. */
    --text-primary: var(--ydt-text);
    --text-secondary: var(--ydt-text-muted);
    --bg-light: var(--ydt-surface-solid);
    --border-color: var(--ydt-line);
}

/* ── Ground: the ydt.am starfield under the landing's veil ───────────────── */

html { background: var(--ydt-bg); }

/* The colour lives on <html>: a body background would paint OVER the fixed
   starfield below (z-index -1 sits under in-flow block backgrounds). */
body {
    font-family: var(--ydt-font);
    background: transparent;
    color: var(--ydt-text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(2, 3, 12, .3) 0%, rgba(2, 3, 12, .6) 30%, rgba(2, 3, 12, .85) 60%, rgba(2, 3, 12, .95) 100%),
        url('img/ydt-bg.webp') center / cover no-repeat;
}

button, input, select, textarea { font-family: inherit; }

a { color: var(--ydt-accent); }

/* ── Header ──────────────────────────────────────────────────────────────── */

/* The 2px frame around the header stays; it is a hairline colour now. */
.event-header { background: var(--ydt-line); }
.event-header-inner { background: #0b0c17; color: var(--ydt-text); }

.theater-logo { filter: none; }
.theater-logo:hover { filter: opacity(.8); }

.legend-btn,
.back-btn-nav,
.lang-btn {
    background: var(--ydt-surface);
    color: var(--ydt-text);
    box-shadow: inset 0 0 0 1px var(--ydt-line);
}
.lang-btn:hover,
.legend-btn:hover,
.back-btn-nav:hover { background: rgba(255, 255, 255, .14); }
.lang-btn.active,
.lang-option.active { color: var(--ydt-accent); }

/* ── Loading ─────────────────────────────────────────────────────────────── */

.page-loader { background: var(--ydt-bg); }
.loader-spinner,
.spinner { border-color: rgba(255, 255, 255, .1); border-left-color: var(--ydt-accent); }
.event-loading-overlay { background: rgba(2, 3, 12, .95); }
.event-loading-content { background: var(--ydt-surface-solid); box-shadow: inset 0 0 0 1px var(--ydt-line); }
.loading-progress { background: rgba(255, 255, 255, .1); }
.progress-bar { background: linear-gradient(90deg, #a8873a, var(--ydt-accent)); }
.order-processing-loader .spinner-border,
.ticket-preparation-loader .spinner-border { border-color: rgba(255, 255, 255, .15); border-left-color: var(--ydt-accent); }

/* ── Hall map ────────────────────────────────────────────────────────────── */

.stage-block {
    border-color: var(--ydt-line-strong);
    background: var(--ydt-surface-sunk);
    color: var(--ydt-text-muted);
    letter-spacing: .3em;
}
.row-label,
.col-number { color: var(--ydt-text-faint); }

.zoom-hint {
    background: rgba(2, 3, 12, .72);
    color: var(--ydt-text-muted);
    box-shadow: inset 0 0 0 1px var(--ydt-line);
}
.zoom-out-btn {
    background: rgba(13, 14, 26, .85);
    color: var(--ydt-text);
    box-shadow: inset 0 0 0 1px var(--ydt-line-strong);
    clip-path: none;
    border-radius: 8px;
}
.zoom-out-btn:hover { background: rgba(255, 255, 255, .14); }

.legend-text,
.legend-panel,
.legend-panel .legend-text { color: var(--ydt-text-muted); }
.legend-panel .legend-item:hover { background: var(--ydt-surface); }

.seat:focus-visible { outline-color: var(--ydt-accent); }

/* ── Corners: ydt.am's rounded cards instead of the legacy chamfers ────────
   Seats and legend chips keep their shapes - those are the hall map's icons. */
.action-panel,
.seating-container.zoomed ~ .action-panel,
.order-details,
.error-explainer,
.hold-expired-content {
    clip-path: none;
    border-radius: 12px;
}

/* ── Action panel: chosen seats, totals, the details form ────────────────── */

.action-panel {
    background: rgba(13, 14, 26, .55);
    color: var(--ydt-text);
    box-shadow: inset 0 0 0 1px var(--ydt-line);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.seating-container.zoomed ~ .action-panel {
    background: rgba(13, 14, 26, .96);
    box-shadow: inset 0 1px 0 var(--ydt-line), 0 -2px 18px rgba(0, 0, 0, .45);
}
.seat-list-scrollbar { background: rgba(255, 255, 255, .14); }
.seat-list-thumb { background: var(--ydt-accent); }

.section-header,
.selected-seat-price,
.selected-seats-summary { color: var(--ydt-text); }
.selected-seats-total { color: var(--ydt-text); border-top-color: var(--ydt-line-strong); }
.selected-seats-discount,
.confirmation-promo-discount,
.promo-success { color: #7ddc9b; }

/* Inputs: sunk surfaces with hairlines, as on the payment page. */
.form-group input,
#email-input {
    background: var(--ydt-surface-sunk);
    color: var(--ydt-text);
    border-color: var(--ydt-line);
    border-radius: 8px;
    clip-path: none;
}
.form-group input::placeholder,
#email-input::placeholder { color: var(--ydt-text-faint); }
.form-group input:focus,
#email-input:focus {
    border-color: rgba(201, 168, 76, .7);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
}
/* payment-flow.js validates on open, so `.invalid` here means "required, not
   filled yet" (Pay stays disabled until it is) - a quiet gold cue, never an error. */
.form-group input.invalid { border-color: rgba(201, 168, 76, .45); }
.form-group input.invalid:focus { border-color: rgba(201, 168, 76, .7); }
.form-group label a { color: var(--ydt-accent); }
.form-note { color: var(--ydt-text-faint); }

/* REQUESTED: a larger agreement checkbox (26px, was ~13px native) that reads as
   required before it is touched: gold outline on a gold-tinted fill. The text sits
   in .checkbox-text, the label's second flex item. */
/* `.form-group label` (display:block, bold) outranks a bare class: match it. */
.form-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    line-height: 1.35;
    font-weight: 500;
    color: var(--ydt-text-muted);
    cursor: pointer;
}
.checkbox-label a { color: var(--ydt-accent); text-underline-offset: 2px; }
/* `.form-group input` gives every input 10px padding and a border, and the legacy
   #terms-agreement rule makes it inline - without its native look an inline input
   has no size at all. */
#terms-agreement {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    flex: none;
    float: none;
    padding: 0;
    border: 0;
    width: 26px;
    height: 26px;
    margin: 0;
    border-radius: 7px;
    background: rgba(201, 168, 76, .14);
    box-shadow: inset 0 0 0 2px var(--ydt-accent), 0 0 0 4px rgba(201, 168, 76, .12);
    cursor: pointer;
}
#terms-agreement:checked {
    background: var(--ydt-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M7 13.5l4 4L19.5 9' fill='none' stroke='%2314110a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 26px no-repeat;
    box-shadow: none;
}
/* `.invalid` is set from the moment the form opens (see above): the box keeps its
   gold "required" look until it is ticked. */
#terms-agreement:focus-visible { outline: 3px solid rgba(201, 168, 76, .5); outline-offset: 2px; }

/* REQUESTED: the promo code sits behind "I have a promo code". */
.promo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ydt-accent);
    font: inherit;
    font-size: .8em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(201, 168, 76, .45);
    text-underline-offset: 3px;
}
.promo-toggle::after {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
}
.promo-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.promo-field { margin-top: 10px; }
/* ui-components.js sets the error colour inline. */
.promo-error { color: var(--ydt-error-text) !important; }
.promo-field[hidden] { display: none; }

/* ── Buttons: gold primary, outlined secondary ───────────────────────────── */

.action-btn,
.checkout-btn,
.customer-details-form button[type="submit"] {
    background: var(--ydt-accent);
    color: var(--ydt-accent-ink);
    clip-path: none;
    border-radius: 8px;
}
.action-btn:hover:not(:disabled),
.checkout-btn:hover:not(:disabled) { background: var(--ydt-accent); filter: brightness(1.08); }
.action-btn:disabled,
.checkout-btn:disabled {
    background: transparent;
    color: rgba(255, 255, 255, .45);
    box-shadow: inset 0 0 0 1px rgba(201, 168, 76, .4);
    opacity: 1;
}
.back-btn {
    background: transparent;
    color: var(--ydt-text);
    box-shadow: inset 0 0 0 1px var(--ydt-line-strong);
}
.back-btn:hover:not(:disabled) { background: var(--ydt-surface); filter: none; }

/* ── REQUESTED: card logos as on the payment pages ───────────────────────── */
/* Arca's own marks and order (Mastercard | Visa | ArCa) on a white block,
   sized 43 / 64 / 80 px and Mastercard nudged 6px left, exactly as there. */
.personal-details-payment-methods {
    gap: 20px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
}
.personal-details-payment-methods img { display: block; height: auto; opacity: 1; }
.personal-details-payment-methods .payment-icon-mc { width: 43px; height: auto; position: relative; left: -6px; }
.personal-details-payment-methods .payment-icon-visa { width: 64px; height: auto; }
.personal-details-payment-methods .payment-icon-arca { width: 80px; height: auto; }
@media (max-width: 768px) {
    .personal-details-payment-methods {
        margin: 20px auto 16px;
        max-width: calc(100% - 32px);
        padding: 12px 16px;
        gap: 20px;
    }
}
.payment-methods-rule {
    flex: none;
    width: 1px;
    height: 28px;
    background: #D9D9D9;
}

/* ── Modals, notices, timers ─────────────────────────────────────────────── */

.modal-content,
.hold-expired-content {
    background: var(--ydt-surface-solid);
    color: var(--ydt-text);
    box-shadow: inset 0 0 0 1px var(--ydt-line), 0 20px 60px rgba(0, 0, 0, .6);
    border-color: transparent;
}
.hold-expired-content p { color: var(--ydt-text-muted); }
.hold-expired-modal { background: rgba(2, 3, 12, .78); }
.close { background: rgba(255, 255, 255, .1); color: var(--ydt-text); }
.close:hover { background: rgba(255, 255, 255, .2); color: var(--ydt-text); }

.hold-timer { color: var(--ydt-accent); }
.hold-timer--warning { color: #f0b429; }

.notification {
    background: var(--ydt-surface-solid);
    color: var(--ydt-text);
    border-left-color: var(--ydt-accent);
    box-shadow: inset 0 0 0 1px var(--ydt-line), 0 8px 24px rgba(0, 0, 0, .5);
}
.notification__close { color: var(--ydt-text-faint); }
.notification__close:hover,
.notification__close:focus-visible { color: var(--ydt-text); }

.reservation-error,
.alert-danger {
    background: rgba(255, 0, 122, .08);
    border-color: rgba(255, 0, 122, .45);
    color: var(--ydt-error-text);
}
.reservation-error .fas { color: var(--ydt-error); }
.reservation-loading,
.alert-info {
    background: var(--ydt-surface);
    border-color: var(--ydt-line);
    color: var(--ydt-text-muted);
}
#retry-reservation-btn { border-color: var(--ydt-error); color: var(--ydt-error-text); }
#retry-reservation-btn:hover { background: var(--ydt-error); color: #fff; }

.error-explainer {
    background: rgba(255, 0, 122, .1);
    box-shadow: inset 0 0 0 1px rgba(255, 0, 122, .45);
}
.error-explainer ul { color: var(--ydt-text-muted); }
.error-explainer ul li a { color: var(--ydt-accent); }

/* ── Confirmation page ───────────────────────────────────────────────────── */

.confirmation-container { color: var(--ydt-text); }
.order-details {
    background: var(--ydt-surface);
    color: var(--ydt-text);
    box-shadow: inset 0 0 0 1px var(--ydt-line);
}
.confirmation-next-steps,
.order-processing-loader p,
.ticket-preparation-loader p { color: var(--ydt-text-muted); }
.or-text { color: var(--ydt-text-faint); }
.ticket-pdf-canvas { border-color: var(--ydt-line); }

/* ── Focus ───────────────────────────────────────────────────────────────── */

.action-btn:focus-visible,
.lang-btn:focus-visible,
.legend-btn:focus-visible,
.back-btn-nav:focus-visible,
.zoom-out-btn:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible { outline-color: var(--ydt-accent); }

.visually-hidden-focusable:focus { background: var(--ydt-surface-solid); color: var(--ydt-text); }

/* ── User agreement (views/user-agreement-armenian.html, shown in the modal's
   iframe). Its own inline <style> drew dark-red headings on white, with body
   text in the page's light grey - barely readable. This sheet is linked after
   that block, so these win. ─────────────────────────────────────────────── */

.modal-legal-content {
    background: var(--ydt-surface-solid);
    color: var(--ydt-text);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px var(--ydt-line);
}
.legal-header h1,
.legal-section h2 { color: var(--ydt-text); }
.legal-section h3 { color: var(--ydt-accent); }
.legal-header p,
.legal-section p,
.legal-section li { color: rgba(255, 255, 255, .78); }
.legal-footer {
    background: var(--ydt-surface);
    border-color: var(--ydt-line);
}
.legal-footer p { color: var(--ydt-text); }
.legal-contact {
    background: rgba(201, 168, 76, .08);
    border-left-color: var(--ydt-accent);
}
.close-legal { color: var(--ydt-text-muted); }
.close-legal:hover { color: var(--ydt-text); background: rgba(255, 255, 255, .1); }

/* ── Tickets view (views/tickets-view.html): the PDFs stay on their white
   frames; only the page around them and its two status lines change. ────── */

#content > .loading { color: var(--ydt-text-muted); }
#content > .error { color: var(--ydt-error-text); }
#content .pdf-container { box-shadow: 0 2px 12px rgba(0, 0, 0, .5); }

/* ── Email typo guard (email-suggest.js) ─────────────────────────────────────
   "Did you mean …@gmail.com?" under the address, tap to accept; and the field
   the server refused because its domain cannot receive mail. */

.email-suggestion {
    margin-top: 6px;
    font-size: .85em;
    line-height: 1.4;
    color: var(--ydt-text-muted);
    text-align: left;
}
.email-suggestion[hidden] { display: none; }
.email-suggestion__fix {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--ydt-accent);
    text-decoration: underline;
    text-decoration-color: rgba(201, 168, 76, .5);
    text-underline-offset: 3px;
    cursor: pointer;
}
#email-form .email-suggestion { width: 65%; margin: -8px auto 12px; text-align: center; }

.form-group input.email-undeliverable,
.form-group input.email-undeliverable:focus {
    border-color: var(--ydt-error);
    box-shadow: 0 0 0 3px rgba(255, 0, 122, .15);
}

/* Confirmation: where the tickets went, first in "next steps". */
#tickets-sent-to { color: var(--ydt-text); font-weight: 600; }
