@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* ---- base ---- */
.onboarding-page { margin: 0; color: #0b1548; background: #071033; font-family: "Public Sans", system-ui, sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.onboarding-page *, .onboarding-page *::before, .onboarding-page *::after { box-sizing: border-box; }
.onboarding-page button, .onboarding-page input { margin: 0; font: inherit; }
.onboarding-page button { cursor: pointer; }
.onboarding-page img, .onboarding-page svg { display: block; max-width: 100%; }
.onboarding-page p, .onboarding-page h1, .onboarding-page h2, .onboarding-page h3 { margin: 0; }
.onboarding-page [hidden] { display: none !important; }

/* ---- layout ---- */
.onb { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; align-items: start; justify-items: center; gap: 2.25rem; padding: 2.5rem 1.5rem 4rem; background: #123a9f; position: relative; overflow: hidden; }
.onb .ilp__scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.onb .ilp__scene-sky, .onb .ilp__scene-hills, .onb .ilp__scene-clouds, .onb .ilp__scene-stars, .onb .ilp__scene-moon, .onb .ilp__scene-sun, .onb .ilp__scene-rays, .onb .ilp__scene-flight, .onb .ilp__scene-birds { transition: opacity .45s ease, filter .45s ease; }
.onb .ilp__scene-birds { transform-box: fill-box; transform-origin: center; animation: onb-birds 9s ease-in-out infinite alternate; }
.onb .ilp__bird-wing { transform-box: fill-box; transform-origin: 68% 65%; }
.onb .ilp__scene-birds > g:nth-child(1) .ilp__bird-wing { transform: rotate(17deg) scaleY(1.16); animation: onb-wing-up 2.8s ease-in-out infinite alternate; }.onb .ilp__scene-birds > g:nth-child(2) .ilp__bird-wing { transform: rotate(-10deg) scaleY(.8); animation: onb-wing-down 3.1s ease-in-out -.7s infinite alternate; }.onb .ilp__scene-birds > g:nth-child(3) .ilp__bird-wing { transform: rotate(9deg) scaleY(1.08); animation: onb-wing-up 2.6s ease-in-out -1.4s infinite alternate; }.onb .ilp__scene-birds > g:nth-child(4) .ilp__bird-wing { transform: rotate(-15deg) scaleY(.76); animation: onb-wing-down 3s ease-in-out -2s infinite alternate; }.onb .ilp__scene-birds > g:nth-child(5) .ilp__bird-wing { transform: rotate(13deg) scaleY(1.12); animation: onb-wing-up 2.7s ease-in-out -1s infinite alternate; }
.onb .ilp__scene-stars { animation: onb-scene-stars 3.8s ease-in-out infinite; }
@keyframes onb-birds { to { transform: translate(18px,-10px); } } @keyframes onb-scene-stars { 50% { opacity: .45; } } @keyframes onb-wing-up { to { transform: rotate(-7deg) scaleY(.84); } } @keyframes onb-wing-down { to { transform: rotate(14deg) scaleY(1.13); } }
[data-theme="dark"] .onb .ilp__scene-sky { filter: brightness(.38) saturate(.9); } [data-theme="dark"] .onb .ilp__scene-glow, [data-theme="dark"] .onb .ilp__scene-sun, [data-theme="dark"] .onb .ilp__scene-rays, [data-theme="dark"] .onb .ilp__scene-clouds { opacity: .12; } [data-theme="dark"] .onb .ilp__scene-hills { filter: brightness(.45) saturate(.85); } [data-theme="dark"] .onb .ilp__scene-birds { filter: brightness(.72) saturate(.8); }
[data-theme="dark"] .onb::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(135deg, rgba(3,8,31,.62), rgba(4,12,43,.48)); }
.onb::before { content: ''; position: absolute; inset: 0; z-index: 0; background: rgba(7, 16, 51, .16); pointer-events: none; }

.onb__topbar { width: min(100%, 82rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: relative; z-index: 1; }
.onb__topbar-actions { display: flex; align-items: center; gap: .8rem; }
.onb__theme { display: inline-grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; color: #fff; background: rgba(7,16,51,.24); backdrop-filter: blur(.5rem); cursor: pointer; }
.onb__theme svg { width: 1.15rem; height: 1.15rem; }.onb__theme .i-moon { display: none; }
[data-theme="dark"] .onb__theme .i-sun { display: none; } [data-theme="dark"] .onb__theme .i-moon { display: block; }
.onb__logo img { width: 11rem; height: auto; }
.onb__back { display: inline-flex; align-items: center; gap: .375rem; color: rgba(255,255,255,.82); font-size: .875rem; font-weight: 600; text-decoration: none; transition: color 160ms ease; }
.onb__back:hover { color: #fff; }
.onb__icon { display: inline-flex; width: 1.1rem; height: 1.1rem; color: currentColor; }
.onb__icon svg { width: 100%; height: 100%; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.onb__card { width: min(100%, 82rem); align-self: center; position: relative; z-index: 1; padding: 2.5rem; border: 1px solid rgba(255,255,255,.72); border-radius: 1.5rem; background: rgba(255,255,255,.94); box-shadow: 0 2rem 4rem rgba(3,9,34,.4); backdrop-filter: blur(.75rem); }
.onb__step { position: relative; }
.onb__card--welcome { width: min(100%, 42rem); }
.onb__step[data-onb-step="1"] { width: min(100%, 34rem); margin: 0 auto; }
.onb__step[data-onb-step="1"] .onb__lead { max-width: 32rem; }
.onb__step[data-onb-step="1"] .onb__button { width: auto; min-width: 10rem; padding-inline: 1.75rem; }

/* ---- progress / back ---- */
.onb__progress { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.onb__mark { display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; border-radius: 1rem; color: #ff5a16; background: #fff1e8; }
.onb__mark svg { width: 1.75rem; height: 1.75rem; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.onb__mark--big { width: 3.5rem; height: 3.5rem; border-radius: 1.125rem; margin-bottom: 1.25rem; }
.onb__mark svg[fill="currentColor"] { stroke: none; }

.onb__h1 { font-size: 2.125rem; font-weight: 800; line-height: 1.2; }
.onb__h2 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; color: #0b1548; }
.onb__lead { margin: .875rem 0 1.75rem; color: #4d5b85; font-size: 1rem; max-width: 38rem; }

.onb__form { display: grid; gap: .875rem; }
.onb__label { font-size: .875rem; font-weight: 600; }
.onb__control { display: grid; grid-template-columns: 1.5rem 1fr; align-items: center; min-height: 3.25rem; padding: 0 .875rem; border: 1px solid #cfd7ea; border-radius: .5rem; background: #fff; transition: border-color 160ms ease, box-shadow 160ms ease; }
.onb__control:focus-within { border-color: #086cff; box-shadow: 0 0 0 .1875rem rgba(8,108,255,.12); }
.onb__control .onb__icon { width: 1.25rem; height: 1.25rem; color: #7280a6; }
.onb__input { width: 100%; min-width: 0; border: 0; outline: 0; color: #0b1548; background: transparent; font-size: 1.05rem; }
.onb__input::placeholder { color: #7280a6; }
.onb__error { padding: .75rem .875rem; border: 1px solid #f3c3c5; border-radius: .5rem; color: #c6292d; background: #fdf0f0; font-size: .8125rem; }

.onb__button { display: inline-flex; width: 100%; min-height: 3.25rem; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .5rem; color: #fff; background: linear-gradient(90deg, #ff5b16, #ff4a0a); font-size: 1rem; font-weight: 700; text-decoration: none; box-shadow: 0 .75rem 1.5rem rgba(255,82,13,.24); transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
.onb__button:hover { transform: translateY(-.0625rem); box-shadow: 0 .875rem 1.75rem rgba(255,82,13,.3); }
.onb__button:disabled { opacity: .6; cursor: progress; transform: none; }
.onb__button.is-loading::after { content: '…'; }
.onb__button--sm { width: auto; min-height: 2.5rem; padding: 0 1.25rem; font-size: .875rem; }
.onb__button--ghost { color: #ff5a16; border-color: #ff5a16; background: #fff; box-shadow: none; }
.onb__button--ghost:hover { background: #fff1e8; box-shadow: none; }
.onb__hint { color: #7280a6; font-size: .8125rem; }

/* ---- step 2 ---- */
.onb__step2-head { text-align: center; margin-bottom: 2rem; }
.onb__meter { height: .5rem; overflow: hidden; border-radius: 999px; background: #eef1f8; margin-bottom: .5rem; }
.onb__meter-bar { display: block; width: 4%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4d8dff, #ff5a16); transition: width 800ms cubic-bezier(.22,.61,.36,1); }
.onb__status { color: #4d5b85; font-size: .875rem; margin-bottom: 1.75rem; }

/* ---- merged work screen (creation + ready, side by side) ---- */
.onb__work { display: grid; grid-template-columns: minmax(13rem, 16rem) 1fr; gap: 2rem; align-items: start; }
.onb__work-side { display: grid; gap: 1.5rem; align-content: start; }
.onb__work-head { display: grid; gap: .875rem; }
.onb__work-head .onb__lead { margin: 0; }
.onb__site { display: inline-flex; align-items: center; gap: .5rem; justify-self: start; padding: .375rem .8rem; border-radius: 999px; background: #eaf1ff; color: #0b1548; font-size: .875rem; }
.onb__site strong { font-weight: 700; }
.onb__site-icon { display: inline-flex; width: 1rem; height: 1rem; color: #086cff; }
.onb__site-icon svg { width: 100%; height: 100%; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.onb__work-main { display: grid; gap: 1rem; min-width: 0; align-content: start; }
.onb__work-label { font-size: .8125rem; font-weight: 700; letter-spacing: .02em; color: #4d5b85; }
.onb__brand, .onb__actions { align-self: start; }

/* back button */
.onb__backstep { display: inline-flex; align-items: center; gap: .375rem; margin-left: 0; padding: .25rem .5rem .25rem 0; border: 0; color: #086cff; background: transparent; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.onb__backstep:hover { color: #004ed8; }
.onb__backstep::before { content: '← '; }

/* pulsing grey placeholders while templates are being built */
.onb__skeletons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.onb__skel { display: grid; gap: .875rem; padding: 1.125rem; border: 1px solid #eef1f8; border-radius: 1rem; background: #fff; min-width: 0; }
.onb__skel-hero { position: relative; aspect-ratio: 600 / 640; border-radius: .75rem; background: #eef1f8; overflow: hidden; }
.onb__skel-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,.75) 50%, transparent 58%); background-size: 200% 100%; animation: onb-shimmer 1.6s infinite linear; }
.onb__skel-hero::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.32); animation: onb-pulse 1.8s ease-in-out infinite; }
.onb__skel-line { height: .75rem; border-radius: 999px; background: #eef1f8; animation: onb-pulse 1.8s ease-in-out infinite; }
.onb__skel-line--t { width: 70%; }
.onb__skel-line--s { width: 48%; height: .625rem; }
.onb__skel-cta { height: 2.25rem; width: 42%; border-radius: .5rem; background: #eef1f8; animation: onb-pulse 1.8s ease-in-out infinite; }
@keyframes onb-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes onb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.onb__types { display: grid; gap: .75rem; padding: 0; list-style: none; }
.onb__type { display: grid; grid-template-columns: 3rem 1fr 1.75rem; align-items: center; gap: 1rem; padding: 1rem 1.125rem; border: 1px solid #e3e8f3; border-radius: .875rem; background: #fff; opacity: 0; transform: translateY(.75rem) scale(.97); transition: opacity 420ms ease, transform 420ms ease, border-color 160ms ease; }
.onb__type.is-in { opacity: 1; transform: translateY(0) scale(1); }
.onb__type.is-done { border-color: #bfe4c5; }
.onb__type-icon { display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; border-radius: .875rem; color: var(--type-tone, #ff5a16); background: color-mix(in srgb, var(--type-tone, #ff5a16) 14%, #fff); }
.onb__type-icon svg { width: 1.5rem; height: 1.5rem; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.onb__type-body { display: grid; gap: .25rem; }
.onb__type-title { font-weight: 700; color: #0b1548; font-size: .975rem; }
.onb__type-sub { color: #7280a6; font-size: .8125rem; }
.onb__type-check { display: inline-flex; width: 1.75rem; height: 1.75rem; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: #cfd7ea; transition: background 200ms ease; }
.onb__spinner { width: 1.15rem; height: 1.15rem; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-right-color: #ffb08a; border-radius: 50%; animation: onb-spin .75s linear infinite; box-shadow: 0 0 0 2px rgba(255,90,22,.12); }
@keyframes onb-spin { to { transform: rotate(360deg); } }
.onb__type.is-done .onb__type-check { background: #1f7a37; }
.onb__type.is-done .onb__spinner { display: none; }
.onb__type-check svg { display: none; width: 1rem; height: 1rem; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; }
.onb__type.is-done .onb__type-check svg { display: block; }
.onb__site { display: none; }
.onb__ready-heading { margin: 0 0 1.25rem; color: #0b1548; font-size: 1.35rem; line-height: 1.3; }
.onb__ready-heading strong { color: #ff5a16; }

/* ---- step 3 ---- */
.onb__step3-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.onb__brand { padding: 1.25rem 1.25rem 1.25rem 1.125rem; border: 1px solid #e3e8f3; border-radius: .875rem; background: #f8faff; margin-bottom: 1.75rem; }
.onb__brand-title { font-size: .8125rem; font-weight: 700; letter-spacing: .02em; color: #4d5b85; margin-bottom: 1rem; }
.onb__brand-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.onb__swatch, .onb__brand-name, .onb__font { display: inline-flex; align-items: center; gap: .5rem; }
.onb__swatch i { width: 1.5rem; height: 1.5rem; border: 1px solid rgba(11,21,72,.12); border-radius: .5rem; }
.onb__swatch em, .onb__font em { color: #7280a6; font-size: .8125rem; font-style: normal; }
.onb__swatch code, .onb__font code, .onb__brand-name { color: #0b1548; font-size: .8125rem; font-weight: 600; }
.onb__brand-name { font-weight: 800; font-size: 1rem; }

.onb__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.onb__tpl { display: grid; gap: 1rem; padding: 1.125rem; border: 1px solid #e3e8f3; border-radius: 1rem; background: #fff; min-width: 0; }
.onb__preview { position: relative; width: 100%; aspect-ratio: 600 / 640; overflow: hidden; border-radius: .75rem; background: #fff; border: 1px solid #eef1f8; }
.onb__preview iframe { position: absolute; top: 0; left: 0; width: 600px; height: 760px; border: 0; transform-origin: top left; }
.onb__preview-tag { position: absolute; left: .5rem; bottom: .5rem; z-index: 1; padding: .25rem .625rem; border-radius: 999px; color: #fff; background: rgba(11,21,72,.72); font-size: .75rem; font-weight: 600; max-width: calc(100% - 1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onb__tpl-head { display: flex; align-items: center; gap: .75rem; }
.onb__tpl-icon { display: inline-flex; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: .75rem; color: var(--type-tone, #ff5a16); background: color-mix(in srgb, var(--type-tone, #ff5a16) 14%, #fff); }
.onb__tpl-icon svg { width: 1.25rem; height: 1.25rem; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.onb__tpl-title { font-weight: 700; color: #0b1548; font-size: 1rem; }
.onb__tpl-sub { color: #7280a6; font-size: .8125rem; }
.onb__tpl.is-clickable { cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.onb__tpl.is-clickable:hover, .onb__tpl.is-clickable:focus-visible { transform: translateY(-.125rem); box-shadow: 0 1rem 2rem rgba(18,31,74,.14); border-color: color-mix(in srgb, var(--type-tone, #ff5a16) 45%, #e3e8f3); }
.onb__tpl-cta { display: inline-flex; align-items: center; justify-self: start; gap: .375rem; color: var(--type-tone, #ff5a16); font-size: .875rem; font-weight: 700; }

.onb__actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.onb__actions .onb__button { width: auto; padding: 0 1.5rem; }
.onb__button--arrow { gap: .5rem; }
.onb__arrow { display: inline-flex; width: 1.125rem; height: 1.125rem; }
.onb__arrow svg { width: 100%; height: 100%; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }

.onb__warning { display: flex; align-items: flex-start; gap: .625rem; padding: .875rem 1rem; border: 1px solid #f3d39a; border-radius: .875rem; color: #8a5a06; background: #fff6e6; font-size: .875rem; margin-bottom: 1.5rem; }
.onb__warning-icon { display: inline-flex; width: 1.25rem; height: 1.25rem; flex: 0 0 auto; color: #d98217; }
.onb__warning-icon svg { width: 100%; height: 100%; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

/* ---- step 4: editor / send test ---- */
.onb__editor { display: grid; grid-template-columns: minmax(14rem, 18rem) 1fr; gap: 2rem; align-items: start; }
.onb__editor-side .onb__h2 { margin-top: 1rem; }
.onb__editor-side .onb__lead { margin-bottom: 1.25rem; }
.onb__chips { display: grid; gap: .5rem; }
.onb__chip { display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: .625rem; padding: .625rem .75rem; border: 1px solid #e3e8f3; border-radius: .75rem; color: #0b1548; background: #fff; text-align: left; font-size: .875rem; font-weight: 600; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.onb__chip:hover { transform: translateY(-.0625rem); border-color: #cfd7ea; }
.onb__chip.is-active { border-color: var(--type-tone, #ff5a16); background: color-mix(in srgb, var(--type-tone, #ff5a16) 8%, #fff); }
.onb__chip-icon { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: .625rem; color: var(--type-tone, #ff5a16); background: color-mix(in srgb, var(--type-tone, #ff5a16) 14%, #fff); }
.onb__chip-icon svg { width: 1.125rem; height: 1.125rem; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }

.onb__editor-main { display: grid; gap: 1.25rem; }
.onb__editor-preview { position: relative; width: 100%; aspect-ratio: 600 / 780; overflow: hidden; border: 1px solid #eef1f8; border-radius: 1rem; background: #fff; }
.onb__editor-preview iframe { position: absolute; top: 0; left: 0; width: 600px; height: 780px; border: 0; transform-origin: top left; }
.onb__send { display: grid; gap: .75rem; }
.onb__send .onb__control { grid-template-columns: 1.5rem 1fr; }
.onb__editor-actions { display: flex; gap: .75rem; }
.onb__editor-actions .onb__button { width: auto; }

/* ---- responsive ---- */
[data-theme="dark"] .onboarding-page { color: #eef2ff; background: #071033; }
[data-theme="dark"] .onb__card { background: rgba(10,17,54,.94); border-color: rgba(255,255,255,.16); box-shadow: 0 2rem 4rem rgba(0,0,0,.42); }
[data-theme="dark"] .onb__h1, [data-theme="dark"] .onb__h2, [data-theme="dark"] .onb__label, [data-theme="dark"] .onb__type-title, [data-theme="dark"] .onb__ready-heading, [data-theme="dark"] .onb__tpl-title, [data-theme="dark"] .onb__brand-name, [data-theme="dark"] .onb__swatch code, [data-theme="dark"] .onb__font code { color: #fff; }
[data-theme="dark"] .onb__lead, [data-theme="dark"] .onb__hint, [data-theme="dark"] .onb__type-sub, [data-theme="dark"] .onb__tpl-sub, [data-theme="dark"] .onb__brand-title, [data-theme="dark"] .onb__swatch em, [data-theme="dark"] .onb__font em { color: #b9c3df; }
[data-theme="dark"] .onb__control, [data-theme="dark"] .onb__type, [data-theme="dark"] .onb__tpl, [data-theme="dark"] .onb__chip { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.16); color: #eef2ff; }
[data-theme="dark"] .onb__input { color: #fff; }
[data-theme="dark"] .onb__control:focus-within { background: rgba(255,255,255,.09); }
[data-theme="dark"] .onb__brand { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .onb__skel, [data-theme="dark"] .onb__preview, [data-theme="dark"] .onb__editor-preview { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .onb__skel-hero, [data-theme="dark"] .onb__skel-line, [data-theme="dark"] .onb__skel-cta { background: rgba(255,255,255,.12); }
[data-theme="dark"] .onb__button--ghost { background: transparent; }

@media (max-width: 40rem) {
  .onb { padding: 1.5rem 1rem 3rem; gap: 1.5rem; }
  .onb__logo img { width: 9rem; }
  .onb__card { padding: 1.5rem; border-radius: 1.125rem; }
  .onb__h1 { font-size: 1.75rem; }
  .onb__h2 { font-size: 1.5rem; }
  .onb__grid { grid-template-columns: 1fr; }
  .onb__step3-head { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .onb__work { grid-template-columns: 1fr; gap: 1.5rem; }
  .onb__editor { grid-template-columns: 1fr; gap: 1.25rem; }
  .onb__editor-preview { aspect-ratio: 600 / 640; }
}
