:root {
    --primary: #1456d8;
    --primary-dark: #0f43aa;
    --surface: #ffffff;
    --surface-soft: #f5f7fb;
    --border: #dce3ee;
    --text: #162033;
    --muted: #667085;
    --success: #117a52;
    --danger: #b42318;
    --warning-bg: #fff8e6;
    --shadow: 0 24px 70px rgba(15, 35, 70, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: var(--text);
    background: #edf2f9;
}

button,
input,
select {
    font: inherit;
}

.onboarding-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) minmax(560px, 1.2fr);
}

.onboarding-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 36px;
    padding: clamp(38px, 6vw, 80px);
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 34%),
        linear-gradient(145deg, #0e3c93, #1456d8 54%, #3377ef);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 34px;
    border-radius: 14px;
    font-size: 1.3rem;
    font-weight: 800;
    background: #fff;
    color: var(--primary);
}

.eyebrow {
    margin: 0 0 8px;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .78;
}

.onboarding-brand-panel h1 {
    max-width: 540px;
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: 1.04;
}

.brand-copy {
    max-width: 560px;
    margin: 24px 0 0;
    color: rgba(255,255,255,.82);
    font-size: 1.05rem;
    line-height: 1.75;
}

.journey-list {
    display: grid;
    gap: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.journey-list li {
    position: relative;
    padding-left: 32px;
    color: rgba(255,255,255,.9);
}

.journey-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
}

.security-note {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px;
    color: rgba(255,255,255,.84);
    background: rgba(5, 27, 73, .2);
}

.onboarding-content-panel {
    padding: clamp(28px, 5vw, 68px);
    background: var(--surface);
}

.wizard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.wizard-header h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.application-reference {
    min-width: 170px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: right;
    background: var(--surface-soft);
}

.application-reference small,
.application-reference strong {
    display: block;
}

.application-reference small {
    color: var(--muted);
    margin-bottom: 3px;
}

.wizard-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 34px;
}

.progress-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
}

.progress-step::after {
    content: "";
    position: absolute;
    top: 15px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--border);
}

.progress-step:last-child::after {
    display: none;
}

.progress-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 800;
    background: #fff;
}

.progress-step small {
    font-size: .72rem;
    font-weight: 700;
}

.progress-step.is-active,
.progress-step.is-complete {
    color: var(--primary);
}

.progress-step.is-active span,
.progress-step.is-complete span {
    border-color: var(--primary);
}

.progress-step.is-complete span {
    color: #fff;
    background: var(--primary);
}

.wizard-step {
    display: none;
    animation: stepIn .24s ease-out;
}

.wizard-step.is-active {
    display: block;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.field {
    display: grid;
    gap: 7px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field > span {
    color: #344054;
    font-size: .86rem;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #cfd7e5;
    border-radius: 10px;
    color: var(--text);
    outline: none;
    background: #fff;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 86, 216, .12);
}

.switch-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.switch-field input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

.switch-field strong,
.switch-field small {
    display: block;
}

.switch-field small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.5;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.split-actions {
    justify-content: space-between;
}

.button {
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.button:disabled {
    opacity: .58;
    cursor: wait;
}

.button-primary {
    color: #fff;
    background: var(--primary);
}

.button-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.button-secondary {
    color: var(--text);
    border: 1px solid var(--border);
    background: #fff;
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: .9rem;
}

.alert-error {
    color: var(--danger);
    border: 1px solid #f1b8b3;
    background: #fff1f0;
}

.alert-success {
    color: var(--success);
    border: 1px solid #a7dcc7;
    background: #ecfdf3;
}

.verification-card,
.review-card {
    max-width: 720px;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.verification-icon,
.completion-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    color: var(--primary);
    font-size: 1.45rem;
    background: #e9f0ff;
}

.verification-card h3 {
    margin: 22px 0 8px;
}

.verification-card p {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.65;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.plan-card {
    display: grid;
    gap: 14px;
    min-height: 300px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    background: #fff;
    transition: .18s ease;
}

.plan-card:hover,
.plan-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 12px 34px rgba(20, 86, 216, .13);
}

.plan-card input {
    position: absolute;
    opacity: 0;
}

.plan-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.plan-card-top small {
    padding: 5px 8px;
    border-radius: 20px;
    color: var(--success);
    font-size: .7rem;
    font-weight: 800;
    background: #ecfdf3;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 850;
}

.plan-price small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

.plan-description {
    color: var(--muted);
    line-height: 1.5;
}

.plan-card ul {
    display: grid;
    gap: 8px;
    padding-left: 18px;
    margin: 0;
    color: #475467;
    font-size: .85rem;
}

.subscription-options {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: end;
    margin-top: 22px;
}

.loading-card,
.empty-card {
    grid-column: 1 / -1;
    padding: 32px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.review-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.review-heading h3 {
    margin: 0;
}

.status-badge {
    padding: 7px 10px;
    border-radius: 30px;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 800;
    background: #e9f0ff;
}

.review-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 28px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.review-list div {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.review-list div:nth-child(odd) {
    border-right: 1px solid var(--border);
}

.review-list dt {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.review-list dd {
    margin: 6px 0 0;
    font-weight: 750;
}

.activation-warning {
    padding: 16px 18px;
    border: 1px solid #f1d28e;
    border-radius: 12px;
    background: var(--warning-bg);
}

.activation-warning p {
    margin: 5px 0 0;
    color: #7a5710;
    line-height: 1.55;
}

.completion-panel {
    max-width: 620px;
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.completion-panel .completion-icon {
    margin: 0 auto 22px;
    color: #fff;
    background: var(--success);
}

.completion-panel p {
    color: var(--muted);
    line-height: 1.7;
}

.completion-panel > strong {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--surface-soft);
}

@media (max-width: 980px) {
    .onboarding-shell {
        grid-template-columns: 1fr;
    }

    .onboarding-brand-panel {
        min-height: auto;
    }

    .journey-list,
    .security-note {
        display: none;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .onboarding-content-panel {
        padding: 24px 18px;
    }

    .form-grid,
    .subscription-options,
    .review-list {
        grid-template-columns: 1fr;
    }

    .review-list div:nth-child(odd) {
        border-right: 0;
    }

    .wizard-progress {
        overflow-x: auto;
        grid-template-columns: repeat(6, 70px);
        padding-bottom: 6px;
    }

    .wizard-header {
        display: grid;
    }

    .application-reference {
        text-align: left;
    }

    .split-actions {
        flex-direction: column-reverse;
    }

    .button {
        width: 100%;
    }
}


/* ==========================================================
   CPLIX onboarding subscription enhancements
   ========================================================== */

.step-intro {
    margin-bottom: 22px;
}

.step-intro h3 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.step-intro p:not(.eyebrow) {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.switch-field.is-disabled {
    opacity: .62;
    background: #f8fafc;
}

.switch-field.is-disabled input {
    cursor: not-allowed;
}

.billing-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.billing-preview[hidden] {
    display: none;
}

.billing-preview > div {
    display: grid;
    gap: 5px;
    padding: 4px 8px;
}

.billing-preview small {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.billing-preview strong {
    font-size: .95rem;
}

.completion-status {
    display: table;
    margin: 16px auto 2px;
}

.plan-card ul {
    align-content: start;
}

@media (max-width: 640px) {
    .billing-preview {
        grid-template-columns: 1fr;
    }
}
