.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.auth-page button {
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

[data-bs-theme="dark"] .auth-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--color-text);
    box-shadow: none;
}

[data-bs-theme="dark"] .auth-btn-oauth {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-bs-theme="dark"] .auth-bg-overlay {
    background:
        radial-gradient(ellipse 280px 220px at 50% -5%, rgba(var(--color-primary-rgb), 0.1) 0%, transparent 70%),
        linear-gradient(180deg, rgba(26, 26, 46, 0.48) 0%, rgba(26, 26, 46, 0.58) 100%);
}

html:not([data-bs-theme="dark"]) .auth-screen .auth-subtitle,
html:not([data-bs-theme="dark"]) .auth-screen .auth-field-label,
html:not([data-bs-theme="dark"]) .auth-screen .auth-footer,
html:not([data-bs-theme="dark"]) .auth-screen .auth-consent__text,
html:not([data-bs-theme="dark"]) .auth-screen .auth-legal,
html:not([data-bs-theme="dark"]) .auth-screen .auth-divider,
html:not([data-bs-theme="dark"]) .auth-screen .auth-chip {
    color: var(--color-text);
}

html:not([data-bs-theme="dark"]) .auth-screen .auth-input::placeholder {
    color: var(--color-text-secondary);
}

.auth-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
    padding-top: 8px;
}

.auth-hero-compact {
    margin-bottom: 16px;
}

.auth-logo {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(224, 122, 95, 0.25);
}

.auth-logo-sm {
    width: 72px;
    height: 72px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.3px;
    max-width: 300px;
    margin: 0 0 8px;
    color: var(--color-text);
}

.auth-title-left {
    max-width: none;
    text-align: left;
    align-self: stretch;
}

.auth-subtitle {
    font-size: var(--text-md, 15px);
    line-height: 1.45;
    color: var(--color-text);
    max-width: 300px;
    margin: 0;
}

.auth-subtitle-left {
    max-width: none;
    text-align: left;
    align-self: stretch;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -8px 16px;
}

.auth-nav-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    color: var(--color-text);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.auth-nav-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    flex: 1;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.auth-field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    padding-left: 4px;
}

.auth-input {
    height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(26, 26, 46, 0.08);
    background: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    color: var(--color-text);
    box-shadow: 0 2px 12px rgba(26, 26, 46, 0.04);
    width: 100%;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input::placeholder {
    color: var(--color-text-tertiary);
}

.auth-input:focus {
    border-color: rgba(224, 122, 95, 0.45);
    box-shadow: 0 2px 12px rgba(26, 26, 46, 0.04), 0 0 0 3px rgba(224, 122, 95, 0.12);
}

.auth-link {
    align-self: flex-end;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    margin-top: 2px;
    -webkit-tap-highlight-color: transparent;
}

.auth-btn-primary {
    margin-top: 12px;
    height: 54px;
    width: 100%;
    border: none;
    border-radius: 18px;
    background: var(--color-primary);
    box-shadow: 0 8px 24px rgba(224, 122, 95, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
    -webkit-tap-highlight-color: transparent;
}

.auth-btn-primary:active:not(:disabled) {
    background: var(--color-primary-pressed);
}

.auth-btn-primary:disabled {
    opacity: 0.72;
}

.auth-btn-primary--awaiting-consent {
    opacity: 0.72;
}

.auth-btn-oauth--awaiting-consent {
    opacity: 0.72;
}

.auth-btn-ghost {
    height: 48px;
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
}

.auth-btn-ghost:disabled {
    opacity: 0.5;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--color-text-tertiary);
    font-size: 13px;
    font-weight: 600;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(26, 26, 46, 0.1);
}

.auth-oauth-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-btn-oauth {
    height: 52px;
    width: 100%;
    border-radius: 16px;
    border: 1.5px solid rgba(26, 26, 46, 0.08);
    background: #fff;
    box-shadow: 0 2px 10px rgba(26, 26, 46, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
}

.auth-btn-oauth:active:not(:disabled) {
    background: #fafafa;
}

.auth-btn-oauth:disabled {
    opacity: 0.72;
}

.auth-btn-oauth--apple {
    background: #000;
    border-color: #000;
    color: #fff;
}

.auth-btn-oauth--apple:active:not(:disabled) {
    background: #1a1a1a;
}

[data-bs-theme="dark"] .auth-btn-oauth--apple {
    background: #fff;
    border-color: #fff;
    color: #000;
}

.auth-oauth-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.auth-footer {
    margin-top: auto;
    text-align: center;
    font-size: 15px;
    color: var(--color-text-secondary);
    padding-top: 12px;
}

.auth-footer-link {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-legal {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-tertiary);
    text-align: center;
}

.auth-legal-link {
    color: var(--color-primary);
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

.auth-consent {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 4px 0 12px;
    text-align: left;
}

.auth-consent__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.auth-consent__input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--color-primary);
}

.auth-consent__text {
    font-size: var(--text-sm, 13px);
    line-height: 1.45;
    color: var(--color-text);
}

.auth-consent--nudge .auth-consent__item {
    border-radius: 12px;
    margin: 0 -8px;
    padding: 8px;
    animation: auth-consent-nudge 1.1s ease;
}

.auth-consent--nudge .auth-consent__item:has(.auth-consent__input:not(:checked)) {
    background: rgba(var(--color-primary-rgb), 0.14);
    box-shadow: inset 0 0 0 1.5px rgba(var(--color-primary-rgb), 0.55);
}

.auth-consent--nudge .auth-consent__item:has(.auth-consent__input:not(:checked)) .auth-consent__text {
    color: var(--color-text);
    font-weight: 600;
}

@keyframes auth-consent-nudge {
    0% {
        transform: translateX(0);
    }
    18% {
        transform: translateX(-4px);
    }
    36% {
        transform: translateX(4px);
    }
    54% {
        transform: translateX(-3px);
    }
    72% {
        transform: translateX(2px);
    }
    100% {
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-consent--nudge .auth-consent__item {
        animation: none;
    }
}

.auth-error {
    margin: 8px 0 4px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--tag-rose-text);
    text-align: center;
    background: rgba(255, 232, 238, 0.95);
    border: 1px solid rgba(196, 61, 92, 0.28);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.auth-success {
    margin: 8px 0 4px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-success);
    text-align: center;
    background: rgba(232, 246, 239, 0.95);
    border: 1px solid rgba(61, 139, 110, 0.28);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

[data-bs-theme="dark"] .auth-error {
    color: #f0a8b8;
    background: rgba(58, 31, 42, 0.95);
    border-color: rgba(224, 85, 136, 0.35);
}

[data-bs-theme="dark"] .auth-success {
    color: #7dcea0;
    background: rgba(26, 51, 41, 0.95);
    border-color: rgba(61, 139, 110, 0.35);
}

.auth-spacer {
    flex: 1;
}

.auth-verify-icon {
    font-size: 64px;
    text-align: center;
    margin: 24px 0 8px;
    line-height: 1;
}

.auth-progress {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
}

.auth-progress-dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
}

.auth-progress-dot.active {
    background: var(--color-primary);
}

.auth-progress-dot.done {
    background: var(--color-primary);
    opacity: 0.45;
}

.auth-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-chip {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    -webkit-tap-highlight-color: transparent;
}

.auth-chip.selected {
    background: var(--color-primary-subtle);
    border-color: rgba(224, 122, 95, 0.35);
    color: var(--color-primary);
}

.auth-chip:disabled {
    opacity: 0.45;
}

.auth-row {
    display: flex;
    gap: 12px;
}

.auth-row .auth-field {
    flex: 1;
}

.auth-field-hint {
    margin: 0;
    padding-left: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--color-text-secondary);
}

.auth-field-error {
    display: block;
    margin: 0;
    padding-left: 4px;
    font-size: 13px;
    line-height: 1.35;
    color: #c0392b;
}

.auth-field .validation-message {
    display: block;
    margin: 0;
    padding-left: 4px;
    font-size: 13px;
    line-height: 1.35;
    color: #c0392b;
}

.auth-city-dropdown.select-dropdown {
    width: 100%;
}

.auth-city-dropdown .select-dropdown__trigger {
    height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(26, 26, 46, 0.08);
    background: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text);
    box-shadow: 0 2px 12px rgba(26, 26, 46, 0.04);
}

.auth-city-dropdown .select-dropdown__trigger--open {
    border-color: rgba(var(--color-primary-rgb), 0.45);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
}

[data-bs-theme="dark"] .auth-city-dropdown .select-dropdown__trigger {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--color-text);
    box-shadow: none;
}

.auth-city-dropdown__placeholder {
    color: var(--color-text-secondary);
}

.auth-city-dropdown .select-dropdown__panel {
    position: relative;
    top: auto;
    z-index: 5;
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.1);
}

.auth-city-dropdown .select-dropdown__panel--open {
    border-color: rgba(var(--color-primary-rgb), 0.45);
}

.auth-city-dropdown .select-dropdown__panel-inner {
    max-height: min(260px, 40vh);
}

.auth-city-dropdown__search {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: none;
    border-bottom: 1px solid rgba(26, 26, 46, 0.08);
    background: transparent;
    font-size: 15px;
    color: var(--color-text);
    outline: none;
}

[data-bs-theme="dark"] .auth-city-dropdown__search {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.auth-city-dropdown__list {
    display: flex;
    flex-direction: column;
}

.auth-city-dropdown__item {
    display: block;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text);
    border-bottom: 1px solid rgba(26, 26, 46, 0.06);
}

[data-bs-theme="dark"] .auth-city-dropdown__item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.auth-city-dropdown__item:last-child {
    border-bottom: none;
}

.auth-city-dropdown__item--selected,
.auth-city-dropdown__item:active,
.auth-city-dropdown__item:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
}

.auth-city-dropdown__empty {
    margin: 0;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.auth-city-dropdown__item--custom {
    font-weight: 600;
    color: rgb(var(--color-primary-rgb));
}

.onboarding-page {
    overflow: hidden;
}

.onboarding-viewport {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
    margin: 0 -4px;
}

.onboarding-track {
    display: flex;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.onboarding-track--dragging {
    transition: none !important;
}

.onboarding-panel {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.onboarding-step-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.onboarding-step-header__title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.onboarding-done-link {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 8px 12px;
    border: none;
    border-radius: 999px;
    background: rgba(var(--color-primary-rgb), 0.12);
    color: rgb(var(--color-primary-rgb));
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.2;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.onboarding-done-link:disabled {
    opacity: 0.55;
}

/* Short phones: Apple OAuth adds a third button — compact vertical rhythm. */
@media (max-height: 920px) {
    .auth-hero {
        margin-bottom: 12px;
        padding-top: 0;
    }

    .auth-logo {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        margin-bottom: 10px;
    }

    .auth-logo-sm {
        width: 56px;
        height: 56px;
    }

    .auth-title {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .auth-subtitle {
        font-size: 13px;
        line-height: 1.35;
    }

    .auth-field {
        gap: 4px;
        margin-bottom: 8px;
    }

    .auth-input {
        height: 46px;
        border-radius: 14px;
    }

    .auth-btn-primary {
        margin-top: 8px;
        height: 48px;
        border-radius: 16px;
        font-size: 16px;
    }

    .auth-btn-oauth {
        height: 46px;
        border-radius: 14px;
        font-size: 15px;
    }

    .auth-oauth-stack {
        gap: 8px;
    }

    .auth-divider {
        margin: 10px 0;
    }

    .auth-consent {
        gap: 8px;
        margin: 2px 0 8px;
    }

    .auth-consent__text {
        font-size: 12px;
        line-height: 1.35;
    }

    .auth-footer {
        padding-top: 8px;
        font-size: 14px;
    }
}

@media (max-height: 780px) {
    .auth-subtitle {
        display: none;
    }

    .auth-logo {
        width: 52px;
        height: 52px;
        margin-bottom: 6px;
    }

    .auth-hero {
        margin-bottom: 8px;
    }

    .auth-title {
        font-size: 18px;
        margin-bottom: 0;
    }
}
