/**
 * 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; }

/* Booking confirmed: property first, then the facts the guest needs, the amount paid and one clear next step. */
.checkout-confirmed { align-items: stretch; gap: 0; }
.checkout-confirmed-mark {
    display: inline-flex; align-items: center; justify-content: center; align-self: center; width: 46px; height: 46px; margin-bottom: 12px;
    border: 1px solid var(--gold); border-radius: 50%; color: #8c741f; background: #fffaf0;
}
.checkout-confirmed-eyebrow { margin: 0 0 4px; text-align: center; text-transform: uppercase; letter-spacing: .19em; font-size: .72rem; font-weight: 800; color: #8c741f; }
.checkout-confirmed h2 { margin: 0; text-align: center; }
.checkout-confirmed-room { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.checkout-confirmed-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line);
}
.checkout-confirmed-item dt { margin: 0 0 3px; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.checkout-confirmed-item dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--navy); line-height: 1.35; }
.checkout-confirmed-paid {
    display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--warm);
}
.checkout-confirmed-paid span { font-size: 13px; color: var(--muted); }
.checkout-confirmed-paid strong { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--navy); }
.checkout-confirmed .checkout-form-actions { margin-top: 20px; }
.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; }
}
.checkout-agreement-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checkout-agreement-check input { margin-top: 2px; width: 18px; height: 18px; flex: none; accent-color: #0E2239; }
.checkout-primary:disabled { opacity: .5; cursor: not-allowed; }

/* Sign in / create account over the checkout (compact, the booking stays visible behind it) */
.checkout-auth { border: 0; padding: 0; background: transparent; max-width: min(420px, calc(100vw - 32px)); width: 100%; overflow: visible; }
.checkout-auth::backdrop { background: rgba(14, 34, 57, .55); }
.checkout-auth-card { position: relative; background: #fff; color: #0E2239; border-radius: 16px; padding: 28px 24px 22px; box-shadow: 0 24px 60px rgba(14, 34, 57, .28); max-height: calc(100vh - 32px); overflow: auto; }
.checkout-auth-card h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; }
.checkout-auth-lead { margin: 0 0 18px; color: #4d5b6c; font-size: 14px; line-height: 1.5; }
.checkout-auth-close { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 28px; line-height: 1; color: #4d5b6c; cursor: pointer; }
.checkout-auth-socials { display: grid; gap: 10px; }
.checkout-auth-social { min-height: 48px; border: 1px solid #d7dce3; background: #fff; color: #0E2239; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.checkout-auth-social:hover { border-color: #D4AF37; }
.checkout-auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: #7a8696; font-size: 12px; }
.checkout-auth-or::before, .checkout-auth-or::after { content: ""; flex: 1; height: 1px; background: #e4e8ee; }
.checkout-auth-form { display: grid; gap: 12px; }
.checkout-auth-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.checkout-auth-form input { min-height: 48px; padding: 0 12px; border: 1px solid #cfd6df; border-radius: 10px; font: inherit; font-size: 16px; color: #0E2239; background: #fff; }
.checkout-auth-form input:focus-visible, .checkout-auth-social:focus-visible, .checkout-auth-close:focus-visible, .checkout-auth-switch button:focus-visible { outline: 2px solid #D4AF37; outline-offset: 2px; }
.checkout-auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkout-auth-hint { margin: -6px 0 0; color: #7a8696; font-size: 12px; }
.checkout-auth-error { min-height: 1.2em; margin: 0; color: #b3261e; font-size: 13px; }
.checkout-auth-form .checkout-primary { min-height: 50px; }
.checkout-auth-switch { margin: 16px 0 0; text-align: center; color: #4d5b6c; font-size: 13px; }
.checkout-auth-switch button { border: 0; background: none; padding: 8px 4px; color: #0E2239; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 420px) { .checkout-auth-row { grid-template-columns: 1fr; } }
