/* Client-facing shell: no staff sidebar, centered content, calmer chrome.
   Layered on top of pathway.css. */

body.client-shell {
    display: block;
    background: var(--offwhite);
}

.client-shell .client-topbar {
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.client-shell .client-topbar .logo-mark { gap: 10px; }
.client-shell .client-topbar .logo-text { color: var(--color-primary); }
.client-shell .client-topbar .logo-sub { color: var(--text-muted); }

.client-shell .client-topbar-right {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.client-shell .client-topbar .user-avatar {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
}

.client-shell .client-shell-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.client-shell .client-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.client-shell .client-page-lede {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.55;
}

/* Step indicator */
.step-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 12.5px;
}
.step-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--grey-100);
    color: var(--text-muted);
    font-weight: 500;
}
.step-pill .step-num {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--grey-300);
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.step-pill.active { background: var(--color-accent-tint-12); color: var(--color-accent-strong); }
.step-pill.active .step-num { background: var(--color-accent); }
.step-pill.done { color: var(--green); background: rgba(16,185,129,0.10); }
.step-pill.done .step-num { background: var(--green); }
.step-rail .step-sep {
    flex: 0 0 24px;
    height: 1px;
    background: var(--grey-200);
}

/* Form scaffolding, slot lists, and form banners live in pathway.css so
   they're available on staff pages too. Only the slot composer
   (specific to the onboarding wizard) stays here. */

/* Availability slot composer */
.slot-composer {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 14px 16px;
    background: var(--grey-100);
    border-radius: 10px;
    margin-bottom: 14px;
}

.slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.slot-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    font-size: 13px;
}
.slot-row .slot-when {
    color: var(--color-primary);
    font-weight: 500;
}
.slot-row .slot-remove {
    margin-inline-start: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
}
.slot-row .slot-remove:hover { color: var(--rose); background: rgba(244,63,94,0.08); }

.slot-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    border: 1px dashed var(--grey-300);
    border-radius: 10px;
}

/* ── Language selector (self-referral, first choice) ─────────────────────── */
.language-selector {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--grey-200);
}
.language-selector__label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.language-selector__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.language-selector__item {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--grey-200);
    background: white;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.language-selector__item:hover {
    border-color: var(--color-accent);
    color: var(--color-accent-strong);
}
.language-selector__item.is-active {
    background: var(--color-accent-tint-12);
    border-color: var(--color-accent);
    color: var(--color-accent-strong);
    font-weight: 600;
}
/* The self-referral form renders the items as submit buttons (POST-based switch); match the anchor
   look — buttons don't inherit the page font by default. */
button.language-selector__item {
    font-family: inherit;
    cursor: pointer;
}
.language-selector__hint {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ── Lang-scoped font stacks for the non-Latin scripts ───────────────────── */
/* Body copy + form fields. The Latin brand fonts (DM Sans/Playfair) have no Cyrillic/Arabic/CJK
   glyphs, so swap the whole stack for the bundled Noto for those languages. */
body.lang-uk { font-family: 'Noto Sans', 'DM Sans', sans-serif; }
body.lang-ar, body.lang-ur { font-family: 'Noto Naskh Arabic', 'DM Sans', sans-serif; }
body.lang-zh { font-family: 'Noto Sans SC', 'DM Sans', sans-serif; }

/* Playfair headings have no non-Latin coverage either — override so the title/lede don't fall back. */
body.lang-uk .client-page-title { font-family: 'Noto Sans', serif; }
body.lang-ar .client-page-title, body.lang-ur .client-page-title { font-family: 'Noto Naskh Arabic', serif; }
body.lang-zh .client-page-title { font-family: 'Noto Sans SC', serif; }

/* ── Referral wizard ─────────────────────────────────────────────────────
   Numbered progress bar (one circle per step, joined by a line) + the stepped
   form body. JS (initReferralWizard) drives the is-current / is-complete state;
   the connector that leads into a reached step is filled to show progress. */
.wizard-progress {
    display: flex;
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}
.wizard-progress__step {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
/* Connector to the previous step, behind the markers. inset-inline keeps it mirrored under RTL. */
.wizard-progress__step::before {
    content: '';
    position: absolute;
    top: 18px;
    inset-inline-end: 50%;
    width: 100%;
    height: 2px;
    background: var(--grey-200);
    z-index: 0;
}
.wizard-progress__step:first-child::before { display: none; }
.wizard-progress__step.is-current::before,
.wizard-progress__step.is-complete::before { background: var(--color-accent); }

.wizard-progress__marker {
    position: relative;
    z-index: 1;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--grey-300);
    background: white;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.wizard-progress__marker[disabled] { cursor: default; }
.wizard-progress__step.is-complete .wizard-progress__marker {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}
.wizard-progress__step.is-current .wizard-progress__marker {
    border-color: var(--color-accent);
    /* Opaque (mixed with white, not transparent) so the connector line stays hidden behind it. */
    background: color-mix(in srgb, var(--color-accent) 14%, white);
    color: var(--color-accent-strong);
    box-shadow: 0 0 0 4px var(--color-accent-tint-15);
}
.wizard-progress__marker:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--color-accent-tint-20);
}
.wizard-progress__label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}
.wizard-progress__step.is-current .wizard-progress__label {
    color: var(--color-accent-strong);
    font-weight: 600;
}
.wizard-progress__step.is-complete .wizard-progress__label { color: var(--text-secondary); }

/* The step body reuses the .referral-section__title heading style for each step's title. */
.wizard-step[hidden] { display: none; }
.wizard-nav { margin-top: 24px; }
/* .btn sets display:inline-flex, which beats the UA [hidden]{display:none} rule, so the wizard's
   Back/Next/Submit toggling needs an explicit, more-specific hide. */
.wizard-nav .btn[hidden] { display: none; }

@media (max-width: 520px) {
    /* Drop the labels on narrow screens — the numbered circles + connectors carry the meaning. */
    .wizard-progress__label { display: none; }
}

/* ── RTL (Arabic, Urdu). dir="rtl" is set on <html>; the staff layout never sets it, so these
   only ever apply to the client shell. Surface is small — most fields are direction-neutral flex. */
[dir="rtl"] .language-selector__list { justify-content: flex-start; }
/* Keep the three-box date in logical DD MM YYYY reading order rather than mirroring the numbers. */
[dir="rtl"] .date-field__parts { direction: ltr; justify-content: flex-end; }
