/**
 * P2.31 — restyles public/prototype/checkout.js's dialog DOM contract
 * (identical class names, reused unmodified) with catalogue.css's
 * calm/light token system, replacing niva.css's tokens. Loaded after
 * catalogue.css so it inherits the shared :root design tokens.
 */

.checkout-dialog {
    width: min(480px, calc(100% - 32px));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 24px 60px #0e223924;
}
.checkout-dialog::backdrop { background: rgba(14, 34, 57, .45); }

.checkout-form {
    display: flex; flex-direction: column; gap: 14px;
    padding: 28px 26px 24px;
}
.checkout-form h2 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: 22px; font-weight: 500; }

.checkout-summary {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px; border-radius: 14px; background: var(--warm);
}
.checkout-summary-line { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.checkout-summary-total { margin: 4px 0 0; color: var(--navy); font-family: var(--serif); font-size: 19px; font-weight: 500; }

/* P2.48C — .checkout-price-row/.checkout-price-breakdown were already
   referenced by checkout.js's own markup but never actually styled
   anywhere; fixed here alongside the new promotion/policy disclosure,
   not a redesign of anything that previously had real styling. */
.checkout-price-breakdown { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.checkout-price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; font-size: 13px; color: var(--ink); }
.checkout-price-row span:last-child { flex: 0 0 auto; white-space: nowrap; }
.checkout-price-row-discount { color: #8c741f; }
.checkout-price-row-total {
    margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line);
    font-size: 16px; font-weight: 650; color: var(--navy);
}

/* P2.72 — the transfer is priced/disclosed but never charged by aAlabu
   (launch-v1: paid directly to the property), so it is visually set
   apart from the rows above that sum to "Amount charged by aAlabu now" —
   never left ambiguous about who collects what. */
.checkout-transfer-block { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.checkout-transfer-note { margin: 0; color: var(--navy); font-size: 12px; font-weight: 600; }
.checkout-price-row-trip-total { margin-top: 4px; color: var(--muted); font-style: italic; }
.checkout-summary-transfer { color: var(--navy); font-weight: 600; }

/* P2.51C — the one decision-critical cancellation fact, kept inside the
   stay/price summary card (near Total) so it is never a click away;
   the full terms live in .checkout-conditions below instead. Styled as
   plain statement text, not a form control or a policy-details
   disclosure, so it doesn't compete with either. */
.checkout-cancellation-status { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 650; line-height: 1.4; }

/* P2.51C — a clearly separated section, visually distinct from the
   traveller-details form fields above it: a top divider and its own
   small-caps heading, so "Booking conditions" reads as reference
   material to consult, not another field to fill in. */
.checkout-conditions { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.checkout-conditions-heading { margin: 0; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.checkout-policy-details { margin-top: 2px; }
.checkout-policy-details summary {
    cursor: pointer; font-size: 12px; font-weight: 650; color: var(--navy);
    text-transform: uppercase; letter-spacing: .04em;
}
.checkout-policy-details summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.checkout-policy-line { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.checkout-policy-tiers { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.checkout-security-note { margin: 0; color: var(--muted); font-size: 12px; font-style: italic; line-height: 1.5; }

.checkout-field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.checkout-field-row .checkout-field { flex: 1 1 160px; }
.checkout-field-narrow { flex: 0 1 130px; }

.checkout-field {
    display: flex; flex-direction: column; gap: 5px;
    font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.checkout-field input[type="text"],
.checkout-field input[type="email"],
.checkout-field select,
.checkout-field textarea {
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    font: inherit; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: normal;
    color: var(--ink); background: #fff;
}
.checkout-field textarea { min-height: 72px; padding: 10px 12px; resize: vertical; }
.checkout-field input:focus-visible,
.checkout-field select:focus-visible,
.checkout-field textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; }

.checkout-field-checkbox {
    flex-direction: row; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--ink);
}
.checkout-field-checkbox input { width: 18px; height: 18px; }

.checkout-form-status { min-height: 18px; margin: 0; color: var(--muted); font-size: 12px; font-style: italic; }
.checkout-form-status[data-kind="error"] { color: #9c3b2c; font-style: normal; font-weight: 650; }

/* CLOSE-4B.2 — the action-based Terms/cancellation-policy notice
   (no checkbox, per owner decision) tied to the final Pay action. Kept
   deliberately quiet in weight/size — matching .checkout-security-note
   just above it — while staying clearly readable and immediately
   adjacent to .checkout-form-actions so it reads as part of the same
   action, not a separate disclaimer. */
.checkout-agreement-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.checkout-agreement-note a, .checkout-agreement-note a:visited { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.checkout-agreement-note a:hover { color: var(--ink); }

.checkout-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.checkout-primary,
.checkout-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 20px; border-radius: 99px;
    font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; text-decoration: none;
}
.checkout-primary { border: 0; color: #fff; background: var(--navy); }
.checkout-primary:hover:not(:disabled) { background: #17334e; }
.checkout-primary:disabled { opacity: .55; cursor: not-allowed; }
.checkout-secondary { border: 1px solid var(--line); color: var(--navy); background: transparent; }
.checkout-secondary:hover { border-color: var(--gold); background: var(--warm); }
.checkout-primary:focus-visible,
.checkout-secondary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

.checkout-confirmation { text-align: left; }
.checkout-confirmation-reference {
    margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--warm);
    color: var(--navy); font-size: 14px; font-weight: 600;
}

/* P2.48D — the "payment received, do not pay again" notice: calm and
   clearly visible, deliberately NOT the red/alarming treatment a real
   error would get (this is not an error — money is safely known to
   have moved, and no further action is being requested of the
   traveller). */
.checkout-unavailable-notice {
    margin: 0; padding: 12px 14px; border-radius: 12px;
    background: var(--warm); border: 1px solid var(--gold);
    color: var(--navy); font-size: 14px; font-weight: 650; line-height: 1.5;
}

@media (max-width: 430px) {
    .checkout-dialog { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; }
    .checkout-form { padding: 22px 18px 20px; }
    .checkout-field-row { flex-direction: column; }
    /* P2.51A — .checkout-field-row .checkout-field's own `flex: 1 1 160px`
       (above) sets a WIDTH basis for the row's default flex-direction:row
       layout; once flex-direction flips to column here, that same 160px
       basis is reinterpreted along the vertical main axis, forcing every
       stacked field (First/Last name, Phone code/Phone number) to a
       160px-tall box regardless of its actual content height. Overriding
       the basis to `auto` restores normal, content-driven height —
       matching the Email field's own un-grouped, un-rowed sizing — without
       touching the ≥431px row layout this same base rule still controls. */
    .checkout-field-row .checkout-field { flex: 1 1 auto; }
    .checkout-form-actions { flex-direction: column-reverse; }
}
