/* Landing page checkout dialog (landing-checkout.js). Loaded on /landing only when an
   offer button is shown. Colours come from the landing theme variables (--pw-*), so
   Super Admin → Theme & Colors applies here too. 8px spacing scale throughout. */
.lp-price-note { display: block; margin-top: 4px; font-size: 13px; color: var(--pw-text, #586079); }

.lpc {
    --lpc-ink: var(--pw-heading, #040926); --lpc-text: var(--pw-text, #586079); --lpc-muted: #6b7280;
    --lpc-line: #e3e6ee; --lpc-field: #d3d8e3; --lpc-tint: var(--pw-section-bg, #f5f6fa); --lpc-red: var(--pw-button, #d60309);
    border: 0; padding: 0; margin: auto; width: min(960px, calc(100vw - 48px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
    border-radius: 20px; background: var(--pw-card-bg, #fff); color: var(--lpc-text); box-shadow: 0 32px 80px rgba(4, 9, 38, .32); overflow: hidden;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.lpc[open] { display: flex; animation: lpc-in .24s ease-out both; }
.lpc::backdrop { background: rgba(4, 9, 38, .64); backdrop-filter: blur(3px); }
@keyframes lpc-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
.lpc-shell { display: flex; flex-direction: column; width: 100%; min-height: 0; max-height: inherit; }

/* Header: title, step indicator, close */
.lpc-header { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding: 20px 24px 16px 32px; border-bottom: 1px solid var(--lpc-line); }
.lpc-header h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.01em; color: var(--lpc-ink); }
.lpc-steps { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0 auto 0 0; padding: 0; font-size: 13px; font-weight: 600; color: #8a90a6; }
.lpc-steps li { display: inline-flex; align-items: center; gap: 8px; }
.lpc-steps li + li::before { content: ''; width: 24px; height: 2px; border-radius: 2px; background: var(--lpc-line); margin-right: 0; }
.lpc-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lpc-tint); color: #8a90a6; font-size: 12px; font-weight: 700; transition: background .2s, color .2s; }
.lpc-steps li.is-active { color: var(--lpc-ink); }
.lpc-steps li.is-active .lpc-dot { background: var(--lpc-red); color: #fff; }
.lpc-steps li.is-done .lpc-dot { background: #16a34a; color: transparent; position: relative; }
.lpc-steps li.is-done .lpc-dot::after { content: ''; position: absolute; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.lpc-steps li.is-done + li::before { background: #16a34a; }
.lpc-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--lpc-ink); font-size: 18px; cursor: pointer; flex: none; }
.lpc-close:hover { background: var(--lpc-tint); }

/* Body: form (scrolls) + order summary */
.lpc-body { display: grid; grid-template-columns: minmax(0, 1fr) 296px; flex: 1 1 auto; min-height: 0; }
.lpc-main { overflow-y: auto; padding: 16px 32px 24px; min-height: 0; overscroll-behavior: contain; }
.lpc-summary { overflow-y: auto; padding: 24px; background: var(--lpc-tint); }
.lpc-summary h3 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.35; color: var(--lpc-ink); }
.lpc-summary ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; font-size: 13px; line-height: 1.45; }
.lpc-summary li { position: relative; padding-left: 24px; }
.lpc-summary li::before { content: ''; position: absolute; left: 2px; top: 4px; width: 6px; height: 10px; border: solid #16a34a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lpc-summary dl { margin: 0; padding-top: 16px; border-top: 1px dashed var(--lpc-field); display: grid; gap: 8px; font-size: 14px; }
.lpc-summary dl > div, .lpc-rows > div { display: flex; justify-content: space-between; gap: 16px; }
.lpc-summary dt { color: var(--lpc-muted); }
.lpc-summary dd { margin: 0; font-weight: 600; color: var(--lpc-ink); text-align: right; }
.lpc-summary .is-total { padding-top: 8px; font-size: 16px; }
.lpc-summary .is-total dd { font-size: 1.35rem; font-weight: 800; }

.lpc-intro { margin: 0 0 16px; font-size: 14px; line-height: 1.55; }
.lpc-status { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.45; background: #eef2ff; color: #1e3a8a; }
.lpc-status.is-error { background: #fef2f2; color: #991b1b; }

/* One field style: label, control, reserved hint/error line */
.lpc-group { border: 0; margin: 0 0 4px; padding: 0; min-width: 0; }
.lpc-group + .lpc-group { padding-top: 12px; border-top: 1px solid var(--lpc-line); }
.lpc-group legend { padding: 0; margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lpc-muted); }
.lpc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
.lpc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lpc-field.is-full, .lpc-check.is-full { grid-column: 1 / -1; }
.lpc-field[hidden] { display: none; }
.lpc-field > label { font-size: 13px; font-weight: 600; color: var(--lpc-ink); }
.lpc-optional { font-weight: 400; color: var(--lpc-muted); }
.lpc-field input, .lpc-field select, .lpc-prefix {
    box-sizing: border-box; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--lpc-field); border-radius: 10px;
    background: #fff; font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--lpc-ink); transition: border-color .15s, box-shadow .15s;
}
.lpc-field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; }
.lpc-field input::placeholder { color: #9aa1b2; font-weight: 400; }
.lpc-field input:focus, .lpc-field select:focus, .lpc-prefix:focus-within { outline: none; border-color: var(--pw-primary, #1e3a8a); box-shadow: 0 0 0 3px rgba(30, 58, 138, .14); }
.lpc-field [aria-invalid="true"], .lpc-prefix:has([aria-invalid="true"]) { border-color: #dc2626; }
.lpc-prefix { display: flex; align-items: center; gap: 8px; padding: 0 0 0 14px; }
.lpc-prefix span { color: var(--lpc-muted); font-weight: 600; }
.lpc-prefix input { height: 44px; border: 0; padding: 0 14px 0 0; box-shadow: none !important; background: transparent; }
/* Chrome autofill: keep the white field and dark text instead of the light-blue fill */
.lpc input:-webkit-autofill, .lpc input:-webkit-autofill:hover, .lpc input:-webkit-autofill:focus, .lpc select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset; box-shadow: 0 0 0 1000px #fff inset; -webkit-text-fill-color: var(--lpc-ink); caret-color: var(--lpc-ink); transition: background-color 9999s ease-out 0s;
}
.lpc-hint { min-height: 18px; margin: 0 0 4px; font-size: 12px; line-height: 1.5; color: var(--lpc-muted); }
.lpc-hint.is-error { color: #b91c1c; font-weight: 600; }
.lpc-hint--center { text-align: center; }
.lpc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lpc-chip { display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--lpc-field); border-radius: 999px; background: #fff; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--lpc-ink); cursor: pointer; transition: border-color .15s, background .15s; }
.lpc-chip span { font-weight: 500; color: var(--lpc-muted); }
.lpc-chip:hover { border-color: var(--lpc-ink); }
.lpc-chip.is-selected { border-color: var(--lpc-red); background: #fff4f4; }
.lpc-check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; margin: -4px 0 8px; font-size: 14px; font-weight: 500; color: var(--lpc-ink); cursor: pointer; }
.lpc-check input { width: 18px; height: 18px; accent-color: var(--lpc-red); }
.lpc-chip:focus-visible, .lpc-close:focus-visible, .lpc-link:focus-visible, .lpc-check input:focus-visible { outline: 3px solid var(--pw-accent, #ff040a); outline-offset: 2px; }

/* WhatsApp code: 6 boxes */
.lpc-otp { text-align: center; padding-top: 24px; }
.lpc-otp-boxes { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.lpc-otp-box { width: 48px; height: 56px; border: 1px solid var(--lpc-field); border-radius: 12px; background: #fff; text-align: center; font-family: inherit; font-size: 22px; font-weight: 700; color: var(--lpc-ink); }
.lpc-otp-box:focus { outline: none; border-color: var(--pw-primary, #1e3a8a); box-shadow: 0 0 0 3px rgba(30, 58, 138, .14); }
.lpc-otp-box[aria-invalid="true"] { border-color: #dc2626; }
.lpc-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; }
.lpc-links--start { justify-content: flex-start; }
.lpc-link { min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--pw-link, #1e3a8a); font-family: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lpc-link:disabled { color: var(--lpc-muted); text-decoration: none; cursor: default; }

/* Review rows */
.lpc-subhead { margin: 8px 0 12px; font-size: 1rem; color: var(--lpc-ink); }
.lpc-rows { margin: 0 0 8px; display: grid; gap: 0; font-size: 14px; }
.lpc-rows > div { padding: 10px 0; border-bottom: 1px solid var(--lpc-line); }
.lpc-rows > div:last-child { border-bottom: 0; }
.lpc-rows dt { color: var(--lpc-muted); flex: none; }
.lpc-rows dd { margin: 0; text-align: right; font-weight: 600; color: var(--lpc-ink); overflow-wrap: anywhere; }

/* Results */
.lpc-result { text-align: center; padding: 16px 0 8px; }
.lpc-result h3 { margin: 12px 0 8px; font-size: 1.35rem; color: var(--lpc-ink); }
.lpc-result > p { margin: 0 auto 16px; max-width: 460px; line-height: 1.55; }
.lpc-result .lpc-rows { text-align: left; max-width: 460px; margin: 0 auto 8px; }
.lpc-tick { width: 64px; height: 64px; }
.lpc-tick circle { fill: none; stroke: #16a34a; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: lpc-draw .6s ease-out forwards; }
.lpc-tick path { fill: none; stroke: #16a34a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: lpc-draw .35s .5s ease-out forwards; }
@keyframes lpc-draw { to { stroke-dashoffset: 0; } }
.lpc-next { max-width: 460px; margin: 0 auto 16px; padding: 16px 20px; border-radius: 14px; background: var(--lpc-tint); text-align: left; }
.lpc-next h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--lpc-muted); }
.lpc-next ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; }
.lpc-next strong { color: var(--lpc-ink); }
.lpc-account { font-size: 14px; }
.lpc-account a { color: var(--pw-link, #1e3a8a); font-weight: 600; }
.lpc-result-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 24px; color: #fff; background: #dc2626; }

/* Sticky footer: total + primary action, trust row on the Pay step */
.lpc-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 24px; padding: 16px 32px; border-top: 1px solid var(--lpc-line); background: var(--pw-card-bg, #fff); }
.lpc-total { display: flex; align-items: baseline; gap: 8px; color: var(--lpc-muted); font-size: 14px; }
.lpc-total strong { font-size: 1.35rem; font-weight: 800; color: var(--lpc-ink); }
.lpc-primary { min-width: 220px; min-height: 48px; }
.lpc-primary[hidden] { display: none; }
.lpc[data-step="success"] .lpc-total, .lpc[data-step="failed"] .lpc-total { visibility: hidden; }
.lpc-trust { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin: 0; font-size: 12px; color: var(--lpc-muted); }
.lpc-trust[hidden] { display: none; }
.lpc-trust a { color: var(--pw-link, #1e3a8a); font-weight: 600; }

/* Phone: full-screen bottom sheet, summary condensed above the form */
@media (max-width: 720px) {
    .lpc { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
    .lpc[open] { animation: lpc-sheet .28s ease-out both; }
    @keyframes lpc-sheet { from { transform: translateY(100%); } to { transform: none; } }
    .lpc-header { padding: 16px 16px 12px 20px; gap: 8px 12px; }
    .lpc-header h2 { font-size: 1.1rem; flex: 1 1 auto; }
    .lpc-steps { order: 3; flex-basis: 100%; margin: 0; }
    .lpc-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .lpc-summary { order: -1; padding: 12px 20px; overflow: visible; }
    .lpc-summary h3 { margin: 0; font-size: .95rem; }
    .lpc-summary ul, .lpc-summary dl > div:not(.is-total) { display: none; }
    .lpc-summary dl { padding-top: 4px; border: 0; }
    .lpc-summary .is-total { padding-top: 0; font-size: 13px; }
    .lpc-summary .is-total dd { font-size: 1rem; }
    .lpc-main { padding: 16px 20px 24px; }
    .lpc-grid { grid-template-columns: 1fr; }
    .lpc-field input, .lpc-field select, .lpc-prefix { font-size: 16px; }
    .lpc-otp-box { width: 44px; height: 52px; }
    .lpc-footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); gap: 8px 16px; }
    .lpc-primary { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .lpc[open] { animation: none; }
    .lpc-tick circle, .lpc-tick path { animation: none; stroke-dashoffset: 0; }
}

/* Round 2: the plan price is shown until the review step; there (before paying) the payment fee and the
   total are always listed, on phones too (phones otherwise show only the price line to save space). */
@media (max-width: 720px) {
    .lpc[data-step="review"] .lpc-summary dl > div { display: flex; }
}

/* Round 2: WhatsApp number = country code selector + number (default India +91). */
.lpc-phone { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 8px; }
.lpc-phone select { min-width: 0; }
@media (max-width: 420px) { .lpc-phone { grid-template-columns: minmax(0, 8.25rem) minmax(0, 1fr); } .lpc-phone select { padding-left: 10px; padding-right: 30px; background-position: right 10px center; } }
