/* Onboarding Wizard */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --purple-dark: #5b21b6;
    --cyan: #06b6d4;
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-alt-2: #f1f5f9;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, sans-serif; color: var(--ink); background: var(--surface); overflow-x: hidden; min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* Layout */
.ob { min-height: 100vh; }
.ob-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; }
.ob-login { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.ob-login:hover { color: var(--ink); }

/* Progress */
.ob-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: var(--line); }
.ob-progress-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 0 3px 3px 0; }

/* Stepper dots */
.ob-dots { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 50; }
.ob-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #cbd5e1; transition: all 0.4s; box-shadow: 0 2px 8px rgba(15,23,42,0.04); }
.ob-dot.active { background: var(--purple); border-color: var(--purple); color: white; box-shadow: 0 0 16px rgba(124,58,237,0.35); }
.ob-dot.done { background: rgba(6,182,212,0.12); border-color: var(--cyan); color: var(--cyan); }

/* Steps */
.ob-steps { padding-top: 130px; padding-bottom: 60px; position: relative; z-index: 1; }
.ob-step { display: none; max-width: 620px; margin: 0 auto; padding: 0 24px; animation: fadeUp 0.4s ease; }
.ob-step.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Titles */
.ob-label { font-size: 12px; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; }
.ob-question { font-size: clamp(26px, 4vw, 38px); font-weight: 800; line-height: 1.15; letter-spacing: -0.5px; margin-bottom: 32px; color: var(--ink); }
.ob-question .hl { background: linear-gradient(135deg, var(--purple), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Fields */
.ob-field { margin-bottom: 20px; }
.ob-flabel { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 6px; display: block; }
.ob-flabel .req { color: var(--purple); }
.ob-input { width: 100%; padding: 14px 0; background: transparent; border: none; border-bottom: 2px solid var(--line); color: var(--ink); font-size: 20px; font-weight: 500; font-family: inherit; outline: none; transition: border-color 0.3s; }
.ob-input:focus { border-color: var(--purple); }
.ob-input::placeholder { color: #cbd5e1; }
.ob-input-sm { font-size: 16px; padding: 12px 0; }
.ob-input-err { border-color: #ef4444 !important; }
.ob-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ob-textarea { width: 100%; padding: 12px 0; background: transparent; border: none; border-bottom: 2px solid var(--line); color: var(--ink); font-size: 15px; font-family: inherit; outline: none; resize: none; transition: border-color 0.3s; }
.ob-textarea:focus { border-color: var(--purple); }
.ob-textarea::placeholder { color: #cbd5e1; }
.ob-desc-toggle { background: none; border: none; color: var(--purple); font-size: 13px; cursor: pointer; font-family: inherit; padding: 6px 0; font-weight: 600; }
.ob-error { color: #ef4444; font-size: 13px; margin-top: 4px; display: none; }
.ob-error.visible { display: block; }

/* Nav */
.ob-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }
.ob-btn { padding: 14px 36px; border-radius: 12px; font-size: 15px; font-weight: 700; border: none; cursor: pointer; transition: all 0.3s; font-family: inherit; display: inline-flex; align-items: center; gap: 8px; }
.ob-btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: white; box-shadow: 0 6px 24px rgba(124,58,237,0.25); }
.ob-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(124,58,237,0.4); }
.ob-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.ob-btn-back { background: none; color: var(--muted); padding: 14px 16px; }
.ob-btn-back:hover { color: var(--ink); }
.ob-btn-skip { background: none; border: none; color: #94a3b8; font-size: 12px; cursor: pointer; font-family: inherit; padding: 6px 12px; transition: color 0.2s; }
.ob-btn-skip:hover { color: var(--muted); }
.ob-key-hint { font-size: 11px; color: #94a3b8; margin-top: 12px; text-align: right; }
.ob-key-hint kbd { padding: 2px 8px; background: var(--surface-alt-2); border: 1px solid var(--line); border-radius: 4px; font-family: inherit; color: var(--ink-soft); }

/* Step 2: Presets — the colored preview area inside each card keeps its colored bg */
.ob-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 24px; }
.ob-preset { cursor: pointer; }
.ob-preset input { position: absolute; opacity: 0; pointer-events: none; }
.ob-preset-card { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; transition: all 0.3s; background: var(--surface); box-shadow: 0 2px 8px rgba(15,23,42,0.04); }
.ob-preset input:checked + .ob-preset-card { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(124,58,237,0.15), 0 4px 16px rgba(124,58,237,0.12); }
.ob-preset-card:hover { border-color: var(--line-strong); }
.ob-preset-vis { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--surface-alt); }
.ob-preset-bar { position: absolute; top: 0; left: 0; right: 0; height: 14px; background: linear-gradient(180deg,#f8fafc,#eef2f7); border-bottom: 1px solid rgba(15,23,42,0.06); display: flex; align-items: center; gap: 4px; padding: 0 6px; z-index: 2; }
.ob-preset-bar span { width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; }
.ob-preset-bar span:nth-child(1) { background: #fb7185; }
.ob-preset-bar span:nth-child(2) { background: #fbbf24; }
.ob-preset-bar span:nth-child(3) { background: #34d399; }
.ob-preset-img { display: block; width: 100%; height: auto; animation: ob-preset-scroll 22s ease-in-out infinite alternate; will-change: transform; }
.ob-preset:hover .ob-preset-img, .ob-preset input:checked + .ob-preset-card .ob-preset-img { animation-play-state: paused; }
@keyframes ob-preset-scroll { 0%, 6% { transform: translateY(0); } 94%, 100% { transform: translateY(-52%); } }
@media (prefers-reduced-motion: reduce) { .ob-preset-img { animation: none; transform: translateY(0); } }
.ob-preset-info { padding: 8px; text-align: center; background: var(--surface-alt); border-top: 1px solid var(--line); }
.ob-preset-info strong { font-size: 11px; font-weight: 700; color: var(--ink); display: block; }
.ob-preset-info span { font-size: 9px; color: var(--muted); }

/* Palettes */
.ob-pal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ob-pal-header span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ob-pal-toggle { background: none; border: none; color: var(--purple); font-size: 11px; cursor: pointer; font-family: inherit; font-weight: 600; }
.ob-pal-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-pal-grid.collapsed .ob-pal-extra { display: none; }
.ob-palette { cursor: pointer; }
.ob-palette input { position: absolute; opacity: 0; pointer-events: none; }
.ob-pal-sw { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border: 2px solid var(--line); border-radius: 6px; background: var(--surface); transition: all 0.2s; }
.ob-palette input:checked + .ob-pal-sw { border-color: var(--purple); background: rgba(124,58,237,0.06); }
.ob-pal-sw:hover { border-color: var(--line-strong); }
.ob-pal-dots { display: flex; flex-shrink: 0; }
.ob-pal-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid white; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(15,23,42,0.08); }
.ob-pal-name { font-size: 10px; color: var(--ink-soft); font-weight: 500; }
.ob-pal-rec { font-size: 8px; background: var(--purple); color: white; padding: 1px 5px; border-radius: 4px; font-weight: 700; margin-left: 2px; }

/* Step 3: Live Preview — browser-style chrome on light theme */
.ob-live-preview { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 48px rgba(15,23,42,0.12); margin-bottom: 24px; background: var(--surface); }
.ob-lp-bar { height: 32px; background: var(--surface-alt-2); display: flex; align-items: center; padding: 0 10px; gap: 5px; border-bottom: 1px solid var(--line); }
.ob-lp-bar span { width: 7px; height: 7px; border-radius: 50%; }
.ob-lp-frame { position: relative; background: white; overflow: hidden; }
.ob-lp-frame iframe { display: block; width: 1440px; height: 900px; transform-origin: top left; border: none; }
.ob-lp-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); z-index: 2; }

/* Step 4: Plan cards (styled via inline — rules kick in on interaction) */
.ob-plan-radio:checked + .ob-plan-card { border-color: var(--purple) !important; box-shadow: 0 0 0 2px rgba(124,58,237,0.15), 0 8px 24px rgba(124,58,237,0.12); background: rgba(124,58,237,0.04) !important; }
.ob-plan-card:hover { border-color: var(--line-strong) !important; }

/* Step 4: Account */
.ob-summary { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; display: flex; align-items: center; gap: 16px; box-shadow: 0 2px 8px rgba(15,23,42,0.04); }
.ob-summary-color { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.ob-summary-info { flex: 1; }
.ob-summary-info strong { font-size: 15px; color: var(--ink); display: block; }
.ob-summary-info span { font-size: 12px; color: var(--muted); }
.ob-account { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 4px 16px rgba(15,23,42,0.04); }
.ob-inp { width: 100%; padding: 13px 14px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 15px; font-family: inherit; outline: none; transition: all 0.3s; margin-bottom: 4px; }
.ob-inp:focus { border-color: var(--purple); background: var(--surface); box-shadow: 0 0 0 3px rgba(124,58,237,0.08); }
.ob-inp::placeholder { color: #94a3b8; }
.ob-pw-bar { height: 3px; border-radius: 2px; background: var(--line); margin: 6px 0 12px; overflow: hidden; }
.ob-pw-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; }

/* Loading — dramatic dark overlay during AI generation (intentional) */
.ob-loading { position: fixed; inset: 0; z-index: 200; background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; text-align: center; padding: 24px; }
.ob-loading-spinner { width: 48px; height: 48px; border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--purple-light); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ob-loading h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; color: white; }
.ob-loading p { font-size: 14px; color: rgba(255,255,255,0.5); }
.ob-ls { margin-top: 28px; text-align: left; max-width: 240px; }
.ob-ls div { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 12px; color: rgba(255,255,255,0.25); transition: color 0.4s; }
.ob-ls div.on { color: white; }
.ob-ls div.ok { color: var(--cyan); }

/* BG decorative blobs */
.ob-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.ob-bg::before { content: ''; position: absolute; top: 20%; left: -15%; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(124,58,237,0.05) 0%, transparent 70%); }
.ob-bg::after { content: ''; position: absolute; bottom: 5%; right: -10%; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(6,182,212,0.04) 0%, transparent 70%); }

/* Responsive — Tablet */
@media (max-width: 768px) {
    .ob-steps { padding-top: 110px; padding-bottom: 32px; }
    .ob-dots { top: 66px; gap: 6px; }
    .ob-dot { width: 24px; height: 24px; font-size: 10px; }
    .ob-header { padding: 16px 20px; }
    .ob-question { font-size: 22px; margin-bottom: 24px; }
    .ob-label { font-size: 11px; margin-bottom: 8px; }
    .ob-input { font-size: 18px; padding: 12px 0; }
    .ob-input-sm { font-size: 15px; padding: 10px 0; }
    .ob-row { grid-template-columns: 1fr; gap: 0; }
    .ob-field { margin-bottom: 16px; }
    .ob-nav { flex-direction: column-reverse; gap: 8px; margin-top: 24px; }
    .ob-nav > div { width: 100%; display: flex; flex-direction: column-reverse; gap: 8px; }
    .ob-btn { width: 100%; text-align: center; justify-content: center; padding: 14px 24px; }
    .ob-btn-back { text-align: center; }
    .ob-btn-skip { width: 100%; text-align: center; padding: 10px; }
    .ob-key-hint { display: none; }
    /* Step 2 */
    .ob-presets { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ob-preset-vis { aspect-ratio: 4/5; }
    .ob-preset-info { padding: 6px 8px; }
    .ob-preset-info strong { font-size: 10px; }
    .ob-preset-info span { font-size: 8px; }
    .ob-pal-grid { gap: 4px; }
    .ob-pal-sw { padding: 3px 8px; }
    /* Step 3: iframe */
    .ob-live-preview { border-radius: 10px; margin: 0 -12px 20px; }
    /* Step 4 */
    .ob-account { padding: 20px; border-radius: 12px; }
    .ob-summary { padding: 12px 16px; gap: 12px; }
    .ob-summary-color { width: 32px; height: 32px; border-radius: 8px; }
    .ob-summary-info strong { font-size: 14px; }
    .ob-inp { font-size: 14px; padding: 12px; }
    /* Loading */
    .ob-loading h2 { font-size: 18px; }
}

/* Responsive — Small mobile */
@media (max-width: 380px) {
    .ob-steps { padding-top: 100px; }
    .ob-question { font-size: 20px; }
    .ob-presets { grid-template-columns: 1fr 1fr; gap: 6px; }
    .ob-preset-vis { height: 60px; }
    .ob-step { padding: 0 16px; }
    .ob-live-preview { margin: 0 -8px 16px; }
}
