/* Onboarding, one question per screen (steps.php, assets/js/app-onboarding.js). A phone shows it full screen with
   the button fixed above the keyboard and the safe area; a wider screen as a centred card under the site header.
   Loaded after app.css. Colours from the app tokens only; the water gradient only on each screen's primary button. */
.ob {--ob-pad:24px; position:relative; box-sizing:border-box; color:var(--app-text); font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;}
.ob *,.ob *::before,.ob *::after {box-sizing:border-box;}
.ob-sr {position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}

/* Top: back arrow, progress, "3 / 8" */
.ob-top {display:flex; align-items:center; gap:12px; min-height:56px; padding:6px 20px 6px 10px;}
.ob-back {display:grid; place-items:center; flex:none; width:44px; height:44px; margin:0; padding:0; border:0; border-radius:50%; background:transparent; color:var(--app-text); cursor:pointer; -webkit-tap-highlight-color:transparent;}
.ob-back[hidden] {display:grid; visibility:hidden;}
.ob-back:active {background:#ffffff14;}
.ob-progress {flex:1; height:6px; border-radius:3px; background:var(--app-card); overflow:hidden;}
.ob-progress > span {display:block; width:0; height:100%; border-radius:3px; background:var(--app-water); transition:width .28s var(--app-ease);}
.ob-count {flex:none; min-width:34px; color:var(--app-mut); font-size:13px; font-weight:600; text-align:right; font-variant-numeric:tabular-nums;}

/* A screen */
.ob-screen:not([hidden]) {display:block; padding:18px var(--ob-pad) 0;}
.ob .ob-title {margin:8px 0 0; color:var(--app-text); font:800 clamp(26px,8vw,30px)/1.1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; letter-spacing:-.025em; text-wrap:balance; outline:none;}
.ob .ob-title:focus,.ob .ob-title:focus-visible {outline:none; box-shadow:none;}
.ob .ob-hint {margin:10px 0 0; color:var(--app-mut); font-size:16px; line-height:1.45;}
.ob-field {display:block; min-width:0; margin:26px 0 0; padding:0; border:0;}
.ob .ob-label {display:block; float:none; width:100%; margin:0 0 10px; padding:0; color:var(--app-text); font-size:14px; font-weight:700; line-height:1.3;}
.ob-label small {margin-left:6px; color:var(--app-mut); font-weight:500;}
.ob .ob-screen input.ob-input,.ob .ob-screen select.ob-input,.ob .ob-screen textarea.ob-input {display:block; box-sizing:border-box; width:100%; max-width:100%; height:auto; min-height:56px; margin:0; padding:14px 18px; border:1px solid var(--app-line); border-radius:16px; background:var(--app-card); color:var(--app-text); font:500 17px/1.35 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; box-shadow:none; outline:none; transition:border-color .18s, box-shadow .18s;}
.ob .ob-screen .ob-input:focus {border-color:var(--app-teal); box-shadow:0 0 0 3px var(--app-teal-soft);}
.ob .ob-screen input.ob-input-big {min-height:64px; font-size:22px; font-weight:700;}
.ob .ob-screen input.ob-input[readonly] {color:var(--app-mut);}
.ob .ob-screen textarea.ob-textarea {min-height:128px; resize:vertical;}
.ob .ob-screen select.ob-input {-webkit-appearance:none; appearance:none; padding-right:44px; background-image:linear-gradient(45deg,transparent 50%,var(--app-mut) 50%),linear-gradient(135deg,var(--app-mut) 50%,transparent 50%); background-position:calc(100% - 24px) 50%,calc(100% - 18px) 50%; background-size:6px 6px; background-repeat:no-repeat;}
.ob .ob-screen input.ob-code {font-size:24px; font-weight:700; letter-spacing:.4em; text-align:center; font-variant-numeric:tabular-nums;}
.ob .ob-screen ::placeholder {color:#9aa7b8b3;}

/* Birthday: three pickers in a row (member-ui.js turns the date field into day / month / year). */
.ob-birthday .ui-birthday-parts {display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.25fr) minmax(0,1.1fr); gap:10px;}
.ob-birthday .ui-birthday-parts label {display:block; margin:0 0 8px; color:var(--app-mut); font-size:13px; font-weight:600;}
.ob .ob-birthday .ui-birthday-parts select {display:block; width:100%; height:60px; margin:0; padding:0 30px 0 14px; border:1px solid var(--app-line); border-radius:16px; background:var(--app-card); background-image:linear-gradient(45deg,transparent 50%,var(--app-mut) 50%),linear-gradient(135deg,var(--app-mut) 50%,transparent 50%); background-position:calc(100% - 20px) 50%,calc(100% - 14px) 50%; background-size:6px 6px; background-repeat:no-repeat; color:var(--app-text); font:700 18px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; -webkit-appearance:none; appearance:none; outline:none;}
.ob .ob-birthday .ui-birthday-parts select:focus {border-color:var(--app-teal); box-shadow:0 0 0 3px var(--app-teal-soft);}

/* Choices: big cards in a row (gender), chips (sexuality, interests), a list (looking for). The radio itself stays
   focusable but invisible; Materialize's own radio and checkbox drawings are switched off. */
.ob-choice {position:relative; display:block; margin:0; cursor:pointer; -webkit-tap-highlight-color:transparent;}
.ob .ob-choice > input {position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; pointer-events:none;}
.ob .ob-choice > input + span {position:relative; display:flex; align-items:center; justify-content:center; height:auto; min-height:56px; margin:0; padding:12px 14px; border:1.5px solid var(--app-line); border-radius:16px; background:var(--app-card); color:var(--app-text); font-size:16px; font-weight:600; line-height:1.25; text-align:center; transition:border-color .18s, background-color .18s, transform .18s var(--app-ease);}
.ob .ob-choice > input + span::before,.ob .ob-choice > input + span::after {content:none !important; display:none !important;}
.ob .ob-choice > input:checked + span {border-color:var(--app-teal); background:var(--app-teal-soft); color:var(--app-text);}
.ob .ob-choice > input:focus-visible + span {outline:2px solid var(--app-teal); outline-offset:2px;}
.ob .ob-choice:active > input + span {transform:scale(.98);}
.ob .ob-choice > input:disabled + span {opacity:.45; cursor:default;}
.ob-choices-row {display:grid; grid-template-columns:repeat(auto-fit,minmax(88px,1fr)); gap:10px;}
.ob-choices-row > .ob-label,.ob-choices-wrap > .ob-label,.ob-choices-list > .ob-label {grid-column:1/-1;}
.ob-choices-wrap,.ob-chips {display:flex; flex-wrap:wrap; gap:8px;}
.ob-choices-wrap > .ob-label {flex-basis:100%;}
.ob-chip[hidden] {display:none;}
.ob .ob-skip.ob-more {margin-top:8px; color:var(--app-teal);}
.ob .ob-chip > input + span {min-height:44px; padding:9px 16px; border-radius:22px; font-size:15px;}
.ob-choices-list {display:grid; gap:10px;}
.ob .ob-row > input + span {justify-content:space-between; gap:12px; min-height:56px; padding:14px 18px; text-align:left;}
.ob .ob-row > input + span::after {content:"" !important; display:block !important; position:static; flex:none; width:22px; height:22px; margin:0; border:2px solid var(--app-line); border-radius:50%; background:transparent; transform:none;}
.ob .ob-row > input:checked + span::after {border:7px solid var(--app-teal); background:var(--app-night);}

/* Photos: the first slot is the main photo, twice the size. */
.ob-photos {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:26px;}
.ob .ob-slot {position:relative; display:grid; place-items:center; aspect-ratio:1; width:100%; min-height:0; margin:0; padding:0; overflow:hidden; border:2px dashed var(--app-line); border-radius:16px; background:transparent; color:var(--app-teal); font:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:transform .18s var(--app-ease);}
.ob .ob-slot:first-child {grid-column:span 2; grid-row:span 2; border-radius:20px;}
.ob .ob-slot:active {transform:scale(.97);}
.ob .ob-slot:focus-visible {outline:2px solid var(--app-teal); outline-offset:2px;}
.ob .ob-slot.is-done,.ob .ob-slot.is-uploading {border:0; background:var(--app-card);}
.ob .ob-slot.is-error {border-color:#ff6b5e99; background:#ff6b5e14;}
.ob-slot.is-done .ob-slot-add,.ob-slot.is-uploading .ob-slot-add,.ob-slot.is-error .ob-slot-add {display:none;}
.ob-slot-add {display:grid; place-items:center;}
.ob-slot-img {position:absolute; inset:0; width:100%; height:100%; object-fit:cover;}
.ob-slot.is-uploading .ob-slot-img {opacity:.5;}
.ob-slot-main {position:absolute; left:10px; bottom:10px; padding:4px 10px; border-radius:10px; background:#0f141ca6; color:#fff; font-size:12px; font-weight:700; line-height:1.3;}
.ob-slot-progress {position:absolute; left:10px; right:10px; bottom:10px; height:6px; border-radius:3px; background:#eef2f640; overflow:hidden;}
.ob-slot-progress > span {display:block; width:0; height:100%; border-radius:3px; background:var(--app-water); transition:width .2s linear;}
.ob-slot-error {position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:6px; color:var(--app-coral); text-align:center;}
.ob-slot-error > span {display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; font-size:11px; font-weight:600; line-height:1.25;}
.ob-slot:first-child .ob-slot-error > span {-webkit-line-clamp:6; font-size:13px;}
.ob-slot-progress[hidden],.ob-slot-error[hidden],.ob-slot-main[hidden],.ob-slot-img[hidden] {display:none;}
.ob-file {position:absolute; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none;}
.ob .ob-rules {display:flex; gap:10px; margin:22px 0 0; color:var(--app-mut); font-size:13.5px; line-height:1.4;}
.ob-rules svg {flex:none; margin-top:1px; color:var(--app-teal);}

/* Errors, the button bar, the skip link */
.ob .ob-error {display:flex; align-items:flex-start; gap:8px; margin:16px 0 0; color:var(--app-coral); font-size:14px; line-height:1.4;}
.ob .ob-error::before {content:"!"; flex:none; display:grid; place-items:center; width:18px; height:18px; margin-top:1px; border-radius:50%; background:var(--app-coral); color:var(--app-night); font:800 12px/1 system-ui,sans-serif;}
.ob .ob-error[hidden] {display:none;}
.ob-bar {display:flex; flex-direction:column; gap:4px; margin-top:28px;}
.ob .ob-bar .app-btn {min-height:56px; border-radius:28px; font-size:17px;}
.ob .ob-skip {display:block; width:100%; min-height:44px; margin:0; padding:0; border:0; background:transparent; color:var(--app-mut); font:600 15px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; cursor:pointer;}

/* Permission and final screens: illustration, title, text */
.ob-center:not([hidden]) {text-align:center;}
.ob-center .ob-art {display:block; width:min(72%,280px); height:auto; aspect-ratio:1; margin:8px auto 4px; border-radius:28px; object-fit:cover; -webkit-mask-image:radial-gradient(closest-side,#000 82%,transparent); mask-image:radial-gradient(closest-side,#000 82%,transparent);}
.ob-center .ob-hint {max-width:34ch; margin-left:auto; margin-right:auto;}

/* The selfie and the e-mail code reuse their existing parts. */
.ob .ui-selfie {margin-top:22px;}
.ob .ui-selfie .ui-account-actions {display:flex; flex-direction:column; gap:10px;}
.ob .otp_head {display:grid; gap:12px;}
.ob .enter_otp_email .ob-hint {margin:0 0 14px;}

/* The way out */
.ob .ui-onboarding-delete {max-width:560px; margin:36px var(--ob-pad) 0; text-align:center;}
.ob .ui-onboarding-delete > summary {display:inline-flex; align-items:center; min-height:44px; color:var(--app-mut); font-size:14px; text-decoration:underline; text-underline-offset:3px; list-style:none; cursor:pointer;}
.ob .ui-onboarding-delete > summary::-webkit-details-marker {display:none;}
.ob .ui-onboarding-delete[open] > summary {margin-bottom:8px;}
.ob .ui-onboarding-delete form {text-align:left;}

.ob .ui-onboarding-delete[hidden] {display:none;}
/* The content slides in, never the button bar: a transformed screen would carry the fixed bar along with it. */
.ob-enter > :not(.ob-bar) {animation:ob-in .24s var(--app-ease) backwards;}
.ob-enter-back > :not(.ob-bar) {animation:ob-in-back .24s var(--app-ease) backwards;}
@keyframes ob-in {from {opacity:0; transform:translateX(18px);}}
@keyframes ob-in-back {from {opacity:0; transform:translateX(-18px);}}

/* ---- Phone: full screen, own top bar, the button fixed above the keyboard and the home indicator ---- */
@media(max-width:675px) {
 .member-app.steps-page {padding-top:0; padding-bottom:0; background:var(--app-night);}
 .member-app.steps-page #nav-logged-in,.member-app.steps-page #nav-logged-in + .navbar-fixed {display:none !important;}
 .member-app.steps-page #container {margin:0 !important; padding:0 !important;}
 .ob {min-height:100vh; min-height:100dvh; padding-bottom:calc(132px + var(--app-safe-bottom));}
 .ob.ob-final {padding-bottom:calc(100px + var(--app-safe-bottom));}
 .ob-top {position:sticky; top:0; z-index:20; padding-top:calc(var(--app-safe-top) + 6px); background:var(--app-night);}
 .ob-bar {position:fixed; left:0; right:0; bottom:var(--ob-kb,0px); z-index:30; margin:0; padding:14px var(--ob-pad) calc(14px + var(--app-safe-bottom)); background:linear-gradient(180deg,#0f141c00 0,var(--app-night) 22px);}
 .ob.ob-kb-open .ob-bar {padding-bottom:10px;}
 .ob.ob-kb-open .ui-onboarding-delete {display:none;}
}
@media(max-width:360px) {
 .ob {--ob-pad:18px;}
 .ob-photos {gap:8px;}
 .ob .ob-chip > input + span {padding:8px 13px; font-size:14.5px;}
}

/* ---- Wider screens: a centred card under the site header ---- */
@media(min-width:676px) {
 .member-app.steps-page #container > .ob {margin:36px auto 56px;}
 .ob {max-width:540px; margin:36px auto 56px; padding:12px 12px 32px; border:1px solid var(--app-line); border-radius:28px; background:var(--app-deep); box-shadow:0 24px 60px #05080c66;}
 .ob {--ob-pad:32px;}
 .ob-top {padding-right:28px;}
}
@media(prefers-reduced-motion:reduce) {.ob-enter > *,.ob-enter-back > * {animation:none;} .ob-progress > span,.ob-slot-progress > span,.ob .ob-slot,.ob .ob-choice > input + span {transition:none;}}
