/* ============================================================================================
   Mandatory minimum-profile onboarding.

   Scoped to the wizard and its shell. Uses the design-system tokens throughout rather than
   literal colours, so the wizard follows a palette change instead of drifting away from it.

   Mobile is the first-class case here, not an afterthought: a broker confirming their email on
   a phone is the single most likely way this screen is first seen, so every control is at least
   44px tall and the step rail collapses to a compact row rather than wrapping into a mess.
   ============================================================================================ */

/* ── Shell ───────────────────────────────────────────────────────────────────────────────── */

.acl-onboarding-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg, #f7f8fc);
}

.acl-onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background: var(--color-white, #fff);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.acl-onboarding-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--color-navy, #0b1739);
    font-size: 1.0625rem;
}
.acl-onboarding-brand .acl-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-size: 1rem;
}
.acl-onboarding-brand .sb-brand-accent { color: var(--color-primary, #2563eb); }

.acl-onboarding-header-actions { display: flex; align-items: center; gap: 0.25rem; }

.acl-onboarding-headerlink {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-secondary, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}
.acl-onboarding-headerlink:hover {
    background: var(--color-bg-subtle, #eef0f7);
    color: var(--color-text-primary, #16213a);
}

.acl-onboarding-main { flex: 1 1 auto; padding: 2rem 1rem 3rem; }

.acl-onboarding-footer {
    padding: 1rem 1.25rem 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted, #94a3b8);
}
.acl-onboarding-footer a { color: var(--color-text-secondary, #64748b); text-decoration: none; }
.acl-onboarding-footer a:hover { text-decoration: underline; }
.acl-onboarding-footer-sep { margin: 0 0.5rem; }

/* ── Page ────────────────────────────────────────────────────────────────────────────────── */

.acl-onb { max-width: 720px; margin: 0 auto; }

.acl-onb-intro { text-align: center; margin-bottom: 1.75rem; }

.acl-onb-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-navy, #0b1739);
    margin: 0 0 0.5rem;
}
.acl-onb-sub {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text-secondary, #64748b);
    max-width: 34rem;
    margin: 0 auto;
}

/* ── Progress ────────────────────────────────────────────────────────────────────────────── */

.acl-onb-progress { margin-bottom: 1.25rem; }

.acl-onb-progress-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--color-border, #e2e8f0);
    overflow: hidden;
    margin-bottom: 1rem;
}
.acl-onb-progress-fill {
    height: 100%;
    background: var(--color-primary, #2563eb);
    border-radius: 999px;
    transition: width 240ms ease;
}

.acl-onb-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.acl-onb-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 0;
    min-width: 0;
}

.acl-onb-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--color-white, #fff);
    color: var(--color-text-muted, #94a3b8);
    border: 2px solid var(--color-border, #e2e8f0);
    transition: all 160ms ease;
}
.acl-onb-step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted, #94a3b8);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.acl-onb-step-current .acl-onb-step-dot {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: #fff;
    box-shadow: 0 0 0 4px var(--color-primary-light, #eff6ff);
}
.acl-onb-step-current .acl-onb-step-label {
    color: var(--color-primary-text, #1e40af);
    font-weight: 600;
}

.acl-onb-step-done .acl-onb-step-dot {
    background: var(--color-success, #059669);
    border-color: var(--color-success, #059669);
    color: #fff;
}
.acl-onb-step-done .acl-onb-step-label { color: var(--color-text-secondary, #64748b); }

.acl-onb-progress-text {
    display: none;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-secondary, #64748b);
    margin: 0.75rem 0 0;
}

/* ── Card ────────────────────────────────────────────────────────────────────────────────── */

.acl-onb-card {
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(11, 23, 57, .06), 0 8px 24px rgba(11, 23, 57, .04);
}

.acl-onb-steptitle {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--color-navy, #0b1739);
    margin: 0 0 0.25rem;
}
.acl-onb-stephint {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--color-text-secondary, #64748b);
    margin: 0 0 1.25rem;
}

/* ── Fields ──────────────────────────────────────────────────────────────────────────────── */

.acl-onb-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-primary, #16213a);
    margin-bottom: 0.35rem;
}

/* Required is stated in words, not a bare asterisk: an asterisk needs a legend to decode and
   screen readers announce it as "star". Optional fields simply carry no marker. */
.acl-req {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 5px;
    background: var(--color-primary-light, #eff6ff);
    color: var(--color-primary-text, #1e40af);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: .01em;
    vertical-align: 1px;
}

.acl-onb .form-control,
.acl-onb .form-select {
    min-height: 46px;
    border-radius: 10px;
    border-color: var(--color-border, #e2e8f0);
    font-size: 0.9375rem;
}
.acl-onb .form-control:focus,
.acl-onb .form-select:focus {
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px var(--color-primary-light, #eff6ff);
}
.acl-onb .form-control.is-invalid,
.acl-onb .form-select.is-invalid {
    border-color: var(--color-danger, #dc2626);
    background-image: none;           /* Bootstrap's icon collides with the select chevron */
}

.acl-onb-help {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 0.35rem;
}

.acl-field-error {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--color-danger-text, #991b1b);
}
.acl-field-error i { font-size: 0.875rem; line-height: 1.3; }

/* ── Radio choices (licence type) ────────────────────────────────────────────────────────── */

.acl-onb-choices { display: grid; gap: 0.625rem; margin-top: 0.25rem; }

.acl-onb-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 11px;
    cursor: pointer;
    background: var(--color-white, #fff);
    transition: all 140ms ease;
}
.acl-onb-choice:hover { border-color: var(--color-primary, #2563eb); background: var(--color-primary-light, #eff6ff); }
.acl-onb-choice.is-selected {
    border-color: var(--color-primary, #2563eb);
    background: var(--color-primary-light, #eff6ff);
    box-shadow: 0 0 0 2px var(--color-primary-tint, #dbeafe);
}
.acl-onb-choice input { margin-top: 0.2rem; flex: none; width: 18px; height: 18px; accent-color: var(--color-primary, #2563eb); }
.acl-onb-choice-body { display: flex; flex-direction: column; gap: 0.1rem; }
.acl-onb-choice-body strong { font-size: 0.9375rem; font-weight: 600; color: var(--color-text-primary, #16213a); }
.acl-onb-choice-body small  { font-size: 0.8125rem; color: var(--color-text-secondary, #64748b); }

/* ── Specialty chips ─────────────────────────────────────────────────────────────────────── */

.acl-onb-specialties { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.acl-onb-chip {
    min-height: 44px;
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 999px;
    background: var(--color-white, #fff);
    color: var(--color-text-primary, #16213a);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 140ms ease;
}
.acl-onb-chip:hover { border-color: var(--color-primary, #2563eb); color: var(--color-primary-text, #1e40af); }
.acl-onb-chip.is-selected {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: #fff;
}

/* ── Review ──────────────────────────────────────────────────────────────────────────────── */

.acl-onb-review { margin: 0 0 1.25rem; }

.acl-review-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border-light, #eef1f5);
}
.acl-review-row:last-child { border-bottom: 0; }

.acl-review-label {
    flex: 0 0 10rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    margin: 0;
}
.acl-review-value {
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--color-text-primary, #16213a);
    word-break: break-word;
}
.acl-review-empty { color: var(--color-text-muted, #94a3b8); font-style: italic; }

.acl-review-edit {
    flex: none;
    border: 0;
    background: transparent;
    padding: 0.2rem 0.35rem;
    color: var(--color-primary, #2563eb);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
}
.acl-review-edit:hover { background: var(--color-primary-light, #eff6ff); text-decoration: underline; }

.acl-onb-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.875rem 1rem;
    border-radius: 11px;
    background: var(--color-primary-light, #eff6ff);
    color: var(--color-primary-text, #1e40af);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 1.125rem;
}

/* ── Certification ───────────────────────────────────────────────────────────────────────── */

.acl-onb-certify {
    padding: 1rem;
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 11px;
    background: var(--color-bg, #f7f8fc);
}
.acl-onb-certify.is-invalid { border-color: var(--color-danger, #dc2626); background: var(--color-danger-light, #fee2e2); }
.acl-onb-certify label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text-primary, #16213a);
}
.acl-onb-certify input {
    margin-top: 0.2rem;
    flex: none;
    width: 19px;
    height: 19px;
    accent-color: var(--color-primary, #2563eb);
}

/* ── Actions ─────────────────────────────────────────────────────────────────────────────── */

.acl-onb-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border-light, #eef1f5);
}
.acl-onb-actions .btn { min-height: 46px; border-radius: 10px; font-weight: 600; }

.acl-onb-footnote {
    margin: 1.25rem auto 0;
    max-width: 34rem;
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--color-text-muted, #94a3b8);
}

/* Completion percentage on the dashboard's optional-profile nudge. */
.sb-setup-note-pct { display: block; opacity: .75; font-size: .75rem; font-weight: 500; }

/* ── Mobile ──────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 575.98px) {
    .acl-onboarding-main { padding: 1.25rem 0.875rem 2rem; }

    .acl-onb-title { font-size: 1.25rem; }
    .acl-onb-sub   { font-size: 0.875rem; }

    .acl-onb-card { padding: 1.125rem; border-radius: 14px; }

    /* The labels stack badly at this width and the dots alone carry the same information,
       so the rail becomes dots-plus-counter rather than five truncated words. */
    .acl-onb-step-label   { display: none; }
    .acl-onb-progress-text { display: block; }
    .acl-onb-steps        { justify-content: center; gap: 0.75rem; }
    .acl-onb-step         { flex: 0 0 auto; }

    .acl-review-row   { flex-direction: column; gap: 0.15rem; align-items: stretch; }
    .acl-review-label { flex: none; }

    .acl-onb-actions .btn { flex: 1 1 0; }
}
