/* LAYDDriver onboarding — aligned with LAYDCloud admin blue */
:root {
    --bg: #f0f4f8;
    --bg-deep: #e8eef5;
    --white: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #1e40af;
    --primary-mid: #2563eb;
    --primary-soft: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.18);
    --accent: #0ea5e9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --success: #059669;
    --success-bg: #ecfdf5;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --warn: #d97706;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px -6px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 20px 50px -20px rgba(30, 64, 175, 0.25);
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --step-h: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(ellipse 80% 50% at 100% -10%, rgba(37, 99, 235, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 40% at -10% 80%, rgba(14, 165, 233, 0.1), transparent 45%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    -webkit-font-smoothing: antialiased;
}

.onb-shell--success {
    grid-template-columns: 1fr;
}

.onb-shell--success .onb-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* —— Shell —— */
.onb-shell {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

.onb-rail {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.25rem 2rem 2rem;
    color: #fff;
    background:
        linear-gradient(165deg, #0b1220 0%, #0f2744 42%, #1e40af 100%);
    overflow: hidden;
}

.onb-rail::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 90%, rgba(14, 165, 233, 0.35) 0%, transparent 42%),
        radial-gradient(circle at 90% 10%, rgba(96, 165, 250, 0.28) 0%, transparent 40%);
    pointer-events: none;
}

.onb-rail::after {
    content: '';
    position: absolute;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    top: -4rem;
    right: -6rem;
    pointer-events: none;
}

.onb-rail > * { position: relative; z-index: 1; }

.onb-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.onb-logo-mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.onb-logo-mark i { width: 1.2rem; height: 1.2rem; }

.onb-rail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.onb-rail-badge i { width: 0.85rem; height: 0.85rem; }

.onb-rail-copy { margin: 2.5rem 0 auto; max-width: 20rem; }
.onb-rail-copy h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.onb-rail-copy p {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.onb-rail-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.onb-rail-steps li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s;
}

.onb-rail-steps li.is-active,
.onb-rail-steps li.is-done { color: #fff; font-weight: 600; }

.onb-rail-steps .dot {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.onb-rail-steps li.is-active .dot {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}

.onb-rail-steps li.is-done .dot {
    background: rgba(14, 165, 233, 0.9);
    border-color: transparent;
    color: #fff;
}

.onb-rail-foot {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

/* —— Main panel —— */
.onb-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.onb-mobile-brand {
    display: none;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    background: linear-gradient(165deg, #0b1220 0%, #1e40af 100%);
    color: #fff;
    flex-shrink: 0;
}

.onb-mobile-brand .mark {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.onb-mobile-brand .mark i { width: 1rem; height: 1rem; }

.onb-mobile-brand .txt {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.onb-mobile-brand .name {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.onb-mobile-brand .sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.02em;
}

.onb-top {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.5rem 0.75rem;
}

.onb-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.onb-top-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.onb-top-meta {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    flex-shrink: 0;
}

.onb-progress {
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.onb-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-mid), var(--accent));
    border-radius: 999px;
    transition: width 0.35s ease;
}

.onb-stepper {
    display: none;
    gap: 0.4rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
}

.onb-stepper::-webkit-scrollbar { display: none; }

.onb-stepper button {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    min-height: 34px;
}

.onb-stepper button.is-active {
    background: var(--primary-soft);
    border-color: #93c5fd;
    color: var(--primary);
}

.onb-stepper button.is-done {
    color: var(--success);
    border-color: #a7f3d0;
    background: var(--success-bg);
}

.onb-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1.5rem 1.25rem;
    overscroll-behavior: contain;
}

.onb-card {
    max-width: 42rem;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem 1.65rem 1.5rem;
    animation: onbIn 0.35s ease;
}

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

.onb-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1.35rem;
}

.onb-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--primary-soft), #dbeafe);
    color: var(--primary-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.onb-card-icon i { width: 1.3rem; height: 1.3rem; }

.onb-card-head h2 {
    margin: 0 0 0.3rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.onb-card-head p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.45;
}

.panel { display: none; }
.panel.is-active { display: block; }

.alert {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 1.1rem;
}

.alert i { width: 1.1rem; height: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.alert--info { background: var(--primary-soft); color: #1e3a8a; border: 1px solid #bfdbfe; }
.alert--error { background: var(--error-bg); color: var(--error); border: 1px solid #fecaca; }
.alert--success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.9rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 0.9rem; }

.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 650;
    margin-bottom: 0.35rem;
    color: var(--text);
}
.field .hint {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.3rem;
    line-height: 1.35;
}
.field input,
.field select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: #f8fafc;
    min-height: 46px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
}
.field input:hover,
.field select:hover { border-color: var(--border-strong); }
.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary-mid);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.field.is-invalid input,
.field.is-invalid select { border-color: #f87171; background: #fff8f8; }
.field .err {
    display: none;
    font-size: 0.72rem;
    color: var(--error);
    margin-top: 0.25rem;
    font-weight: 600;
}
.field.is-invalid .err { display: block; }
.check.is-invalid { border-color: #f87171; background: #fff8f8; }
.check .err { display: none; font-size: 0.72rem; color: var(--error); font-weight: 600; margin-top: 0.35rem; width: 100%; }
.check.is-invalid .err { display: block; }
.upload.is-invalid {
    border-color: #f87171;
    background: #fff8f8;
}
#form-alert[hidden] { display: none !important; }

/* File dropzones */
.upload {
    position: relative;
    border: 1.5px dashed var(--border-strong);
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.15rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    min-height: 6.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.upload:hover,
.upload.is-drag {
    border-color: var(--primary-mid);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.upload.has-file {
    border-style: solid;
    border-color: #86efac;
    background: var(--success-bg);
}

.upload i.upload-ico {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary-mid);
}

.upload.has-file i.upload-ico { color: var(--success); }

.upload .upload-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.upload .upload-sub {
    font-size: 0.72rem;
    color: var(--muted);
}

.upload .upload-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
}

.upload.has-file .upload-name { display: block; }
.upload.has-file .upload-sub { display: none; }

.upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.checks { display: flex; flex-direction: column; gap: 0.55rem; }

.check {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfc;
    font-size: 0.85rem;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.check:hover { border-color: #93c5fd; background: var(--primary-soft); }
.check:has(input:checked) {
    border-color: #93c5fd;
    background: var(--primary-soft);
}

.check input {
    margin-top: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--primary-mid);
    flex-shrink: 0;
}

.review-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
    font-size: 0.85rem;
}

.review-box dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.review-box dt { color: var(--muted); font-weight: 600; }
.review-box dd { margin: 0; font-weight: 650; }

/* Footer nav — always pinned to bottom of the viewport shell */
.onb-footer {
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 0.85rem 1.5rem;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.06);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    min-height: 48px;
    transition: filter 0.15s, transform 0.1s, background 0.15s;
}

.btn i { width: 1.1rem; height: 1.1rem; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: wait; }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover { background: #f8fafc; color: var(--text); }

.btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    min-width: 9.5rem;
    margin-left: auto;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-success {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
    min-width: 11rem;
    margin-left: auto;
}

.onb-links {
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Success state */
.success-panel {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.success-panel .burst {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.success-panel .burst i { width: 2rem; height: 2rem; }
.success-panel h2 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 800; }
.success-panel p { margin: 0 auto 1.5rem; max-width: 26rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 960px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .onb-shell {
        grid-template-columns: 1fr;
        height: 100%;
        height: 100dvh;
        min-height: 100%;
        min-height: 100dvh;
        max-height: 100%;
        max-height: 100dvh;
        overflow: hidden;
    }

    .onb-rail { display: none; }

    .onb-mobile-brand { display: flex; }

    .onb-main {
        height: 100%;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        overflow: hidden;
    }

    .onb-stepper { display: flex; }

    .grid-2,
    .grid-3 { grid-template-columns: 1fr; }

    .onb-top {
        padding: 0.7rem 1rem 0.65rem;
    }

    .onb-top-title { font-size: 0.98rem; }

    .onb-body {
        padding: 1rem 0.85rem 1rem;
    }

    .onb-card {
        padding: 1.15rem 0.95rem 1rem;
        border-radius: 16px;
    }

    .onb-card-head {
        gap: 0.7rem;
        margin-bottom: 1.1rem;
    }

    .onb-card-head h2 { font-size: 1.15rem; }
    .onb-card-head p { font-size: 0.84rem; }
    .onb-card-icon { width: 2.4rem; height: 2.4rem; border-radius: 11px; }

    .field { margin-bottom: 0.85rem; }

    /* Prevent iOS zoom on focus */
    .field input,
    .field select {
        font-size: 16px;
        min-height: 48px;
        border-radius: 12px;
    }

    .upload {
        min-height: 5.75rem;
        padding: 1rem 0.85rem;
    }

    .check {
        padding: 0.8rem 0.85rem;
        font-size: 0.84rem;
    }

    .review-box dl {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .review-box dt { margin-top: 0.35rem; }
    .review-box dt:first-child { margin-top: 0; }

    .onb-footer {
        padding: 0.7rem 0.85rem;
        padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
        gap: 0.5rem;
    }

    .onb-footer .btn[hidden] { display: none !important; }

    .btn {
        min-height: 48px;
        padding: 0.65rem 1rem;
        font-size: 0.875rem;
    }

    .btn-ghost {
        flex: 0 0 auto;
        min-width: 5.75rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .btn-primary,
    .btn-success {
        min-width: 0;
        flex: 1 1 auto;
        margin-left: 0;
    }

    .onb-links {
        margin-top: 1rem;
        font-size: 0.8rem;
        padding-bottom: 0.25rem;
    }

    .success-panel {
        padding: 1.5rem 0.5rem 1rem;
    }

    .success-panel h2 { font-size: 1.3rem; }
}

@media (max-width: 380px) {
    .onb-stepper button {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
        min-height: 30px;
    }

    .btn-ghost span.hide-xs,
    .btn-primary .hide-xs { display: none; }

    .onb-mobile-brand .sub { display: none; }
}

/* Landscape phones: keep shell usable */
@media (max-width: 960px) and (max-height: 480px) {
    .onb-mobile-brand { padding-top: 0.45rem; padding-bottom: 0.45rem; }
    .onb-mobile-brand .sub { display: none; }
    .onb-top { padding-top: 0.45rem; padding-bottom: 0.45rem; }
    .onb-stepper { margin-top: 0.45rem; }
    .onb-card-head { margin-bottom: 0.75rem; }
}
