/**
 * P2.31 — restyles public/prototype/booking.js's DOM contract (identical
 * class names, reused unmodified) with catalogue.css's calm/light token
 * system, replacing niva.css's tokens. Same discipline catalogue.css
 * itself documents: a separate stylesheet, loaded after catalogue.css so
 * it inherits the shared :root design tokens without redefining them.
 */

/* P2.48B — `.sr-only` is referenced by this page's own markup (the
   message composer's label, and this phase's rating-group legend) but
   was never actually defined anywhere in this stylesheet family — a
   pre-existing gap, fixed here since it now visibly affects new markup.
   Standard visually-hidden-but-announced utility, not a redesign of
   anything else on the page. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.booking-shell {
    width: min(760px, calc(100% - 32px));
    margin-inline: auto;
    padding-block: 32px 96px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.booking-state { padding: 48px 0; text-align: center; color: var(--muted); }
.booking-state-not-found h1 { font-family: var(--serif); font-size: 1.5rem; color: var(--navy); margin: 0 0 12px; }
.booking-state-not-found p { max-width: 48ch; margin-inline: auto; }

.booking-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 26px #0e223912;
}

.booking-hero { text-align: center; }
.booking-hero h1 { font-family: var(--serif); font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.1rem); margin: 4px 0 12px; color: var(--navy); font-weight: 500; }
.booking-eyebrow { text-transform: uppercase; letter-spacing: .19em; font-size: .72rem; color: #8c741f; margin: 0 0 4px; font-weight: 800; }
.booking-reference { font-size: 1.05rem; margin: 0 0 12px; color: var(--ink); }
.booking-status-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 99px;
    background: var(--warm);
    color: var(--navy);
    font-size: .85rem;
    font-weight: 600;
    text-transform: capitalize;
    margin: 0;
}

.booking-card h2 { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 16px; color: var(--navy); font-weight: 500; }
.booking-muted { color: var(--muted); font-size: .92rem; }

.booking-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px 24px;
    margin: 0;
}
.booking-info-row dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 2px; }
.booking-info-row dd { margin: 0; font-size: .98rem; color: var(--ink); }

.booking-total { font-size: 1.6rem; font-weight: 600; color: var(--navy); margin: 0 0 16px; }
.booking-total .booking-muted { font-size: .95rem; font-weight: 400; }

.booking-charge-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; color: var(--ink); }
.booking-charge-list-optional { color: var(--muted); }

/* P2.48C — promotion/transfer/structured-policy disclosure, mirroring
   catalogue-checkout.css's own equivalent classes so the two pages read
   as one consistent design language. */
.booking-promotion-line { margin: 0 0 8px; color: #8c741f; font-size: .92rem; }
.booking-transfer { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.booking-transfer-title { margin: 0 0 2px; font-weight: 600; color: var(--ink); }
/* P2.72 — the transfer amount shown here was never collected by aAlabu;
   this note must read as a distinct commercial fact, not blend into the
   surrounding disclosure. */
.booking-transfer-payable-note { margin: 2px 0 0; color: var(--navy); font-weight: 600; font-size: .88rem; }
.booking-policy-subheading {
    margin: 18px 0 4px; font-size: .78rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted);
}
.booking-policy-tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: .92rem; color: var(--ink); }

/* Booking-scoped conversation */
.booking-messages-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.booking-messages-head h2 { margin: 0; }
.booking-messages-refresh {
    min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px;
    background: transparent; color: var(--navy); font-size: .82rem; font-weight: 600; cursor: pointer;
}
.booking-messages-new-badge {
    display: inline-flex; align-items: center; padding: 3px 10px; margin-bottom: 10px; border-radius: 99px;
    background: var(--warm); color: var(--navy); font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}

.booking-message-thread { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; }
.booking-message { max-width: 80%; padding: 10px 14px; border-radius: 14px; background: var(--warm); }
.booking-message-property { align-self: flex-start; border: 1px solid var(--line); background: #fff; }
.booking-message-traveller { align-self: flex-end; background: #f1ecdd; }
.booking-message-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.booking-message-sender { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); }
.booking-message-time { font-size: .72rem; color: var(--muted); }
.booking-message-body { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

.booking-message-composer { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.booking-message-composer textarea {
    width: 100%; min-height: 84px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
    font: inherit; font-size: .92rem; color: var(--ink); resize: vertical;
}
.booking-message-composer button { align-self: flex-end; min-height: 44px; padding-inline: 20px; }
.booking-message-error { margin: 0; color: #a3392f; font-size: .82rem; }
.booking-message-closed-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warm); }

/* Cancellation */
.booking-status-pill[data-status="cancelled"] { background: #f8e4e1; color: #a3392f; }

.booking-cancel-start {
    min-height: 44px; padding: 0 20px; margin-top: 14px; border: 1px solid #a3392f; border-radius: 99px;
    background: transparent; color: #a3392f; font-size: .88rem; font-weight: 650; cursor: pointer;
}
.booking-cancel-confirm { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--warm); }
.booking-cancel-confirm p { margin: 0 0 8px; font-size: .92rem; color: var(--ink); }
.booking-cancel-confirm textarea {
    width: 100%; min-height: 64px; margin-bottom: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
    font: inherit; font-size: .88rem; color: var(--ink); resize: vertical;
}
.booking-cancel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.booking-cancel-back, .booking-cancel-confirm-button {
    min-height: 44px; padding: 0 18px; border-radius: 99px; font-size: .86rem; font-weight: 650; cursor: pointer;
}
.booking-cancel-back { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.booking-cancel-confirm-button { background: #a3392f; border: 1px solid #a3392f; color: #fff; }
.booking-cancel-confirm-button:disabled, .booking-cancel-back:disabled { opacity: .6; cursor: default; }
.booking-cancellation-summary { margin-top: 14px; }
.booking-cancellation-summary .booking-status-pill { margin: 0 0 10px; }

/* booking.js's message-send button reuses the `checkout-primary` class
   name from checkout.js's dialog markup — defined here too (not by
   pulling in the whole checkout-dialog stylesheet, which is irrelevant
   on this page) so the two stay visually consistent without a shared
   dependency neither page fully needs. */
.checkout-primary {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 20px; border-radius: 99px; border: 0;
    background: var(--navy); color: #fff; font: inherit; font-weight: 650;
    font-size: .88rem; cursor: pointer; text-decoration: none;
}
.checkout-primary:hover:not(:disabled) { background: #17334e; }
.checkout-primary:disabled { opacity: .55; cursor: not-allowed; }
.checkout-primary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Amendment ("Change reservation") — P2.48A. Deliberately restrained:
   one secondary entry action, whitespace before borders, no badge/chip
   clutter. Status is never colour-only — every pill carries its own
   plain-language text. */
.booking-change-start {
    min-height: 44px; padding: 0 20px; border: 1px solid var(--navy); border-radius: 99px;
    background: transparent; color: var(--navy); font-size: .88rem; font-weight: 650; cursor: pointer;
}
.booking-change-start:hover { background: var(--warm); }
.booking-change-start:focus-visible,
.booking-amend-cancel:focus-visible,
.booking-amend-withdraw:focus-visible,
.booking-amend-option:focus-within,
.booking-change-start:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.booking-amend-intro { margin: 0 0 14px; font-size: .92rem; color: var(--ink); }

.booking-amend-fields { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 14px; }
.booking-amend-field {
    display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em; flex: 1 1 160px;
}
.booking-amend-field input, .booking-amend-field select {
    font: inherit; font-size: .95rem; color: var(--ink); text-transform: none; letter-spacing: normal;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.booking-amend-field input:focus-visible, .booking-amend-field select:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; }

.booking-amend-options { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.booking-amend-option {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
}
.booking-amend-option:has(input:checked) { border-color: var(--navy); background: var(--warm); }
.booking-amend-option input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--navy); }
.booking-amend-option-info { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.booking-amend-option-info strong { font-size: .95rem; color: var(--ink); overflow-wrap: anywhere; }
.booking-amend-option-price { flex: 0 0 auto; font-weight: 650; color: var(--navy); white-space: nowrap; }

.booking-amend-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.booking-amend-cancel {
    min-height: 44px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line);
    background: transparent; color: var(--ink); font-size: .86rem; font-weight: 650; cursor: pointer;
}

.booking-amend-compare-heading { margin: 0 0 12px; font-size: .92rem; color: var(--muted); }
.booking-amend-compare { margin: 0 0 14px; display: flex; flex-direction: column; gap: 12px; }
.booking-amend-compare-row dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; }
.booking-amend-compare-row dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: .95rem; }
.booking-amend-was { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.booking-amend-now { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.booking-amend-consequence { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--warm); color: var(--navy); font-size: .92rem; font-weight: 600; }

.booking-amend-status { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.booking-amend-status .booking-status-pill { margin: 0; }
.booking-amend-status p { margin: 0; }
.booking-amend-pay { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; }
.booking-amend-withdraw {
    min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--muted);
    font-size: .82rem; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.booking-form-status { margin: 0; font-size: .85rem; color: var(--muted); }
.booking-form-status:not(:empty) { color: #a3392f; }

.booking-status-pill[data-status="awaiting_additional_payment"],
.booking-status-pill[data-status="awaiting_refund_treatment"],
.booking-status-pill[data-status="requested"],
.booking-status-pill[data-status="property_accepted"] { background: var(--warm); color: var(--navy); }
.booking-status-pill[data-status="property_rejected"],
.booking-status-pill[data-status="withdrawn"],
.booking-status-pill[data-status="expired"] { background: #f1eee6; color: var(--muted); }

.booking-amend-history { margin-top: 16px; }
.booking-amend-history summary { cursor: pointer; font-size: .86rem; font-weight: 650; color: var(--navy); }
.booking-amend-history-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.booking-amend-history-list li { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--ink); }

/* Review ("How was your stay?") — P2.48B. One restrained secondary
   action, reusing the amendment flow's own button/field/error classes
   for the form actions so no new visual language is introduced. */
.booking-review-start {
    min-height: 44px; padding: 0 20px; margin-top: 4px; border: 1px solid var(--navy); border-radius: 99px;
    background: transparent; color: var(--navy); font-size: .88rem; font-weight: 650; cursor: pointer;
}
.booking-review-start:hover { background: var(--warm); }
.booking-review-start:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.review-ratings { border: 0; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.review-rating-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.review-rating-label { font-size: .92rem; color: var(--ink); flex: 1 1 140px; }

/* Native radios drive :checked — the star fill needs no JS. Emitted
   10 (leftmost meaning) down to 1 in DOM order and laid out
   row-reverse so the general-sibling selector below, which can only
   ever match LATER dom siblings, reaches every lower-numbered star. */
.review-stars { display: flex; flex-direction: row-reverse; gap: 2px; }
.review-stars input {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.review-stars label {
    cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--line);
    padding: 6px 2px; min-width: 22px; min-height: 22px; text-align: center; border-radius: 4px;
}
.review-stars input:checked ~ label,
.review-stars label:hover,
.review-stars label:hover ~ label { color: #b8901f; }
.review-stars input:focus-visible + label { outline: 3px solid var(--navy); outline-offset: 1px; }

.review-field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.review-field input, .review-field textarea {
    font: inherit; font-size: .95rem; color: var(--ink); text-transform: none; letter-spacing: normal;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.review-field textarea { min-height: 90px; resize: vertical; }
.review-field input:focus-visible, .review-field textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; }

@media (max-width: 430px) {
    .booking-shell { padding-block: 20px 64px; }
    .booking-card { padding: 18px; border-radius: 16px; }
    .booking-message { max-width: 92%; }
    .booking-cancel-actions { flex-direction: column; }
    .booking-cancel-back, .booking-cancel-confirm-button { width: 100%; }
    .booking-amend-fields { flex-direction: column; gap: 12px; }
    .booking-amend-actions { flex-direction: column; }
    .booking-amend-actions .checkout-primary, .booking-amend-actions .booking-amend-cancel { width: 100%; }
    .booking-amend-option { flex-wrap: wrap; }
    .booking-amend-option-price { margin-left: auto; }
    .review-rating-row { justify-content: flex-start; }
    .review-stars { gap: 0; }
    .review-stars label { min-width: 26px; min-height: 26px; padding: 8px 2px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}
