.auth-box.profile-mode {
    max-width: 420px;
}

.auth-box.profile-mode .auth-title {
    font-size: 2.05rem;
    font-weight: 550;
    letter-spacing: 0;
    margin-bottom: 1.35rem;
}

.auth-box.profile-mode .form-helper {
    max-width: 380px;
    margin: -0.55rem auto 1.65rem;
    font-size: 1rem;
    line-height: 1.55;
}

.auth-box.profile-mode .input-group {
    margin-bottom: 1.15rem;
}

.auth-box.profile-mode .input-group label {
    font-size: 0.88rem;
    font-weight: 550;
    color: var(--auth-muted, rgba(10, 10, 10, 0.58));
}

.auth-box.profile-mode .input-group:focus-within > label {
    color: var(--auth-focus-border, rgba(0, 0, 0, 0.72));
}

.auth-box.profile-mode .input-field {
    min-height: 56px;
    background: var(--auth-control-bg, rgba(255, 255, 255, 0.92));
    border: 1px solid var(--auth-border, rgba(0, 0, 0, 0.11));
    border-radius: 14px;
    color: var(--auth-text, #0a0a0a);
    box-shadow: var(--auth-control-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.04));
    font-size: 1rem;
}

.auth-box.profile-mode .input-field:hover,
.custom-select-trigger:hover {
    border-color: var(--auth-border-hover, rgba(0, 0, 0, 0.2));
    box-shadow: var(--auth-control-hover-shadow, none);
}

.auth-box.profile-mode .input-field:focus {
    background: #ffffff;
    border-color: var(--auth-focus-border, rgba(0, 0, 0, 0.72));
    box-shadow: var(--auth-control-focus-shadow, 0 0 0 3px rgba(0, 0, 0, 0.055), 0 14px 32px rgba(0, 0, 0, 0.08));
}

.auth-box.profile-mode .phone-row {
    align-items: stretch;
    gap: 12px;
}

.phone-country-select {
    flex: 0 0 148px;
}

.region-select {
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select.open {
    z-index: 220;
}

.custom-select-trigger {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--auth-border, rgba(0, 0, 0, 0.11));
    border-radius: 14px;
    background: var(--auth-control-bg, rgba(255, 255, 255, 0.92));
    color: var(--auth-text, #0a0a0a);
    padding: 0 14px;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
    box-shadow: var(--auth-control-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.04));
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
    background: #ffffff;
    border-color: var(--auth-focus-border, rgba(0, 0, 0, 0.72));
    box-shadow: var(--auth-control-focus-shadow, 0 0 0 3px rgba(0, 0, 0, 0.055), 0 14px 32px rgba(0, 0, 0, 0.08));
}

.select-current {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.select-current-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.flag {
    width: 24px;
    height: 18px;
    flex: 0 0 auto;
    display: inline-block;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.06);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.flag.is-empty {
    display: none;
}

.flag.has-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1.2rem;
    line-height: 1;
}

.custom-select-trigger:disabled {
    cursor: not-allowed;
    color: var(--auth-muted, rgba(0, 0, 0, 0.45));
    background: rgba(0, 0, 0, 0.025);
    border-color: var(--auth-border, rgba(0, 0, 0, 0.11));
    box-shadow: none;
}

.select-chevron {
    flex: 0 0 auto;
    color: rgba(0, 0, 0, 0.55);
    font-size: 0.74rem;
    transition: transform 0.2s ease;
}

.custom-select.open .select-chevron,
.custom-select.mobile-sheet-open .select-chevron {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 240;
    max-height: 254px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border: 1px solid var(--auth-border, rgba(0, 0, 0, 0.08));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px) scale(0.99);
    transform-origin: top center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
    .custom-select-menu {
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
}

.custom-select.open .custom-select-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.phone-country-select .custom-select-menu {
    width: 420px;
    max-width: calc(100vw - 48px);
    right: auto;
}

.custom-option {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--auth-text, #0a0a0a);
    padding: 9px 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease;
}

.custom-option:hover,
.custom-option:focus-visible,
.custom-option[aria-selected="true"] {
    background: rgba(0, 0, 0, 0.055);
    outline: none;
}

.option-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-main {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    font-weight: 550;
    letter-spacing: 0;
}

.option-sub {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--auth-muted, rgba(10, 10, 10, 0.56));
    font-size: 0.76rem;
}

.region-select .custom-option {
    min-height: 44px;
}

body.auth-select-dialog-open {
    overflow: hidden !important;
}

.auth-select-dialog {
    width: 100%;
    max-width: none;
    max-height: none;
    margin: auto 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--auth-text, #0a0a0a);
    overflow: visible;
}

.auth-select-dialog[open] {
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
}

.auth-select-dialog::backdrop {
    background: rgba(0, 0, 0, 0.34);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: auth-select-backdrop-in 0.2s ease-out both;
}

.auth-select-dialog.is-closing::backdrop {
    animation: auth-select-backdrop-out 0.15s ease-in both;
}

.auth-select-sheet {
    width: 100%;
    max-height: min(78dvh, 620px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 max(12px, env(safe-area-inset-right)) max(12px, calc(env(safe-area-inset-bottom) + 8px)) max(12px, env(safe-area-inset-left));
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 -18px 52px rgba(0, 0, 0, 0.16);
    animation: auth-select-sheet-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-select-dialog.is-closing .auth-select-sheet {
    animation: auth-select-sheet-out 0.15s ease-in both;
}

.auth-select-sheet-header {
    flex: 0 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 4px 6px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.075);
}

.auth-select-sheet-title {
    min-width: 0;
    margin: 0;
    font: 550 1.04rem/1.3 var(--font-family, sans-serif);
    overflow-wrap: anywhere;
}

.auth-select-sheet-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.055);
    color: currentColor;
    font: inherit;
    cursor: pointer;
}

.auth-select-sheet-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.auth-select-sheet-options {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.auth-select-sheet-options .custom-option {
    min-height: 50px;
}

@keyframes auth-select-sheet-in {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-select-sheet-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(22px); }
}

@keyframes auth-select-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes auth-select-backdrop-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.auth-box.profile-mode .submit-btn {
    min-height: 58px;
    border-radius: 14px;
    margin-top: 1.45rem;
    font-size: 1rem;
    box-shadow: var(--auth-button-shadow, 0 14px 32px rgba(0, 0, 0, 0.18));
}

.auth-box.profile-mode .submit-btn:hover {
    box-shadow: var(--auth-button-hover-shadow, 0 18px 42px rgba(0, 0, 0, 0.22));
    transform: none;
}

@media (max-width: 900px), (max-height: 780px) {
    body.profile-completion-active {
        overflow: auto;
    }

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

    body.profile-completion-active .auth-container {
        justify-content: flex-start;
        margin-top: 0;
        padding-top: 26px;
        padding-bottom: 96px;
        overflow: visible;
    }
}

@media (max-width: 520px) {
    .auth-box.profile-mode {
        max-width: 100%;
    }

    .auth-box.profile-mode .auth-title {
        font-size: 1.78rem;
    }

    .auth-box.profile-mode .phone-row {
        flex-direction: column;
    }

    .phone-country-select {
        flex: 0 0 auto;
    }

    .custom-select-menu {
        display: none;
    }
}

@media (pointer: coarse) and (max-height: 520px) {
    .custom-select-menu {
        display: none;
    }

    .auth-select-sheet {
        width: min(100%, 640px);
        margin-inline: auto;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
        border-radius: 20px 20px 0 0;
    }

    .auth-select-sheet-header {
        min-height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-select-dialog::backdrop,
    .auth-select-dialog.is-closing::backdrop,
    .auth-select-sheet,
    .auth-select-dialog.is-closing .auth-select-sheet {
        animation: none !important;
    }
}
