/* assets/css/portal.css
 * Phases 63–79 — Customer Portal shell + page primitives.
 * Self-contained prt-* namespace; reuses theme tokens only. The shell
 * has no sidebar: a sticky top bar, a full-width content column and a
 * fixed bottom navigation. Login/register reuse the shared amb-auth
 * shell (imported below) and the shared amb-* primitives.
 */

@import url('auth.css');
@import url('map.css');

/* ---------- design tokens (local to the customer portal) ---------- */

.amb-app--customer {
    --prt-gap-xs: 6px;
    --prt-gap-sm: 10px;
    --prt-gap: 16px;
    --prt-gap-lg: 24px;
    --prt-gap-xl: 32px;
    --prt-pad: 20px;
    --prt-radius: 14px;
    --prt-radius-sm: 10px;
    --prt-nav-h: 68px;
    --prt-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
    --prt-brand: var(--brand, var(--color-primary-500, #2A5670));
    --prt-border: var(--amb-border, #e2e8f0);
    --prt-muted: var(--amb-muted, #64748b);
    --prt-surface: var(--amb-surface, #fff);
    --prt-surface-muted: var(--amb-surface-muted, #f1f5f9);
}

/* ---------- shell ---------- */

.amb-app--customer {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--color-bg-app, #f8fafc);
    padding-bottom: calc(var(--prt-nav-h) + env(safe-area-inset-bottom, 0px));
}

.prt-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--prt-gap);
    min-height: 60px;
    padding: 10px max(var(--prt-gap), calc((100% - 720px) / 2));
    background: var(--prt-surface);
    border-bottom: 1px solid var(--prt-border);
}

.prt-topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.prt-topbar__brand i { color: var(--color-link); font-size: 1.2rem; }

.prt-topbar__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prt-topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--prt-gap-sm);
}

.prt-lang__select {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface);
    font: inherit;
}

.prt-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface);
    color: inherit;
    cursor: pointer;
}

.prt-iconbtn:hover { background: var(--prt-surface-muted); }

.prt-menu {
    position: fixed;
    /* Aligned with the topbar content edge (same inset as .prt-topbar padding);
       portal-shell.js refines top/right from the menu button's real position. */
    top: 68px;
    right: max(var(--prt-gap), calc((100% - 720px) / 2));
    z-index: 50;
    min-width: 220px;
    max-width: calc(100vw - (2 * var(--prt-gap)));
    display: flex;
    flex-direction: column;
    background: var(--prt-surface);
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.prt-menu[hidden] { display: none; }

.prt-menu__identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--prt-border);
}

.prt-menu__name { font-weight: 700; }

.prt-menu__meta {
    font-size: 0.85rem;
    color: var(--prt-muted);
}

.prt-menu__item {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    background: none;
    text-align: start;
    font: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.prt-menu__item:hover { background: var(--prt-surface-muted); }

.prt-menu__item--danger { color: var(--amb-danger-text); font-weight: 600; }

/* active-request persistent banner */

.prt-banner {
    position: fixed;
    left: var(--prt-gap);
    right: var(--prt-gap);
    bottom: calc(var(--prt-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 45;
    max-width: 688px;
    margin: 0 auto;
}

/* Keep the last content (e.g. the Cancel button) clear of the fixed banner. */
body.prt-has-banner .prt-content {
    padding-bottom: calc(var(--prt-gap-xl) + 84px);
}

.prt-banner__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--prt-radius);
    background: var(--prt-brand);
    color: var(--brand-contrast);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.prt-banner__pulse { animation: prt-pulse 1.6s ease-in-out infinite; }

@keyframes prt-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* bottom navigation */

.prt-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 44;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--prt-surface);
    border-top: 1px solid var(--prt-border);
    padding: 0 max(0px, calc((100% - 720px) / 2)) env(safe-area-inset-bottom, 0px);
}

.prt-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: var(--prt-nav-h);
    padding: 10px 6px;
    font-size: 0.72rem;
    text-align: center;
    text-decoration: none;
    color: var(--prt-muted);
}

.prt-bottom-nav a i { font-size: 1.2rem; }

.prt-bottom-nav a.is-active {
    color: var(--color-link);
    font-weight: 700;
}

/* ---------- content column ---------- */

.prt-content {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: var(--prt-gap-lg) var(--prt-gap) var(--prt-gap-xl);
    display: flex;
    flex-direction: column;
    gap: var(--prt-gap);
}

.prt-h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 800;
}

.prt-h2 { margin: 0 0 var(--prt-gap-sm); font-size: 1.1rem; }

/* ---------- page primitives ---------- */

.prt-card {
    background: var(--prt-surface);
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius);
    box-shadow: var(--prt-shadow);
    padding: var(--prt-pad);
    margin: 0;
}

.prt-card[hidden] { display: none; }

.prt-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 var(--prt-gap);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--prt-border);
    font-size: 1rem;
    font-weight: 700;
}

.prt-card__title i { color: var(--color-link); }

.prt-card p { margin: 0 0 var(--prt-gap-sm); }
.prt-card p:last-child { margin-bottom: 0; }

.prt-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--prt-gap);
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px dashed var(--prt-border);
    font-size: 0.93rem;
}

.prt-kv:last-child { border-bottom: 0; padding-bottom: 0; }
.prt-kv:first-of-type { padding-top: 0; }

.prt-kv dt, .prt-kv .prt-kv__k { color: var(--prt-muted); flex: 0 0 auto; }

.prt-kv dd, .prt-kv .prt-kv__v {
    margin: 0;
    text-align: end;
    overflow-wrap: anywhere;
    font-weight: 600;
}

dl.prt-kv { display: block; padding: 0; border: 0; }

.prt-section { margin-top: var(--prt-gap-lg); }

hr.prt-section {
    border: 0;
    border-top: 1px solid var(--prt-border);
    margin: var(--prt-gap-lg) 0;
}

.prt-actions {
    display: grid;
    gap: var(--prt-gap-sm);
    margin-top: var(--prt-gap-lg);
}

.prt-actions--row {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
}

.prt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 13px 20px;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface);
    font: inherit;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.prt-btn:hover { background: var(--prt-surface-muted); }

.prt-btn--primary {
    background: var(--prt-brand);
    border-color: var(--prt-brand);
    color: var(--brand-contrast);
}

.prt-btn--primary:hover { background: var(--prt-brand); filter: brightness(1.08); }

.prt-btn--danger {
    background: var(--amb-danger, #b91c1c);
    border-color: var(--amb-danger, #b91c1c);
    color: #fff;
}

.prt-btn--sm {
    width: auto;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.85rem;
}

.prt-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.prt-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--prt-surface-muted);
    color: var(--prt-muted);
}

.prt-status--requested,
.prt-status--pending_review { background: var(--color-warning-100); color: var(--color-warning-text); }
.prt-status--assigned,
.prt-status--active { background: var(--color-info-100); color: var(--color-info-text); }
.prt-status--ongoing { background: var(--color-success-100); color: var(--color-success-text); }

/* Final states are solid so they stand out in lists and on the details page. */
.prt-status--completed {
    background: var(--color-success-500, #3E8E7E);
    color: #fff;
}
.prt-status--cancelled,
.prt-status--rejected,
.prt-status--expired {
    background: var(--color-error-500, #B5483F);
    color: #fff;
}

.prt-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--prt-gap-sm);
}

.prt-tile {
    background: var(--prt-surface);
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    padding: var(--prt-gap);
}

.prt-tile__num { font-size: 1.5rem; font-weight: 800; }

.prt-tile__label {
    font-size: 0.8rem;
    color: var(--prt-muted);
    margin-top: 4px;
}

.prt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--prt-gap);
    padding: 16px 0;
    border-bottom: 1px solid var(--prt-border);
    color: inherit;
    text-decoration: none;
}

.prt-row:first-child { padding-top: 0; }
.prt-row:last-child { border-bottom: 0; padding-bottom: 0; }

.prt-row__main { min-width: 0; flex: 1; }

.prt-row__title { font-weight: 700; overflow-wrap: anywhere; line-height: 1.4; }

.prt-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--prt-muted);
}

.prt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: var(--prt-surface-muted);
    color: var(--prt-muted);
}

.prt-empty {
    padding: var(--prt-gap-xl) var(--prt-gap);
    text-align: center;
    color: var(--prt-muted);
}

.prt-error {
    padding: 14px 16px;
    border-radius: var(--prt-radius-sm);
    background: var(--color-error-100);
    color: var(--color-error-text);
    font-size: 0.9rem;
    display: none;
}

.prt-error.is-visible { display: block; }

.prt-notice {
    padding: 14px 16px;
    border-radius: var(--prt-radius-sm);
    background: var(--color-warning-100);
    color: var(--color-warning-text);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ---------- form helpers ---------- */

.prt-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--prt-gap);
}

.prt-field:last-child { margin-bottom: 0; }

.prt-field__label { margin: 0; font-weight: 600; font-size: 0.9rem; }

.prt-field__error {
    font-size: 0.82rem;
    color: var(--amb-danger-text);
    display: none;
}

.prt-field__error.is-visible { display: block; }

.prt-input, .prt-select, .prt-textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    font: inherit;
    background: var(--prt-surface);
    color: inherit;
}

.prt-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.prt-input:focus, .prt-select:focus, .prt-textarea:focus {
    outline: 2px solid var(--prt-brand);
    outline-offset: 1px;
    border-color: var(--prt-brand);
}

.prt-input.is-invalid { border-color: var(--amb-danger-text); }

.prt-input:disabled { background: var(--prt-surface-muted); color: var(--prt-muted); }

.prt-card .amb-small { display: block; line-height: 1.5; }

.prt-mobile {
    display: flex;
    align-items: stretch;
    gap: var(--prt-gap-sm);
}

.prt-mobile__prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface-muted);
    font-weight: 700;
}

.prt-mobile .prt-input { flex: 1; }

.prt-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
}

/* ---------- OTP six-box ---------- */

.prt-otp { display: flex; flex-direction: column; gap: var(--prt-gap); }

.prt-otp__boxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--prt-gap-sm);
}

.prt-otp__boxes input {
    width: 100%;
    height: 56px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface);
    color: inherit;
}

.prt-otp__boxes input:focus {
    outline: 2px solid var(--prt-brand);
    outline-offset: 1px;
}

.prt-otp__resend { display: flex; align-items: center; gap: var(--prt-gap-sm); flex-wrap: wrap; }

.prt-otp__resend button {
    border: 0;
    background: none;
    color: var(--color-link);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.prt-otp__countdown { color: var(--prt-muted); font-size: 0.85rem; }

/* ---------- tabs ---------- */

.prt-tabs {
    display: flex;
    gap: var(--prt-gap-sm);
    overflow-x: auto;
    padding: 2px 2px 6px;
    margin: 0;
}

.prt-tabs::-webkit-scrollbar { display: none; }

.prt-tab {
    flex: 0 0 auto;
    padding: 10px 18px;
    border: 1px solid var(--prt-border);
    border-radius: 999px;
    background: var(--prt-surface);
    font: inherit;
    font-weight: 600;
    color: var(--prt-muted);
    cursor: pointer;
}

.prt-tab.is-active {
    background: var(--prt-brand);
    border-color: var(--prt-brand);
    color: var(--brand-contrast);
}

.prt-tab__count { opacity: 0.75; margin-left: 6px; }

/* ---------- chips ---------- */

.prt-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--prt-border);
    border-radius: 999px;
    background: var(--prt-surface);
    font: inherit;
    font-size: 0.88rem;
    color: inherit;
    cursor: pointer;
}

.prt-chip:hover { background: var(--prt-surface-muted); }

.prt-chip.is-active {
    border-color: var(--prt-brand);
    background: var(--prt-brand);
    color: var(--brand-contrast);
}

.prt-chip-row { display: flex; flex-wrap: wrap; gap: var(--prt-gap-sm); }

.prt-chip--distance {
    background: var(--prt-surface-muted);
    color: var(--prt-muted);
    cursor: default;
}

/* ---------- wizard progress (labelled steps) ---------- */

.prt-wizard__progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--prt-gap-sm);
    margin: 0;
}

.prt-wizard__seg {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--prt-muted);
}

.prt-wizard__seg::before {
    content: '';
    display: block;
    height: 6px;
    border-radius: 999px;
    background: var(--prt-border);
}

.prt-wizard__seg.is-active { color: var(--color-text-primary, inherit); }
.prt-wizard__seg.is-active::before { background: var(--prt-brand); }

.prt-wizard__seg-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- status stepper ---------- */

.prt-stepper { display: flex; flex-direction: column; gap: 0; }

.prt-stepper__item {
    display: flex;
    gap: 16px;
    position: relative;
    padding: 0 0 24px;
}

.prt-stepper__item:last-child { padding-bottom: 2px; }

.prt-stepper__item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 6px;
    width: 2px;
    background: var(--prt-border);
}

.prt-stepper__item:last-child::before { display: none; }

.prt-stepper__dot {
    flex: 0 0 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--prt-border);
    background: var(--prt-surface);
    color: var(--prt-muted);
    font-size: 0.8rem;
    z-index: 1;
}

.prt-stepper__item.is-done .prt-stepper__dot {
    border-color: var(--color-success-text);
    background: var(--color-success-100);
    color: var(--color-success-text);
}

.prt-stepper__item.is-current .prt-stepper__dot {
    border-color: var(--prt-brand);
    background: var(--prt-brand);
    color: var(--brand-contrast);
}

.prt-stepper__label { font-weight: 600; padding-top: 5px; }

/* ---------- map ---------- */

.prt-map {
    height: 260px;
    border-radius: var(--prt-radius-sm);
    border: 1px solid var(--prt-border);
    overflow: hidden;
}

/* ---------- handover card ---------- */

.prt-handover {
    background: var(--prt-surface);
    border: 1px solid var(--prt-brand);
    border-radius: var(--prt-radius);
    box-shadow: var(--prt-shadow);
    padding: var(--prt-pad);
    margin: 0;
}

.prt-handover[hidden] { display: none; }

.prt-handover__code {
    display: flex;
    gap: var(--prt-gap-sm);
    justify-content: center;
    margin: var(--prt-gap) 0;
}

.prt-handover__digit {
    width: 48px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 800;
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface-muted);
    border: 1px dashed var(--prt-border);
}

.prt-handover__expiry { font-size: 0.85rem; color: var(--prt-muted); text-align: center; margin: 0; }

/* ---------- driver card ---------- */

.prt-driver {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--prt-gap);
}

.prt-driver .prt-btn { width: auto; flex: 0 0 auto; }

.prt-driver__meta { min-width: 0; }

.prt-driver__name { font-weight: 700; margin-bottom: 4px; }

.prt-driver__sub { font-size: 0.84rem; color: var(--prt-muted); }

/* ---------- request wizard: stops with their own map ---------- */

.prt-stop {
    margin-bottom: var(--prt-gap);
    padding: var(--prt-gap);
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface-muted);
}

.prt-stop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--prt-gap-sm);
    margin-bottom: var(--prt-gap-sm);
}

.prt-stop .amb-map-picker { margin: 0; }

.prt-card .amb-map-picker { margin: 0 0 var(--prt-gap-sm); }

.prt-wizard-note { margin: 0; }

/* Operator logo in the top bar (falls back to the ambulance icon) */
.prt-topbar__logo { width: 34px; height: 34px; flex: none; border-radius: var(--prt-radius-sm); object-fit: cover; }

/* ---------- larger screens ---------- */

@media (min-width: 700px) {
    .prt-content { padding-top: var(--prt-gap-xl); gap: var(--prt-gap-lg); }
    .prt-card, .prt-handover { padding: 28px; }
}

@media (max-width: 380px) {
    .prt-content { padding-left: 12px; padding-right: 12px; }
    .prt-card { padding: 16px; }
    .prt-handover__digit { width: 40px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .prt-banner__pulse { animation: none; }
    .prt-btn { transition: none; }
}

/* ---------- login & register (shared amb-auth shell, portal spacing) ---------- */

body[data-page="portal-login"] .amb-auth__main,
body[data-page="portal-register"] .amb-auth__main {
    padding: var(--space-24, 24px) var(--space-16, 16px) var(--space-48, 48px);
}

body[data-page="portal-login"] .amb-auth__card,
body[data-page="portal-register"] .amb-auth__card {
    width: 100%;
    max-width: 440px;
    padding: 32px 28px;
    border-radius: 16px;
}

body[data-page="portal-login"] .amb-auth__title,
body[data-page="portal-register"] .amb-auth__title { margin: 0 0 8px; }

body[data-page="portal-login"] .amb-auth__subtitle,
body[data-page="portal-register"] .amb-auth__subtitle { margin: 0 0 24px; line-height: 1.5; }

body[data-page="portal-login"] .prt-field,
body[data-page="portal-register"] .prt-field { margin-bottom: 20px; }

body[data-page="portal-login"] .amb-auth__submit,
body[data-page="portal-register"] .amb-auth__submit { margin-top: 8px; min-height: 50px; }

body[data-page="portal-login"] .amb-auth__back,
body[data-page="portal-register"] .amb-auth__back {
    display: block;
    margin-top: 20px;
    text-align: center;
}

body[data-page="portal-login"] .amb-auth__back + br,
body[data-page="portal-register"] .amb-auth__back + br { display: none; }

body[data-page="portal-login"] .amb-auth__back + .amb-auth__back,
body[data-page="portal-register"] .amb-auth__back + .amb-auth__back { margin-top: 12px; }

@media (max-width: 380px) {
    body[data-page="portal-login"] .amb-auth__card,
    body[data-page="portal-register"] .amb-auth__card { padding: 24px 18px; }
}

/* ---------- quick request + simple home (calm, large, plain) ---------- */

.amb-app--customer [hidden] { display: none !important; }

.prt-loginlink {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius-sm);
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

.prt-loginlink:hover { background: var(--prt-surface-muted); }

.prt-help__title {
    margin: 0 0 var(--prt-gap-sm);
    font-size: 1.6rem;
    line-height: 1.3;
    font-weight: 800;
}

.prt-help__text {
    margin: 0 0 var(--prt-gap-lg);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--prt-muted);
}

.prt-card .prt-help__text:last-child { margin-bottom: 0; }

.prt-help__note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: var(--prt-gap-lg) 0 0;
    padding: 14px 16px;
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.prt-card .prt-help__note { margin: var(--prt-gap-lg) 0 0; }

.prt-choices {
    display: grid;
    gap: var(--prt-gap);
}

.prt-choice {
    display: flex;
    align-items: center;
    gap: var(--prt-gap);
    width: 100%;
    min-height: 88px;
    padding: 18px 20px;
    border: 2px solid var(--prt-border);
    border-radius: var(--prt-radius);
    background: var(--prt-surface);
    font: inherit;
    color: inherit;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.prt-choice:hover, .prt-choice:focus-visible { border-color: var(--prt-brand); background: var(--prt-surface-muted); }

.prt-choice--call {
    background: var(--prt-brand);
    border-color: var(--prt-brand);
    color: var(--brand-contrast);
}

.prt-choice--call:hover, .prt-choice--call:focus-visible { background: var(--prt-brand); filter: brightness(1.08); }

.prt-choice__icon {
    flex: 0 0 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--prt-surface-muted);
    color: var(--color-link);
    font-size: 1.35rem;
}

.prt-choice--call .prt-choice__icon { background: rgba(255, 255, 255, 0.18); color: inherit; }

.prt-choice__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.prt-choice__body strong { font-size: 1.15rem; line-height: 1.3; }
.prt-choice__body span { font-size: 0.95rem; line-height: 1.4; opacity: 0.85; overflow-wrap: anywhere; }

.prt-callback {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 var(--prt-gap);
    padding: 14px 16px;
    border-radius: var(--prt-radius-sm);
    background: var(--prt-surface-muted);
    font-weight: 600;
}

.prt-card .prt-callback { margin-bottom: var(--prt-gap); }

.prt-next {
    margin: 0;
    padding: 0 0 0 22px;
    display: grid;
    gap: var(--prt-gap-sm);
    line-height: 1.5;
    font-size: 1rem;
}

.prt-legal {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--prt-muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.prt-legal a { color: inherit; text-decoration: underline; }

.prt-legal--left { justify-content: flex-start; text-align: start; margin-top: var(--prt-gap); }

.prt-done { text-align: center; }

.prt-done__icon { font-size: 3rem; color: var(--color-success-text); margin-bottom: var(--prt-gap-sm); }

.prt-done__ref {
    margin: 0 0 var(--prt-gap);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.prt-done .prt-actions { margin-top: var(--prt-gap-lg); }

[data-screen="form"] .prt-field > .prt-field__label { font-size: 1rem; }

@media (min-width: 700px) {
    .prt-help__title { font-size: 1.9rem; }
}

/* highlighted "call us to book" card */

.prt-callcard {
    display: flex;
    align-items: center;
    gap: var(--prt-gap);
    margin: 0 0 var(--prt-gap-lg);
    padding: 18px 20px;
    border-radius: var(--prt-radius);
    background: var(--prt-brand);
    color: var(--brand-contrast);
    text-decoration: none;
    box-shadow: var(--prt-shadow);
}

.prt-callcard:hover, .prt-callcard:focus-visible { filter: brightness(1.08); }

.prt-callcard__icon {
    flex: 0 0 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.35rem;
}

.prt-callcard__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.4; }
.prt-callcard__body strong { font-size: 1.1rem; }
.prt-callcard__body span { font-size: 0.92rem; opacity: 0.9; }
.prt-callcard__body .prt-callcard__number { font-size: 1.25rem; font-weight: 800; opacity: 1; letter-spacing: 0.02em; }

/* Hover / focus on brand-coloured links and buttons: keep the text colour
   readable (no global link-hover colour) and darken with an overlay instead
   of a brightness filter, which washed the brand colour out. */

.prt-callcard:hover,
.prt-callcard:focus-visible,
.prt-choice--call:hover,
.prt-choice--call:focus-visible,
.prt-btn--primary:hover,
.prt-btn--primary:focus-visible {
    filter: none;
    color: var(--brand-contrast);
    text-decoration: none;
    background-color: var(--prt-brand);
    background-image: linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.14));
}

.prt-callcard:hover,
.prt-callcard:focus-visible,
.prt-choice--call:hover,
.prt-choice--call:focus-visible {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}

.prt-callcard:hover *,
.prt-callcard:focus-visible *,
.prt-choice--call:hover *,
.prt-choice--call:focus-visible * {
    color: inherit;
    text-decoration: none;
}

.prt-callcard:focus-visible,
.prt-choice--call:focus-visible {
    outline: 3px solid var(--prt-brand);
    outline-offset: 3px;
}

/* ---------- code screen + inline error spacing ---------- */

#prtQError,
#prtQOtpError {
    margin: 0 0 var(--prt-gap-lg);
    padding: 14px 18px;
    border: 1px solid var(--color-error-text, #b91c1c);
    line-height: 1.5;
}

[data-screen="otp"] .prt-help__text { margin-bottom: var(--prt-gap-lg); }

#prtQOtp {
    gap: var(--prt-gap-lg);
    padding: var(--prt-gap-lg) var(--prt-gap);
    border: 1px solid var(--prt-border);
    border-radius: var(--prt-radius);
    background: var(--prt-surface-muted);
}

#prtQOtp .prt-otp__boxes { gap: 12px; }

#prtQOtp .prt-otp__boxes input {
    height: 60px;
    padding: 0;
    font-size: 1.4rem;
}

#prtQOtp .prt-otp__resend {
    justify-content: center;
    min-height: 24px;
}

[data-screen="otp"] .prt-actions { margin-top: var(--prt-gap-xl); }

@media (max-width: 380px) {
    #prtQOtp { padding: var(--prt-gap) 12px; }
    #prtQOtp .prt-otp__boxes { gap: 8px; }
    #prtQOtp .prt-otp__boxes input { height: 52px; }
}
