/* Signup and onboarding screens (sketch/Zlowi platform UI mockups/Zlowi
   Platform.dc.html, turn 7, styled after its .z2-* classes). Shared by the
   signup page (auth/register.html: sign up, email code, company) and the
   SPA's onboarding view (web/js/views/onboarding.js: volume through first
   Record), so the whole flow looks like one sequence even though it spans
   the auth shell and the app. Everything is .onb-* so it can't collide with
   auth.css or app.css. */

/* The signup page loads this without app.css, so it needs the same reset. */
.onb-page,
.onb-page * {
    box-sizing: border-box;
}

body:has(> .onb-page) {
    margin: 0;
}

/* The hidden attribute loses to any display rule below (.onb-btn,
   .onb-inline-form...), so restate it. */
.onb-page [hidden] {
    display: none !important;
}

.onb-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f7f8fa;
    font-family: var(--zlowi-font);
    color: #0f172a;
    /* Room for the fixed .site-footer (shared/css/footer.css). */
    padding-bottom: 48px;
}

.onb-logo {
    display: flex;
    justify-content: center;
    padding: 26px 0 0;
}

.onb-logo img {
    height: 26px;
    width: auto;
    display: block;
}

/* Progress bar: one segment per step; done steps tinted, the current one
   solid with a bold label (see shared/js/onboarding-progress.js). */
.onb-progress {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 652px;
    margin: 22px auto 0;
    padding: 0 16px;
}

.onb-progress-step {
    flex: 1;
    min-width: 0;
}

.onb-progress-bar {
    height: 4px;
    border-radius: 999px;
    background: #e6ebf2;
}

.onb-progress-step--done .onb-progress-bar {
    background: #1a73ff;
    opacity: 0.45;
}

.onb-progress-step--current .onb-progress-bar {
    background: #1a73ff;
}

.onb-progress-label {
    margin-top: 7px;
    font-size: 10.5px;
    font-weight: 600;
    color: #a3aebd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onb-progress-step--current .onb-progress-label {
    font-weight: 700;
    color: #1454c0;
}

.onb-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 26px 16px 0;
}

.onb-body {
    width: 100%;
    max-width: 440px;
}

.onb-body--narrow {
    max-width: 400px;
}

.onb-title {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.onb-title--center,
.onb-sub--center {
    text-align: center;
}

.onb-sub {
    margin-top: 6px;
    font-size: 13.5px;
    color: #64748b;
}

.onb-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 22px;
}

.onb-stack--tight {
    gap: 10px;
}

.onb-gap {
    margin-top: 12px;
}

.onb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.onb-field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
}

.onb-input {
    width: 100%;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font: inherit;
    font-size: 13.5px;
    color: #0f172a;
    outline: none;
}

.onb-input:focus {
    border-color: #1a73ff;
    box-shadow: 0 0 0 3px rgba(26, 115, 255, 0.14);
}

.onb-input.bad {
    border-color: #f0a3a3;
    background: #fffafa;
}

.onb-hint {
    font-size: 11.5px;
    color: #8894a7;
}

/* Inline field check (e.g. "email already registered"), filled in as the
   user leaves the field -- empty takes no space. */
.onb-field-status {
    font-size: 12px;
}

.onb-field-status:empty {
    display: none;
}

.onb-field-status--ok {
    color: #047857;
}

.onb-field-status--bad {
    color: #b91c1c;
}

.onb-error {
    font-size: 13px;
    color: #b91c1c;
}

.onb-error:empty {
    display: none;
}

.onb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

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

.onb-btn--primary {
    background: #1a73ff;
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 115, 255, 0.3);
}

.onb-btn--primary:hover:not(:disabled) {
    background: #0d5fe0;
}

.onb-btn--ghost {
    background: #fff;
    border-color: #e2e8f0;
    color: #334155;
}

.onb-btn--ghost:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #c3cddb;
}

.onb-btn--block {
    width: 100%;
    padding: 12px 0;
}

.onb-link {
    font-size: inherit;
    font-weight: 600;
    color: #1a73ff;
    text-decoration: none;
}

.onb-link:hover {
    text-decoration: underline;
}

button.onb-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.onb-fine {
    font-size: 11.5px;
    line-height: 1.5;
    color: #8894a7;
    text-align: center;
}

.onb-alt {
    font-size: 12.5px;
    color: #64748b;
    text-align: center;
}

/* Back / "Step n of 6" / Continue row under every step. */
.onb-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 652px;
    margin: 0 auto;
    padding: 20px 16px 26px;
}

.onb-footer-step {
    font-size: 12px;
    color: #8894a7;
}

.onb-footer-next {
    margin-left: auto;
}

/* Radio cards (Volume step). The real radio stays in the DOM for keyboard
   and form behavior, visually replaced by .onb-choice-dot. */
.onb-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    background: #fff;
    border: 1.5px solid #eef1f5;
    border-radius: 12px;
    cursor: pointer;
}

.onb-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.onb-choice-dot {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 1.5px solid #c3cddb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.onb-choice:has(input:checked) {
    border-color: #1a73ff;
    box-shadow: 0 4px 14px rgba(26, 115, 255, 0.12);
}

.onb-choice:has(input:checked) .onb-choice-dot {
    border-color: #1a73ff;
}

.onb-choice:has(input:checked) .onb-choice-dot::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1a73ff;
}

.onb-choice:has(input:focus-visible) {
    outline: 2px solid #1a73ff;
    outline-offset: 2px;
}

.onb-choice-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}

.onb-choice .onb-hint {
    display: block;
}

/* Savings step tiles and plan card. */
.onb-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 22px;
}

.onb-tile {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    padding: 18px 20px;
}

.onb-tile--accent {
    border-color: #dbe7ff;
    background: linear-gradient(180deg, #f5f9ff, #fff);
}

.onb-tile-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.onb-tile--accent .onb-tile-label {
    color: #1454c0;
}

.onb-tile-value {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.onb-tile-unit {
    font-size: 15px;
    color: #8894a7;
}

.onb-card {
    margin-top: 12px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    padding: 18px 20px;
}

.onb-card + .onb-card {
    margin-top: 10px;
}

.onb-card-divider {
    height: 1px;
    background: #f2f5f8;
    margin: 15px -20px;
}

.onb-plan {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.onb-plan-name {
    font-size: 13.5px;
    font-weight: 700;
}

.onb-plan-price {
    text-align: right;
    flex: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.onb-plan-price-sub {
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0;
    color: #8894a7;
}

.onb-card .onb-btn {
    margin-top: 12px;
}

/* A green check plus a line of text (Savings' "about $N back", First
   Record's recap). */
.onb-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: #334155;
}

.onb-check svg {
    flex: none;
    color: #22c55e;
}

.onb-check--todo svg {
    color: #c3cddb;
}

.onb-checks {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.onb-rule {
    height: 1px;
    background: #e6ebf2;
    margin: 20px 0 16px;
}

/* Connect ERP step: one card per connector (logo, name, description,
   action), plus the "Other ERP" request card. */
.onb-connector {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px 18px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 12px;
}

.onb-connector--wrap {
    flex-wrap: wrap;
}

.onb-connector--connected {
    border: 1.5px solid #bbf7d0;
}

.onb-connector-text {
    min-width: 0;
    flex: 1;
}

.onb-connector-name {
    font-size: 14px;
    font-weight: 700;
}

.onb-connector-action {
    flex: none;
}

.onb-connector-done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #047857;
}

.onb-inline-form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.onb-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 16px;
}

.onb-note svg {
    flex: none;
    margin-top: 2px;
    color: #8894a7;
}

/* Agent step: the address with a Copy button, then the numbered ways to
   use it. */
.onb-address {
    display: flex;
    margin-top: 8px;
}

.onb-address-row + .onb-address-row {
    margin-top: 14px;
}

/* The address's own Copy button sits flush, not spaced like a card's. */
.onb-card .onb-address .onb-btn {
    margin-top: 0;
}

.onb-upload {
    margin-top: 22px;
}

.onb-address .onb-input {
    border-radius: 9px 0 0 9px;
    background: #f7f8fa;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.onb-address .onb-btn {
    border-radius: 0 9px 9px 0;
    border-left: none;
}

.onb-steps {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.onb-steps-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #334155;
}

.onb-steps-num {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: #eef5ff;
    color: #1454c0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .onb-tiles {
        grid-template-columns: 1fr;
    }

    .onb-progress-label {
        display: none;
    }

    .onb-connector {
        flex-wrap: wrap;
    }
}
