:root {
    --auth-page-bg: #f7f7f5;
    --auth-panel-bg: #ffffff;
    --auth-text: #0d0d0d;
    --auth-muted: #6f6f6f;
    --auth-border: rgba(13, 13, 13, 0.12);
    --auth-border-hover: rgba(13, 13, 13, 0.24);
    --auth-focus-border: rgba(13, 13, 13, 0.72);
    --auth-focus-ring: rgba(13, 13, 13, 0.07);
    --auth-control-bg: rgba(255, 255, 255, 0.96);
    --auth-control-shadow: none;
    --auth-control-hover-shadow: none;
    --auth-control-focus-shadow: 0 0 0 3px var(--auth-focus-ring);
    --auth-button-shadow: none;
    --auth-button-hover-shadow: none;
    --auth-label-reserve: 1.52rem;
    --auth-label-float-top: 0.96rem;
}

body.auth-page {
    --bg-left: var(--auth-panel-bg);
    --bg-right: var(--auth-page-bg);
    --text-main: var(--auth-text);
    --text-dim: var(--auth-muted);
    --border-color: var(--auth-border);
    --focus-glow: var(--auth-focus-ring);
    --input-bg: var(--auth-control-bg);
    background: var(--auth-page-bg);
    color: var(--auth-text);
    text-rendering: optimizeLegibility;
}

body.auth-page .split-left {
    box-shadow: none;
    border-right: 1px solid rgba(0, 0, 0, 0.045);
}

body.auth-page .top-nav {
    padding: 38px 44px;
}

body.auth-page .logo-container a {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: background 0.2s ease, color 0.2s ease;
}

body.auth-page .logo-container a:hover {
    background: rgba(0, 0, 0, 0.035);
    box-shadow: none;
    transform: none;
}

body.auth-page .logo-container img {
    height: 58px;
    width: auto;
    filter: none;
}

body.auth-page .auth-container {
    margin-top: -54px;
}

body.auth-page .auth-box {
    max-width: 390px;
}

body.auth-page .auth-title {
    margin-bottom: 1.55rem;
    font-size: 2rem;
    font-weight: 550;
    letter-spacing: 0;
    line-height: 1.12;
    color: var(--auth-text);
}

body.auth-page .oauth-btn {
    min-height: 56px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 0.98rem;
    letter-spacing: 0;
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body.auth-page .primary-oauth {
    background: #0d0d0d;
    box-shadow: var(--auth-button-shadow);
}

body.auth-page .primary-oauth:hover {
    background: #1a1a1a;
    box-shadow: var(--auth-button-hover-shadow);
    transform: none;
}

body.auth-page .secondary-oauth {
    background: var(--auth-control-bg);
    border-color: var(--auth-border);
    box-shadow: var(--auth-control-shadow);
}

body.auth-page .secondary-oauth:hover {
    background: rgba(13, 13, 13, 0.035);
    border-color: var(--auth-border-hover);
    box-shadow: none;
    transform: none;
}

body.auth-page .input-group {
    position: relative;
    margin-bottom: 1.18rem;
    padding-top: var(--auth-label-reserve);
}

body.auth-page .input-group label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    min-height: 1.1rem;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 550;
    line-height: 1;
    color: var(--auth-muted);
    pointer-events: none;
    white-space: nowrap;
    transition: top 0.18s ease, left 0.18s ease, padding 0.18s ease, color 0.18s ease, background 0.18s ease;
}

body.auth-page .input-group:focus-within > label {
    top: var(--auth-label-float-top);
    left: 16px;
    max-width: calc(100% - 32px);
    padding: 0 7px;
    border-radius: 999px;
    background: var(--auth-panel-bg);
    color: var(--auth-focus-border);
}

body.auth-page .input-group:has(.custom-select) {
    padding-top: 0;
}

body.auth-page .input-group:has(.custom-select) > label,
body.auth-page .input-group:has(.custom-select):focus-within > label {
    position: static;
    display: block;
    max-width: 100%;
    min-height: auto;
    margin: 0 0 0.5rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--auth-muted);
}

body.auth-page .input-field,
body.auth-page .country-select {
    min-height: 56px;
    background: var(--auth-control-bg);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    font-size: 1rem;
    color: var(--auth-text);
    box-shadow: var(--auth-control-shadow);
}

body.auth-page .country-select {
    width: 128px;
    padding: 0 14px;
}

body.auth-page .input-field:hover,
body.auth-page .country-select:hover {
    border-color: var(--auth-border-hover);
    box-shadow: var(--auth-control-hover-shadow);
}

body.auth-page .input-field:focus,
body.auth-page .country-select:focus {
    background: #ffffff;
    border-color: var(--auth-focus-border);
    box-shadow: var(--auth-control-focus-shadow);
}

body.auth-page .phone-row {
    gap: 12px;
}

body.auth-page .phone-row,
body.auth-page .custom-select {
    margin-top: 0;
}

body.auth-page .submit-btn {
    min-height: 56px;
    border-radius: 14px;
    font-size: 1rem;
    letter-spacing: 0;
    background: #0d0d0d;
    box-shadow: var(--auth-button-shadow);
}

body.auth-page .submit-btn:hover {
    background: #1a1a1a;
    box-shadow: var(--auth-button-hover-shadow);
    transform: none;
}

body.auth-page .back-btn {
    top: -56px;
    left: -4px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(0, 0, 0, 0.58);
}

body.auth-page .back-btn:hover {
    background: rgba(0, 0, 0, 0.055);
}

body.auth-page .auth-links,
body.auth-page .resend-links {
    color: var(--auth-muted);
}

body.auth-page .auth-links a,
body.auth-page .resend-links button {
    color: var(--auth-text);
    font-weight: 550;
}

body.auth-page .brand-footer {
    color: var(--auth-muted);
}

@media (max-width: 900px) {
    body.auth-page {
        background: #ffffff;
    }

    body.auth-page .top-nav {
        padding: 28px 30px;
    }

    body.auth-page .auth-container {
        margin-top: -36px;
        padding: 0 38px;
    }
}

@media (max-width: 900px), (max-height: 780px) {
    body.auth-page.email-form-active {
        overflow: auto;
    }

    body.auth-page.email-form-active .split-left {
        min-height: 100vh;
    }

    body.auth-page.email-form-active .auth-container {
        justify-content: flex-start;
        margin-top: 0;
        padding-top: 22px;
        padding-bottom: 104px;
        overflow: visible;
    }

    body.auth-page.email-form-active .brand-footer {
        position: static;
        transform: none;
        margin-top: 28px;
        padding: 0 8px;
    }
}

@media (max-width: 520px) {
    body.auth-page .auth-title {
        font-size: 1.75rem;
    }

    body.auth-page .auth-container {
        padding: 0 40px;
    }

    body.auth-page .phone-row {
        flex-direction: column;
    }

    body.auth-page .country-select {
        width: 100%;
    }
}

/* Unified mobile authentication shell --------------------------------------
   Every auth step (sign in, sign up, verification, and password reset) uses
   the same scroll-safe column. `dvh` follows the visible viewport on mobile
   browsers, so a keyboard or browser toolbar never traps the last control. */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
    body.auth-page {
        min-height: 100dvh;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        background: #ffffff;
        -webkit-overflow-scrolling: touch;
    }

    body.auth-page .split-left {
        width: 100%;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
        border-right: 0;
        background: #ffffff;
    }

    body.auth-page .split-right {
        display: none;
    }

    body.auth-page .top-nav {
        min-height: 68px;
        padding: max(16px, calc(env(safe-area-inset-top) + 8px)) 20px 8px;
    }

    body.auth-page .logo-container a {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    body.auth-page .logo-container img {
        height: 46px;
    }

    body.auth-page .auth-container,
    body.auth-page.email-form-active .auth-container {
        display: block;
        width: 100%;
        margin: 0;
        padding: 28px 20px max(34px, calc(env(safe-area-inset-bottom) + 22px));
        overflow: visible;
    }

    body.auth-page .auth-box {
        width: 100%;
        max-width: 460px;
        min-width: 0;
        margin: 0 auto;
    }

    body.auth-page .auth-step {
        width: 100%;
    }

    body.auth-page .auth-title {
        margin: 0 0 0.9rem;
        font-size: clamp(1.7rem, 7vw, 2.1rem);
        line-height: 1.12;
        text-align: left;
        letter-spacing: -0.025em;
    }

    body.auth-page .form-helper {
        margin: 0 0 1.5rem;
        font-size: 0.92rem;
        line-height: 1.5;
        text-align: left;
    }

    body.auth-page .back-btn,
    body.auth-page .email-otp-step .back-btn,
    body.auth-page .password-reset-otp-step .back-btn {
        position: static;
        width: 44px;
        height: 44px;
        margin: 0 0 16px -8px;
        padding: 0;
        border-radius: 50%;
    }

    body.auth-page .oauth-btn,
    body.auth-page .submit-btn {
        min-height: 54px;
        border-radius: 15px;
    }

    body.auth-page .oauth-btn {
        margin-bottom: 12px;
    }

    body.auth-page .input-group {
        margin-bottom: 1.05rem;
    }

    body.auth-page .input-field,
    body.auth-page .country-select {
        min-height: 54px;
        font-size: 16px;
        border-radius: 14px;
    }

    body.auth-page .name-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body.auth-page .phone-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.auth-page .phone-row .custom-select,
    body.auth-page .phone-row .input-field {
        width: 100%;
    }

    body.auth-page .password-requirements {
        gap: 8px 12px;
        margin-top: 11px;
        font-size: 0.78rem;
    }

    body.auth-page .forgot-password-row {
        margin: -0.45rem 0 0.45rem;
    }

    body.auth-page .forgot-password-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        font-size: 0.86rem;
    }

    body.auth-page .password-toggle {
        width: 44px;
        height: 44px;
    }

    body.auth-page .auth-links a,
    body.auth-page .resend-links button,
    body.auth-page .otp-resend-row button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.auth-page .auth-links,
    body.auth-page .resend-links,
    body.auth-page .otp-resend-row {
        margin-top: 1.6rem;
    }

    body.auth-page .email-otp-step .auth-title,
    body.auth-page .password-reset-otp-step .auth-title {
        margin-bottom: 0.7rem;
    }

    body.auth-page .otp-container {
        gap: clamp(5px, 2vw, 9px);
    }

    body.auth-page .otp-input {
        height: clamp(46px, 13vw, 54px);
        border-radius: 13px;
        font-size: 1.05rem;
    }

    body.auth-page .brand-footer,
    body.auth-page.email-form-active .brand-footer {
        position: static;
        width: min(460px, 100%);
        margin: 16px auto 0;
        padding: 0 20px max(20px, env(safe-area-inset-bottom));
        transform: none;
        text-align: left;
        font-size: 0.75rem;
    }

    body.auth-page .toast {
        top: max(12px, calc(env(safe-area-inset-top) + 8px));
        right: max(14px, env(safe-area-inset-right));
        left: max(14px, env(safe-area-inset-left));
        width: auto;
        max-width: none;
        min-height: 52px;
        padding: 12px 16px;
        border-radius: 16px;
        align-items: flex-start;
        line-height: 1.38;
        overflow-wrap: anywhere;
        transform: translateY(calc(-100% - env(safe-area-inset-top) - 20px));
    }

    body.auth-page .toast.show {
        transform: translateY(0);
    }

    body.auth-page .toast > i {
        flex: 0 0 auto;
        margin-top: 0.16em;
    }

    body.auth-page .toast > span {
        min-width: 0;
        flex: 1 1 auto;
    }
}

@media (pointer: coarse) and (max-height: 520px) {
    body.auth-page .top-nav {
        min-height: 52px;
        padding: max(8px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 2px max(20px, env(safe-area-inset-left));
    }

    body.auth-page .logo-container a {
        width: 44px;
        height: 44px;
    }

    body.auth-page .logo-container img {
        height: 40px;
    }

    body.auth-page .auth-container,
    body.auth-page.email-form-active .auth-container {
        padding: 10px max(24px, env(safe-area-inset-right)) max(22px, calc(env(safe-area-inset-bottom) + 14px)) max(24px, env(safe-area-inset-left));
    }

    body.auth-page .auth-title {
        font-size: clamp(1.55rem, 5vw, 1.9rem);
    }

    body.auth-page .brand-footer,
    body.auth-page.email-form-active .brand-footer {
        margin-top: 14px;
        padding-right: max(20px, env(safe-area-inset-right));
        padding-left: max(20px, env(safe-area-inset-left));
    }
}

@media (max-width: 360px) {
    body.auth-page .auth-container,
    body.auth-page.email-form-active .auth-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    body.auth-page .otp-container {
        gap: 4px;
    }
}

/* A registration/reset form can be much taller than sign-in once translated
   labels and legal copy wrap. On wide desktop layouts the footer previously
   stayed absolutely positioned at the bottom of the panel, which let it sit
   on top of the primary action. Keep it in the normal form flow instead and
   allow the left panel to grow or scroll on shorter browser windows. */
@media (min-width: 901px) {
    body.auth-page.email-form-active {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.auth-page.email-form-active .split-left {
        min-height: 100vh;
        height: auto;
        overflow: visible;
    }

    body.auth-page.email-form-active .brand-footer {
        position: static;
        flex: 0 0 auto;
        width: min(390px, calc(100% - 48px));
        margin: 28px auto 0;
        padding: 0 8px 28px;
        transform: none;
    }
}

/* Desktop adapts by component, not whole-page zoom. The form grows on wide
   displays while preserving a readable line length and its existing motion. */
@media (min-width: 901px) {
    body.auth-page .top-nav {
        padding: clamp(32px, 3vw, 64px);
    }

    body.auth-page .logo-container a {
        width: clamp(62px, 4vw, 78px);
        height: clamp(62px, 4vw, 78px);
    }

    body.auth-page .logo-container img {
        height: clamp(58px, 3.7vw, 72px);
    }

    body.auth-page .auth-container {
        padding-right: clamp(36px, 4vw, 96px);
        padding-left: clamp(36px, 4vw, 96px);
        margin-top: clamp(-66px, -4vw, -54px);
    }

    body.auth-page .auth-box {
        max-width: clamp(390px, 21vw, 520px);
    }

    body.auth-page .auth-title {
        font-size: clamp(2rem, 1.4vw, 2.6rem);
        margin-bottom: clamp(1.55rem, 2vw, 2.15rem);
    }

    body.auth-page .oauth-btn,
    body.auth-page .input-field,
    body.auth-page .country-select,
    body.auth-page .submit-btn {
        min-height: clamp(56px, 3.2vw, 64px);
        font-size: clamp(0.98rem, 0.78vw, 1.08rem);
    }

    body.auth-page .input-group {
        margin-bottom: clamp(1.18rem, 1.35vw, 1.5rem);
    }
}

/* Business onboarding shares the auth shell so registration can finish without
   a page navigation or a visual jump. */
body.auth-page .auth-box.business-profile-mode {
    max-width: min(440px, 100%);
}

body.auth-page .business-profile-step .auth-title {
    margin-bottom: 0.65rem;
}

body.auth-page .business-profile-step .form-helper {
    max-width: 390px;
    margin: 0 auto 2rem;
    color: rgba(10, 10, 10, 0.58);
    font-size: 0.96rem;
    line-height: 1.55;
    text-align: center;
}

body.auth-page .onboarding-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0 0 1.15rem;
}

body.auth-page .onboarding-kicker span {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
}

body.auth-page .onboarding-kicker span.is-current {
    width: 34px;
    background: #111111;
}

body.auth-page .auth-select-wrap {
    position: relative;
}

body.auth-page .auth-native-select {
    width: 100%;
    min-height: 58px;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 46px 0 16px;
    border: 1px solid rgba(0, 0, 0, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: rgba(10, 10, 10, 0.48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 220ms ease, background 180ms ease;
}

body.auth-page .auth-native-select.has-value {
    color: #111111;
}

body.auth-page .auth-native-select:hover {
    border-color: rgba(0, 0, 0, 0.24);
}

body.auth-page .auth-native-select:focus {
    border-color: rgba(0, 0, 0, 0.72);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.055), 0 14px 32px rgba(0, 0, 0, 0.08);
    outline: none;
}

body.auth-page .auth-native-select[aria-invalid="true"] {
    border-color: #e33b32;
    box-shadow: 0 0 0 3px rgba(227, 59, 50, 0.09);
}

body.auth-page .auth-select-wrap > i {
    position: absolute;
    top: 50%;
    right: 17px;
    color: rgba(0, 0, 0, 0.55);
    font-size: 0.76rem;
    pointer-events: none;
    transform: translateY(-50%);
    transition: transform 180ms ease;
}

body.auth-page .auth-select-wrap:focus-within > i {
    transform: translateY(-50%) rotate(180deg);
}

body.auth-page .business-profile-error {
    min-height: 20px;
    margin: -0.3rem 0 0.75rem;
}

body.auth-page .business-profile-step .submit-btn {
    margin-top: 0.15rem;
}

body.auth-page .business-profile-step.form-entering .onboarding-kicker {
    animation: authFormContentEnter 0.42s 50ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.auth-page .business-profile-step.form-entering form > *:nth-child(1) { animation-delay: 115ms; }
body.auth-page .business-profile-step.form-entering form > *:nth-child(2) { animation-delay: 175ms; }
body.auth-page .business-profile-step.form-entering form > *:nth-child(3) { animation-delay: 225ms; }
body.auth-page .business-profile-step.form-entering form > *:nth-child(4) { animation-delay: 275ms; }

@media (min-width: 901px) {
    body.auth-page.business-profile-completion-active {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    body.auth-page.business-profile-completion-active .split-left {
        min-height: 100vh;
        height: auto;
    }

    body.auth-page.business-profile-completion-active .brand-footer {
        position: static;
        width: min(420px, calc(100% - 48px));
        margin: 30px auto 0;
        padding: 0 8px 28px;
        transform: none;
    }
}

@media (max-width: 900px) {
    body.auth-page.business-profile-completion-active .auth-container {
        justify-content: flex-start;
        margin-top: 0;
        padding-top: clamp(28px, 7vh, 58px);
    }

    body.auth-page .business-profile-step .form-helper {
        margin-bottom: 1.65rem;
    }

    body.auth-page .auth-native-select {
        min-height: 56px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.auth-page .business-profile-step.form-entering .onboarding-kicker {
        animation: none !important;
    }
}
