/*
 * Customer PWA — Phase 3 onboarding screens (login/signup email step, OTP step, mobile-number step).
 *
 * ISOLATION: every rule is scoped under `.yz-ob`, with only two exceptions that exist solely while an
 * onboarding screen is open: `html.yz-ob-lock` (stops the page BEHIND the full-screen layer scrolling) and
 * hiding the floating live-chat bubble so it cannot sit on top of the form. Nothing here is loaded by,
 * or can change, the menu, profile, header or bottom navigation.
 *
 * LAYOUT: a fixed full-screen flex column. Height comes from --yz-ob-vh (the VISIBLE viewport, kept up to
 * date by the inline script so it shrinks when the keyboard opens) with 100dvh/100vh fallbacks. The hero
 * (branding + promo) is the flexible part and shrinks first; the white form sheet keeps its natural size so
 * the input and the primary button always stay on screen. The sheet itself can scroll as a last resort on
 * extremely short screens, but at normal phone sizes nothing scrolls.
 */
html.yz-ob-lock, html.yz-ob-lock body { overflow: hidden !important; height: 100%; }
html.yz-ob-lock #yzlc { display: none !important; }

.yz-ob {
    --yz-ob-accent: #F04400;
    position: fixed; left: 0; right: 0; top: var(--yz-ob-top, 0px);
    height: 100vh; height: 100dvh; height: var(--yz-ob-vh, 100dvh);
    z-index: 2147482000;
    display: flex; flex-direction: column;
    background: var(--yz-ob-accent);
    color: #101828;
    font-family: inherit;
    overscroll-behavior: contain;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.yz-ob *, .yz-ob *::before, .yz-ob *::after { box-sizing: border-box; }

/* ---------- hero: branding + admin-controlled promotional message ---------- */
.yz-ob__hero {
    position: relative; flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    justify-content: safe center; /* if the hero is ever too short, keep the logo visible and clip the bottom instead of the top */
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 24px 20px;
    color: #fff; overflow: hidden;
    background: var(--yz-ob-accent);
    background: linear-gradient(165deg, var(--yz-ob-accent) 0%, color-mix(in srgb, var(--yz-ob-accent) 72%, #000) 100%);
}
.yz-ob__back {
    position: absolute; left: 8px; top: calc(env(safe-area-inset-top, 0px) + 8px);
    width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; border-radius: 50%; text-decoration: none; z-index: 2;
}
.yz-ob__back:active { background: rgba(255, 255, 255, .18); }
.yz-ob__back svg { width: 24px; height: 24px; }

.yz-ob__logo {
    width: 76px; height: 76px; border-radius: 20px; background: #fff; padding: 8px;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.yz-ob__logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.yz-ob__name { margin: 10px 0 0; font-size: 15px; font-weight: 600; opacity: .95; line-height: 1.25; }
.yz-ob__headline {
    margin: 14px 0 0; font-weight: 800; line-height: 1.15; letter-spacing: .2px;
    font-size: clamp(20px, 6.2vw, 28px); text-transform: uppercase; max-width: 22ch; overflow-wrap: anywhere;
}
.yz-ob__subtitle { margin: 8px 0 0; font-size: 14px; line-height: 1.4; opacity: .92; max-width: 34ch; overflow-wrap: anywhere; }
.yz-ob__powered { margin: 12px 0 0; font-size: 11px; letter-spacing: .4px; opacity: .8; }

/* entrance animation (respects reduced motion) */
.yz-ob__hero > * { animation: yzObRise .5s cubic-bezier(.2, .8, .2, 1) both; }
.yz-ob__hero > *:nth-child(2) { animation-delay: .05s; }
.yz-ob__hero > *:nth-child(3) { animation-delay: .1s; }
.yz-ob__hero > *:nth-child(4) { animation-delay: .15s; }
.yz-ob__hero > *:nth-child(5) { animation-delay: .2s; }
@keyframes yzObRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .yz-ob__hero > * { animation: none; } }

/* ---------- white form sheet ---------- */
.yz-ob__sheet {
    flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 22px 22px 0 0; margin-top: -18px; position: relative; z-index: 1;
    padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 14px);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .12);
}
.yz-ob__title { margin: 0 0 4px; font-size: 20px; font-weight: 800; color: #101828; text-align: center; line-height: 1.25; }
.yz-ob__lead { margin: 0 0 14px; font-size: 14px; color: #667085; text-align: center; line-height: 1.4; }
.yz-ob__lead strong { color: #101828; font-weight: 700; word-break: break-all; }

.yz-ob__msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.35; }
.yz-ob__msg--err { background: #FEF3F2; color: #B42318; }
.yz-ob__msg--ok { background: #ECFDF3; color: #067647; }

.yz-ob__field { margin: 0 0 10px; }
.yz-ob__input {
    display: block; width: 100%; height: 52px; padding: 0 16px; font-size: 16px; /* 16px: no zoom-on-focus */
    border: 1.5px solid #D0D5DD; border-radius: 12px; background: #fff; color: #101828; outline: none;
    -webkit-appearance: none; appearance: none;
}
.yz-ob__input:focus { border-color: var(--yz-ob-accent); box-shadow: 0 0 0 3px rgba(240, 68, 0, .14); }
.yz-ob__input.is-invalid { border-color: #D92D20; }
.yz-ob__fielderr { min-height: 0; margin: 6px 2px 0; font-size: 12.5px; color: #D92D20; }
.yz-ob__fielderr:empty { display: none; }

.yz-ob__check { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; font-size: 13px; color: #475467; font-weight: 400; }
.yz-ob__check input { width: 18px; height: 18px; margin: 0; accent-color: var(--yz-ob-accent); flex: 0 0 auto; }
.yz-ob__forget { display: inline-block; margin: -6px 0 10px 26px; font-size: 12px; color: #667085; }

.yz-ob__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 16px;
    border: 0; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none;
    background: var(--yz-ob-accent); color: #fff;
}
.yz-ob__btn:disabled, .yz-ob__btn[aria-busy="true"] { opacity: .65; cursor: default; }
.yz-ob__btn--ghost { background: #fff; color: var(--yz-ob-accent); border: 1.5px solid var(--yz-ob-accent); margin-top: 10px; min-height: 48px; }
.yz-ob__btn--ghost:disabled { opacity: .5; }
.yz-ob__spin { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: yzObSpin .7s linear infinite; display: none; }
.yz-ob__btn[aria-busy="true"] .yz-ob__spin { display: inline-block; }
@keyframes yzObSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .yz-ob__spin { animation-duration: 1.6s; } }

.yz-ob__or { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; color: #98A2B3; font-size: 12px; }
.yz-ob__or::before, .yz-ob__or::after { content: ""; flex: 1; height: 1px; background: #EAECF0; }
.yz-ob__social { display: flex; gap: 10px; }
.yz-ob__social a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; border: 1.5px solid #D0D5DD; color: #344054; font-size: 14px; font-weight: 600; text-decoration: none; background: #fff; }

.yz-ob__legal { margin: 12px 0 0; text-align: center; font-size: 11.5px; line-height: 1.5; color: #667085; }
.yz-ob__legal a { color: #344054; text-decoration: underline; margin: 0 4px; white-space: nowrap; }

/* OTP step (re-uses the existing .yz-otp control + customer-pwa-auth.css; only fitted to the sheet) */
.yz-ob .yz-otp { max-width: 100%; margin: 4px auto 0; }
.yz-ob .yz-otp__slots { gap: 8px; }
.yz-ob .yz-otp__slot { height: 52px; font-size: 22px; }
.yz-ob .yz-otp-note { margin: 8px 0 0; min-height: 18px; }
.yz-ob__otpbtn { margin-top: 10px; }

/* Mobile-number step (the existing form controls, same ids) */
.yz-ob .yz-onb__label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: #344054; }
.yz-ob .yz-onb__phone { display: flex; gap: 8px; }
.yz-ob .yz-onb__cc { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 12px; border: 1.5px solid #D0D5DD; border-radius: 12px; background: #fff; font-size: 15px; white-space: nowrap; }
.yz-ob .yz-onb__flag { font-size: 20px; line-height: 1; }
.yz-ob .yz-onb__phone input { flex: 1; min-width: 0; height: 52px; padding: 0 14px; border: 1.5px solid #D0D5DD; border-radius: 12px; font-size: 16px; }
.yz-ob .yz-onb__phone input:focus { border-color: var(--yz-ob-accent); outline: none; box-shadow: 0 0 0 3px rgba(240, 68, 0, .14); }
.yz-ob .yz-onb__hint { min-height: 18px; margin: 6px 2px 12px; color: #667085; font-size: 12.5px; }

/* Keyboard open / very short screens: shrink the decorative hero first, never the form. */
.yz-ob.is-kb .yz-ob__subtitle, .yz-ob.is-kb .yz-ob__powered, .yz-ob.is-kb .yz-ob__name { display: none; }
.yz-ob.is-kb .yz-ob__logo { width: 52px; height: 52px; border-radius: 14px; padding: 6px; }
.yz-ob.is-kb .yz-ob__headline { margin-top: 8px; font-size: clamp(16px, 4.8vw, 20px); }
.yz-ob.is-kb .yz-ob__hero { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-bottom: 12px; }
.yz-ob.is-kb .yz-ob__or, .yz-ob.is-kb .yz-ob__social { display: none; }
@media (max-height: 640px) { /* small Android screens (e.g. 320x568, 360x640): compact hero so the form always fits */
    .yz-ob__subtitle, .yz-ob__powered, .yz-ob__name { display: none; }
    .yz-ob__logo { width: 52px; height: 52px; border-radius: 14px; padding: 6px; }
    .yz-ob__headline { margin-top: 8px; font-size: clamp(16px, 4.8vw, 20px); }
}
@media (min-width: 560px) {
    /* tablets / desktop preview: keep the app-like column centred */
    .yz-ob { left: 50%; right: auto; width: 440px; transform: translateX(-50%); }
}
