/* Signup funnel. Revolut-grade restraint: near-black, one soft glow, one question per screen,
   one pinned action. Mobile first. */
body.ap {
  --bg: #050608;
  --field: rgba(255, 255, 255, 0.07);
  --field-hover: rgba(255, 255, 255, 0.1);
  --t2: rgba(255, 255, 255, 0.7);
  --t3: rgba(255, 255, 255, 0.45);
  --hair: rgba(255, 255, 255, 0.08);
  background: var(--bg); color: #fff; min-height: 100vh; min-height: 100dvh;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
}
.ap__shell { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; overflow-x: hidden; }
/* One large soft glow, like Revolut, warmed with a hint of shift orange */
.ap__shell::before { content: ''; position: fixed; left: 50%; top: -55vh; width: 170vw; height: 110vh; transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(162,176,205,0.26), rgba(162,176,205,0.06) 55%, transparent 72%); }
.ap__shell::after { content: ''; position: fixed; right: -30vw; bottom: -40vh; width: 90vw; height: 80vh; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(247,80,15,0.14), transparent); filter: blur(20px); }

.ap__top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 56px; padding: 0 12px; padding-top: env(safe-area-inset-top); max-width: 600px; width: 100%; margin: 0 auto; }
.ap__back { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: background 0.3s var(--ease-rev), opacity 0.3s; }
.ap__back:hover { background: var(--field); }
.ap__back[disabled] { opacity: 0; pointer-events: none; }
.ap__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap__logo { justify-self: center; opacity: 0.9; }
.ap__logo svg { height: 16px; }
.ap__count { display: none; }
.ap__bar { height: 2px; background: var(--hair); max-width: 576px; width: calc(100% - 32px); margin: 0 auto; border-radius: 2px; overflow: hidden; }
.ap__bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 2px; transition: width 0.6s var(--ease-rev); }

.ap__main { flex: 1; display: flex; width: 100%; max-width: 576px; margin: 0 auto; padding: 0 16px; }
#form { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.screen { flex: 1; padding: 28px 0 20px; }
.screen.enter { animation: enter 0.42s var(--ease-rev) both; }
.screen.enter-back { animation: enterBack 0.42s var(--ease-rev) both; }
@keyframes enter { from { opacity: 0; transform: translateX(20px); } }
@keyframes enterBack { from { opacity: 0; transform: translateX(-20px); } }

.q-title { margin: 0; font-family: var(--display); font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.q-title:focus { outline: none; }
.q-sub { margin: 8px 0 24px; font-size: 15px; line-height: 1.45; color: var(--t2); text-wrap: pretty; }
@media (min-width: 641px) { .q-title { font-size: 32px; } .screen { padding-top: 48px; } }

/* Fields: filled, floating label, 12px radius */
.field { position: relative; display: block; margin-bottom: 10px; }
.field input, .field textarea {
  width: 100%; border: 0; outline: 0; appearance: none; -webkit-appearance: none;
  background: var(--field); color: #fff; font: inherit; font-size: 17px; /* >=16 avoids iOS zoom */
  border-radius: 12px; padding: 25px 16px 9px; min-height: 58px;
  box-shadow: inset 0 0 0 1px transparent; transition: background 0.3s var(--ease-rev), box-shadow 0.3s var(--ease-rev);
}
.field textarea { min-height: 128px; resize: none; line-height: 1.45; padding-top: 28px; }
.field input:hover, .field textarea:hover { background: var(--field-hover); }
.field input:focus, .field textarea:focus { background: var(--field-hover); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55); }
.field > span { position: absolute; left: 16px; top: 18px; font-size: 17px; color: var(--t3); pointer-events: none; transform-origin: 0 0; transition: transform 0.3s var(--ease-rev), color 0.3s; }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span { transform: translateY(-9px) scale(0.76); color: var(--t2); }
.field.is-error input, .field.is-error textarea { box-shadow: inset 0 0 0 1px #ff6b61; }
.field__err { display: block; margin: 6px 4px 0; font-size: 13px; font-style: normal; color: #ff8a80; }
.field__err:empty { display: none; }
.field__help { display: block; margin: 4px 4px 0; font-size: 13px; color: var(--t3); }
.field__suggest { display: inline-block; margin: 0 4px 12px; font-size: 14px; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.counter { position: absolute; right: 14px; top: 10px; font-size: 12px; font-style: normal; color: var(--t3); }

/* Country picker (custom, searchable, round flags) */
.picker { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 16px; min-height: 58px; border-radius: 12px; background: var(--field); text-align: left; transition: background 0.3s var(--ease-rev); }
.picker:hover { background: var(--field-hover); }
.picker__txt { flex: 1; display: flex; flex-direction: column; }
.picker__txt small { font-size: 13px; color: var(--t2); line-height: 1.2; }
.picker__txt b { font-weight: 400; font-size: 17px; line-height: 1.3; }
.picker__chev { width: 10px; height: 10px; border-right: 1.75px solid var(--t2); border-bottom: 1.75px solid var(--t2); transform: translateY(-3px) rotate(45deg); transition: transform 0.3s var(--ease-rev); }
.picker[aria-expanded="true"] .picker__chev { transform: translateY(2px) rotate(-135deg); }
.flag { flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: #333 center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.flag--globe { display: grid; place-items: center; background: rgba(255,255,255,0.1); }
.flag--globe svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.6; }
.plist { margin-top: 8px; border-radius: 14px; background: #1b1d22; overflow: hidden; box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8), inset 0 0 0 1px var(--hair); animation: drop 0.28s var(--ease-rev); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.plist__search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--hair); }
.plist__search input { flex: 1; height: 52px; border: 0; outline: 0; background: none; color: #fff; font: inherit; font-size: 17px; }
.plist__search input::placeholder { color: var(--t3); }
.plist__search svg { width: 18px; height: 18px; fill: none; stroke: var(--t3); stroke-width: 2; }
.plist ul { list-style: none; margin: 0; padding: 4px 0; max-height: min(320px, 42vh); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.plist li button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 16px; text-align: left; transition: background 0.2s; }
.plist li button:hover, .plist li button[aria-selected="true"] { background: rgba(255,255,255,0.07); }

/* Option rows (single select, auto-advance) */
.opts { display: flex; flex-direction: column; border-radius: 16px; background: var(--field); overflow: hidden; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; min-height: 68px; position: relative; transition: background 0.25s var(--ease-rev); }
.opt + .opt::before { content: ''; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--hair); }
.opt:hover { background: rgba(255,255,255,0.04); }
.opt:active { background: rgba(255,255,255,0.08); }
.opt__t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opt__t b { font-size: 17px; font-weight: 500; }
.opt__t small { font-size: 14px; color: var(--t2); line-height: 1.35; }
.radio { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.75px rgba(255,255,255,0.35); transition: box-shadow 0.25s var(--ease-rev); }
.opt[aria-checked="true"] .radio, .chip-btn[aria-checked="true"] .radio { box-shadow: inset 0 0 0 7px #fff; }

/* Chips + segmented numbers */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip-btn { min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--field); font-size: 15px; transition: background 0.25s var(--ease-rev), color 0.25s; }
.chip-btn:hover { background: var(--field-hover); }
.chip-btn[aria-checked="true"], .chip-btn[aria-pressed="true"] { background: #fff; color: #050608; }
.seg-n { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seg-n .chip-btn { height: 56px; font-size: 18px; font-family: var(--display); font-weight: 500; padding: 0; border-radius: 14px; }

/* Tools grid */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 14px; background: var(--field); font-size: 15px; text-align: left; transition: background 0.25s var(--ease-rev), color 0.25s; }
.tool svg { width: 18px; height: 18px; flex: none; fill: var(--t2); transition: fill 0.25s; }
.tool[aria-pressed="true"] { background: #fff; color: #050608; }
.tool[aria-pressed="true"] svg { fill: #050608; }
.tool--none { grid-column: 1 / -1; justify-content: center; color: var(--t2); }
@media (max-width: 480px) { .tools { grid-template-columns: 1fr 1fr; } }

/* Live estimate */
.est { position: relative; margin-top: 16px; padding: 20px; border-radius: 18px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 140% at 100% 0%, rgba(247,80,15,0.4), transparent 55%), linear-gradient(160deg, #1c1714, #0d0d0f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 0 0 1px var(--hair); display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; animation: drop 0.35s var(--ease-rev); }
.est small { display: block; font-size: 13px; color: var(--t2); margin-bottom: 4px; }
.est b { font-family: var(--display); font-weight: 500; font-size: 34px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.est__note { margin: 10px 2px 0; font-size: 13px; color: var(--t3); }

/* Pinned action (lifts above the mobile keyboard via --kb) */
.ap__foot { position: sticky; bottom: 0; z-index: 5; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: linear-gradient(0deg, var(--bg) 72%, rgba(5,6,8,0)); transform: translateY(calc(var(--kb, 0px) * -1)); transition: transform 0.25s var(--ease-rev); }
.ap__next { width: 100%; max-width: 360px; height: 52px; font-size: 16px; font-weight: 500; box-shadow: 0 3px 10px rgba(255,255,255,0.3); }
.ap__next[disabled] { opacity: 0.3; box-shadow: none; cursor: not-allowed; }
.ap__next.is-loading { color: transparent; position: relative; pointer-events: none; }
.ap__next.is-loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(5,6,8,0.15); border-top-color: #050608; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ap__legal { margin: 0; font-size: 12px; line-height: 1.5; color: var(--t2); text-align: center; max-width: 360px; }
.ap__legal a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.ap__legal p { margin: 0; }
.ap__legal p + p { margin-top: 6px; }
.ap__hint { margin: 0; font-size: 13px; color: var(--t3); min-height: 18px; text-align: center; }
.ap__foot.is-hidden { display: none; }

/* Interstitial + success */
.center { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: 32px; }
.badge { position: relative; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 26px; background: linear-gradient(180deg, #ff6a2b, var(--orange)); box-shadow: 0 0 0 10px rgba(247,80,15,0.12), 0 20px 50px -10px rgba(247,80,15,0.7); animation: pop 0.6s var(--ease-rev) both; }
.badge--neutral { background: rgba(255,255,255,0.08); box-shadow: 0 0 0 10px rgba(255,255,255,0.03); }
.badge svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.5s 0.25s var(--ease-rev) forwards; }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.summary { width: 100%; margin: 26px 0 0; padding: 4px 16px; border-radius: 16px; background: var(--field); text-align: left; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; font-size: 15px; }
.summary div + div { border-top: 1px solid var(--hair); }
.summary dt { color: var(--t2); }
.summary dd { margin: 0; text-align: right; }
.timeline { list-style: none; width: 100%; margin: 28px 0 0; padding: 0; text-align: left; counter-reset: t; }
.timeline li { position: relative; padding: 0 0 22px 40px; font-size: 14px; color: var(--t2); }
.timeline li b { display: block; color: #fff; font-weight: 500; font-size: 16px; margin-bottom: 2px; }
.timeline li::before { counter-increment: t; content: counter(t); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255,255,255,0.1); color: #fff; }
.timeline li:first-child::before { background: #fff; color: #050608; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1px; background: var(--hair); }
.link-btn { margin-top: 18px; min-height: 44px; font-size: 15px; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.preview-note { margin-top: 20px; font-size: 12px; color: var(--t3); }

/* The dashboard block on the last screen: shown once the dashboard sent its sign-in link. */
.dash { width: 100%; margin: 26px 0 4px; padding: 28px 22px 22px; border-radius: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; background: linear-gradient(180deg, rgba(247,80,15,0.16), rgba(247,80,15,0.04)); box-shadow: inset 0 0 0 1px rgba(247,80,15,0.35); }
.dash__ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; background: rgba(255,255,255,0.08); }
.dash__ic svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash__t { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.dash__s { margin: 10px 0 20px; font-size: 16px; line-height: 1.45; color: var(--t2); text-wrap: pretty; }
.dash__s b { color: #fff; font-weight: 600; word-break: break-all; }
.dash__go { width: 100%; max-width: 360px; height: 52px; display: inline-flex; align-items: center; justify-content: center; }
.dash__n { margin-top: 14px; font-size: 13px; line-height: 1.4; color: var(--t2); }
