/* ==========================================================================
   OnboardingPopup — chrome and layout per the Setup Profile design.
   --------------------------------------------------------------------------
   Loaded globally (not via .razor.css) because DxPopup teleports its body
   DOM outside the component's scope, so `::deep`-prefixed scoped CSS never
   matches. Target the `.onboarding-popup` class applied to the DxPopup and
   style its body / footer descendants directly.
   ========================================================================== */

/* ---- Outer chrome — extend icu-popup with onboarding-specific size + radius
   Make the window a column flex container so body grows and footer stays
   pinned to the bottom inside the 660px frame. */
.onboarding-popup .dxbl-popup-window {
    border-radius: 16px !important;
    box-shadow: 0 32px 80px rgba(20, 15, 30, 0.35),
                0 4px 12px rgba(20, 15, 30, 0.08) !important;
    width: 960px;
    height: 660px;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - 64px);
    display: flex !important;
    flex-direction: column !important;
}

/* Default DxPopup header is collapsed — our custom .op-head lives inside
   the body so we can position the brand mark, title, sub, and close in one
   row without fighting the icu-popup header. */
.onboarding-popup .dxbl-popup-header {
    display: none !important;
}

/* Body fills the modal so the rail can stretch full height and the footer
   stays pinned. In DevExpress v25 the window's flex child / scroll container
   is `.dxbl-modal-body`, not `.dxbl-popup-body` — targeting only the latter
   left the real body at min-height:auto, so its tall form content forced the
   window past its 660px cap and pushed the footer below the viewport. Apply
   the chain (with `min-height: 0` so it can shrink — the WebKit trick) to
   every layer between the window and the inner scroll panes. */
.onboarding-popup .dxbl-modal-body,
.onboarding-popup .dxbl-popup-body,
.onboarding-popup .dxbl-popup-content {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Footer is intrinsically sized and pinned to the bottom of the window. */
.onboarding-popup .dxbl-popup-footer {
    flex: 0 0 auto;
}

/* Footer overrides — the design lays out progress | skip | buttons across
   the full width, so we replace the default flex-end alignment. */
.onboarding-popup .dxbl-popup-footer {
    padding: 0 !important;
    border-top: 1px solid var(--icu-line) !important;
    background: #FAFAFC !important;
    display: block !important;
}

.onboarding-popup .dxbl-popup-footer .dxbl-btn {
    min-width: 0;
}

/* ============================================================
   Custom modal header
   ============================================================ */
.onboarding-popup .op-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--icu-line);
    background: linear-gradient(180deg, #FDFCFE 0%, #fff 100%);
    flex-shrink: 0;
}

.onboarding-popup .op-head-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--icu-brand);
    color: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.onboarding-popup .op-head-mark svg {
    width: 18px;
    height: 18px;
}

.onboarding-popup .op-head-text {
    min-width: 0;
}

.onboarding-popup .op-head-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--icu-ink);
}

.onboarding-popup .op-head-sub {
    font-size: 11.5px;
    color: var(--icu-ink-3);
    margin-top: 2px;
    font-family: var(--icu-font-mono);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.onboarding-popup .op-head-sub-sep {
    color: var(--icu-ink-4);
}

.onboarding-popup .op-head-sub-name {
    color: var(--icu-brand);
    font-weight: 600;
}

.onboarding-popup .op-head-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--icu-ink-3);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color 0.12s ease, background-color 0.12s ease;
    flex-shrink: 0;
}

.onboarding-popup .op-head-close svg {
    width: 16px;
    height: 16px;
}

.onboarding-popup .op-head-close:hover {
    background: var(--icu-bg);
    color: var(--icu-ink);
}

/* ============================================================
   Body: rail + form
   ============================================================ */
.onboarding-popup .op-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    flex: 1 1 auto;
    min-height: 0;
}

/* ---- Stepper rail ----------------------------------------- */
.onboarding-popup .op-rail {
    background: linear-gradient(180deg, #FBFAFC 0%, #F6F2FC 100%);
    border-right: 1px solid var(--icu-line);
    padding: 22px 18px 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.onboarding-popup .op-rail-kicker {
    font-family: var(--icu-font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--icu-ink-4);
    margin-bottom: 14px;
}

.onboarding-popup .op-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.onboarding-popup .op-steps::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 13px;
    width: 2px;
    background: var(--icu-line-strong);
    border-radius: 1px;
}

.onboarding-popup .op-step {
    position: relative;
    padding: 6px 0 6px 38px;
    cursor: pointer;
    min-height: 40px;
}

.onboarding-popup .op-step + .op-step {
    margin-top: 4px;
}

.onboarding-popup .op-step-num {
    position: absolute;
    left: 0;
    top: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--icu-line-strong);
    color: var(--icu-ink-3);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--icu-font-mono);
    transition: all 0.15s ease;
    z-index: 1;
}

.onboarding-popup .op-step-num svg {
    width: 13px;
    height: 13px;
}

.onboarding-popup .op-step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--icu-ink-3);
    line-height: 1.3;
    padding-top: 5px;
    transition: color 0.15s ease;
}

.onboarding-popup .op-step-desc {
    font-size: 11.5px;
    color: var(--icu-ink-4);
    line-height: 1.45;
    margin-top: 4px;
    display: none;
}

.onboarding-popup .op-step.done .op-step-num {
    background: var(--icu-brand);
    border-color: var(--icu-brand);
    color: #fff;
}

.onboarding-popup .op-step.done .op-step-label {
    color: var(--icu-ink-2);
}

.onboarding-popup .op-step.active .op-step-num {
    background: #fff;
    border-color: var(--icu-brand);
    color: var(--icu-brand);
    box-shadow: 0 0 0 4px rgba(111, 66, 193, 0.12);
}

.onboarding-popup .op-step.active .op-step-label {
    color: var(--icu-ink);
    font-weight: 600;
}

.onboarding-popup .op-step.active .op-step-desc {
    display: block;
}

.onboarding-popup .op-step:hover:not(.active) .op-step-label {
    color: var(--icu-ink);
}

/* Rail footer card */
.onboarding-popup .op-rail-foot {
    margin-top: auto;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--icu-line);
    border-radius: 10px;
}

.onboarding-popup .op-rf-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--icu-ink-3);
}

.onboarding-popup .op-rf-row svg {
    width: 13px;
    height: 13px;
    color: var(--icu-brand);
    flex-shrink: 0;
}

.onboarding-popup .op-rf-row + .op-rf-row {
    margin-top: 7px;
}

.onboarding-popup .op-rf-row b {
    color: var(--icu-ink-2);
    font-weight: 600;
}

/* ---- Form area -------------------------------------------- */
.onboarding-popup .op-form {
    overflow-y: auto;
    padding: 28px 36px 32px;
    min-width: 0;
}

.onboarding-popup .op-form::-webkit-scrollbar {
    width: 8px;
}

.onboarding-popup .op-form::-webkit-scrollbar-thumb {
    background: var(--icu-line-strong);
    border-radius: 4px;
}

.onboarding-popup .op-form::-webkit-scrollbar-track {
    background: transparent;
}

.onboarding-popup .op-panel {
    display: none;
}

.onboarding-popup .op-panel.on {
    display: block;
    animation: opOnboardingFade 0.22s ease;
}

@keyframes opOnboardingFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.onboarding-popup .op-panel-head {
    margin-bottom: 22px;
}

.onboarding-popup .op-panel-eyebrow {
    font-family: var(--icu-font-mono);
    font-size: 10.5px;
    color: var(--icu-brand);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
}

.onboarding-popup .op-panel-title {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--icu-ink);
    line-height: 1.15;
    margin: 0 0 6px;
}

.onboarding-popup .op-panel-sub {
    font-size: 13px;
    color: var(--icu-ink-3);
    line-height: 1.5;
    max-width: 480px;
    margin: 0;
}

/* ---- Section block ---------------------------------------- */
.onboarding-popup .op-sec {
    border-top: 1px solid var(--icu-line);
    padding-top: 16px;
    margin-top: 18px;
}

.onboarding-popup .op-sec:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.onboarding-popup .op-sec-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--icu-font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--icu-ink-3);
    margin-bottom: 12px;
    font-weight: 600;
}

.onboarding-popup .op-sec-n {
    color: var(--icu-ink-4);
    font-weight: 400;
}

/* ---- Profile picture card ---------------------------------
   The grid leaves enough room in the image column for ImageEdit's
   hover-revealed Edit/Delete buttons (30px wide), so the body copy
   isn't covered when the user mouses over the avatar. */
.onboarding-popup .op-pfp {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 22px;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--icu-purple-25) 0%, #FDFAFE 100%);
    border: 1px dashed var(--icu-purple-200);
    border-radius: 12px;
    margin-bottom: 18px;
}

.onboarding-popup .op-pfp-img {
    height: 72px;
    flex-shrink: 0;
}

.onboarding-popup .op-pfp-img .image-edit-image,
.onboarding-popup .op-pfp-img .image-edit-image-large {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    border: 3px solid #fff !important;
    box-shadow: 0 4px 10px rgba(111, 66, 193, 0.18);
    overflow: hidden;
}

.onboarding-popup .op-pfp-img .image-edit-image img,
.onboarding-popup .op-pfp-img .image-edit-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.onboarding-popup .op-pfp-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--icu-ink);
    margin-bottom: 2px;
}

.onboarding-popup .op-pfp-sub {
    font-size: 11.5px;
    color: var(--icu-ink-3);
    line-height: 1.45;
}

/* ---- Help banner ------------------------------------------ */
.onboarding-popup .op-help {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    padding: 10px 12px;
    background: var(--icu-purple-25);
    border: 1px solid var(--icu-purple-50);
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--icu-brand-ink);
    line-height: 1.5;
}

.onboarding-popup .op-help svg {
    width: 16px;
    height: 16px;
    color: var(--icu-brand);
    margin-top: 1px;
}

.onboarding-popup .op-help b {
    font-weight: 600;
}

/* ---- Numbered question stack ------------------------------ */
.onboarding-popup .op-qstack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.onboarding-popup .op-qline {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: center;
}

.onboarding-popup .op-qline-n {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--icu-purple-25);
    color: var(--icu-brand);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--icu-font-mono);
}

/* ============================================================
   Footer
   ============================================================ */
.onboarding-popup .op-foot {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    background: #FAFAFC;
}

.onboarding-popup .op-foot-prog {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: var(--icu-ink-3);
    font-family: var(--icu-font-mono);
}

.onboarding-popup .op-foot-prog-pct {
    font-variant-numeric: tabular-nums;
}

.onboarding-popup .op-prog-bar {
    width: 120px;
    height: 4px;
    background: var(--icu-line);
    border-radius: 2px;
    overflow: hidden;
}

.onboarding-popup .op-prog-bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--icu-brand) 0%, #9870D6 100%);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(.2, .7, .2, 1);
}

.onboarding-popup .op-foot-skip {
    background: transparent;
    border: 0;
    color: var(--icu-ink-3);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: inherit;
    justify-self: end;
}

.onboarding-popup .op-foot-skip:hover {
    color: var(--icu-brand);
    background: var(--icu-purple-25);
}

.onboarding-popup .op-foot-btns {
    display: flex;
    gap: 8px;
}

/* Reset the icu-popup button min-width so our compact back/next pair sits
   correctly within the brand chrome. */
.onboarding-popup .op-foot-btns .dxbl-btn {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 550;
    border-radius: 8px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.onboarding-popup .op-foot-btns .dxbl-btn svg {
    width: 14px;
    height: 14px;
}

.onboarding-popup .op-btn-next.dxbl-btn-primary {
    background: var(--icu-brand);
    border-color: var(--icu-brand);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04),
                0 4px 12px rgba(111, 66, 193, 0.28);
}

.onboarding-popup .op-btn-next.dxbl-btn-primary:hover {
    background: var(--icu-brand-ink);
    border-color: var(--icu-brand-ink);
    color: #fff;
}

/* ============================================================
   Field-level styling — keep DevExpress inputs but soften captions
   to match the design's lighter 12px / 550 treatment.
   ============================================================ */

/* DxFormLayout reacts to its own width instead of the media width — set a
   containment context on each form layout inside the popup. */
.onboarding-popup .dxbl-fl {
    container-type: inline-size;
}

@container (width >= 400px) {
    .onboarding-popup .dxbl-fl .dxbl-fl-item.dxbl-fl-item-horizontal {
        -webkit-box-orient: horizontal;
        flex-direction: row;
        flex-flow: row nowrap;
    }
}

@container (width < 400px) {
    .onboarding-popup .dxbl-fl .dxbl-fl-item.dxbl-fl-item-horizontal {
        -webkit-box-orient: vertical;
        flex-direction: column;
        flex-flow: column nowrap;
    }

    .onboarding-popup .dxbl-fl .dxbl-fl-ctrl {
        width: 100% !important;
    }
}

.onboarding-popup .dxbl-fl .dxbl-fl-cpt {
    font-size: 12px;
    font-weight: 550;
    color: var(--icu-ink-2);
}
