* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(1200px 700px at 18% 30%, rgba(0, 101, 233, 0.22) 0%, rgba(0, 101, 233, 0.08) 42%, rgba(242, 242, 246, 0) 72%),
                linear-gradient(135deg, #eaf3ff 0%, #f7fbff 48%, #f2f2f6 100%);
    min-height: 100vh;
    color: #1e1e2d;
}

.debug-banner {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 20000;
    background: #111827;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.8px;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    opacity: 0.85;
}

.auth-lang {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 22000;
    display: flex;
    gap: 8px;
}

.auth-lang {
    gap: 0;
    padding: 6px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
}

.auth-lang-btn {
    border: 0;
    background: transparent;
    color: #0f172a;
    font-weight: 800;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    backdrop-filter: blur(10px);
}

.auth-lang-btn:hover {
    background: rgba(2, 6, 23, 0.06);
}

.auth-lang-btn.is-active {
    background: #0065e9;
    color: #ffffff;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-box {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Keep error aligned with centered card width */
#auth-error {
    width: 100%;
    max-width: 520px;
}

/* Страница выбора роли — текст по центру, светлые кнопки и чекбокс */
.auth-panel-select {
    text-align: center;
    margin: 0 auto;
}
.auth-panel-select .auth-panel-select-title,
.auth-panel-select .auth-subtitle {
    text-align: center;
}
.auth-panel-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
    text-align: left;
    width: 100%;
    max-width: 320px; /* same as Continue button */
    margin-left: auto;
    margin-right: auto;
}
.auth-panel-option {
    display: block;
    cursor: pointer;
    margin: 0;
}
.auth-panel-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.auth-panel-option-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    width: 100%;
    background: #fff;
    border: 2px solid #e2e4e8;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #1e1e2d;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.auth-panel-option:hover .auth-panel-option-inner {
    border-color: #c5c8ce;
    background: #f8f9fb;
}
.auth-panel-radio:checked + .auth-panel-option-inner {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}
.auth-panel-option-check {
    width: 22px;
    height: 22px;
    border: 2px solid #c5c8ce;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.auth-panel-radio:checked + .auth-panel-option-inner .auth-panel-option-check {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}
.auth-panel-option-label {
    flex: 1;
}
.btn-panel-continue {
    width: 100%;
    max-width: 320px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
    display: block;
    margin: 0 auto;
    transition: background 0.2s;
}
.btn-panel-continue:hover {
    background: #1d4ed8;
}

.auth-view {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

/* Compatibility: keep legacy auth layout centered too */
#auth-methods {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

#auth-methods > img,
#auth-methods .auth-logo {
    display: block;
    width: 170px;
    height: auto;
    margin: 0 auto 8px;
}

#auth-methods > h1,
#auth-methods .brand-title {
    text-align: center;
    color: #1e1e2d;
    letter-spacing: 1px;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

#auth-methods > .auth-subtitle {
    text-align: center;
    color: #1e1e2d;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: 28px;
}

.auth-logo {
    display: block;
    width: 170px;
    height: auto;
    margin: 0 auto 8px;
    object-fit: contain;
}

.brand-title {
    text-align: center;
    color: #1e1e2d;
    letter-spacing: 1px;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

.auth-subtitle {
    text-align: center;
    color: #1e1e2d;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: 28px;
}

.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-email,
.btn-telegram,
.btn-main-action {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.btn-primary {
    background: #1b1c3c;
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
}

.btn-secondary {
    background: #8f9099;
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
}

.btn-email,
.btn-main-action {
    background: #1b1c3c;
    color: #fff;
}

.btn-email:hover,
.btn-main-action:hover {
    background: #0b61f2;
}

.btn-main-action {
    font-size: 15px;
    font-weight: 600;
}

.btn-main-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-telegram {
    background: #1690d0;
    color: #fff;
    margin-top: 16px;
}

.btn-telegram:hover {
    background: #0f82c0;
}

.auth-or {
    display: flex;
    align-items: center;
    margin: 22px 0;
}

.auth-or::before,
.auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #c9c9cf;
}

.auth-or span {
    padding: 0 14px;
    color: #8e8e96;
    font-size: 16px;
}

/* Обёртка кнопки Google: кастомный вид + невидимая кнопка GSI поверх для выбора аккаунта */
.google-btn-wrapper {
    position: relative;
    width: 100%;
}

.google-signin-overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    cursor: pointer;
    overflow: hidden;
}

.google-signin-overlay > div,
.google-signin-overlay iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 56px !important;
}

/* Кастомная кнопка Google: белая, с рамкой, как на скрине */
.btn-google-wrap {
    width: 100%;
    min-height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-google-custom {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    border: 1px solid #c9c9cf;
    background: #fff;
    color: #1e1e2d;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-google-custom:hover {
    background: #f8f8f8;
    border-color: #b0b0b8;
}

#google-signin-button > div {
    width: 100% !important;
    max-width: 100% !important;
}

#google-signin-button iframe {
    width: 100% !important;
    max-width: 100% !important;
}

.auth-telegram-hint {
    text-align: center;
    margin-top: 8px;
    color: #9d9da3;
    font-size: 13px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.alert-error {
    background: #f9d7db;
    color: #721c24;
}

.view-title {
    text-align: center;
    color: #1e1e2d;
    font-size: 24px;
    font-weight: 700;
    margin: 20px 0 8px;
}

.view-subtitle {
    text-align: center;
    color: #6e6e75;
    font-size: 14px;
    margin-bottom: 20px;
}

.back-arrow {
    background: transparent;
    border: none;
    color: #1e1e2d;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 4px 0;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10001;
}

.input-wrap {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #ececf1;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    margin-bottom: 14px;
}

.input-icon {
    color: #26263f;
    min-width: 24px;
    font-size: 20px;
    text-align: center;
    flex-shrink: 0;
}

.input-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #26263f;
}

.input-icon-char {
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: #26263f;
}

.input-icon-btn {
    padding: 0;
    border: none;
    background: none;
    color: #8e8e96;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-icon-btn:hover {
    color: #26263f;
}

.input-wrap-password {
    padding-right: 8px;
}

.input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #1e1e2d;
    font-size: 16px;
    font-weight: 400;
}

.input-wrap input::placeholder {
    color: #b2b2b8;
    font-size: 16px;
    font-weight: 400;
}

.auth-small-text {
    text-align: center;
    color: #6e6e75;
    font-size: 14px;
    margin: 14px 0;
}

.link-btn {
    border: none;
    background: transparent;
    color: #2f67ff;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.check-wrap {
    display: block;
    color: #64646c;
    font-size: 14px;
    margin: 8px 0;
}

.check-wrap input {
    margin-right: 8px;
}

.check-wrap a {
    color: #2f67ff;
}

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    padding: 20px;
}

.auth-modal-card {
    width: calc(100% - 32px);
    max-width: 420px;
    margin: 16px;
    background: #fff;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Селектор страны: круглый флаг + код, выпадающий список с поиском */
.phone-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #ececf1;
    height: 56px;
    padding: 0 14px;
    margin-bottom: 14px;
    gap: 8px;
}

.phone-country-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px 4px 0;
    border: none;
    background: none;
    color: #1e1e2d;
    font-size: 16px;
    font-weight: 500;
}

.phone-country-trigger .flag-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.phone-country-trigger .flag-emoji {
    font-size: 20px;
    line-height: 1;
}

.phone-country-trigger img.flag-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.phone-country-trigger .chevron {
    font-size: 12px;
    color: #8e8e96;
}

.phone-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #1e1e2d;
    font-size: 16px;
}

.phone-input-wrap input::placeholder {
    color: #b2b2b8;
    font-size: 16px;
    font-weight: 400;
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #ececf1;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 280px;
    overflow: hidden;
    z-index: 100;
    display: none;
}

.country-dropdown.open {
    display: block;
}

.country-search {
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #ececf1;
    width: 100%;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}

.country-list {
    overflow-y: auto;
    max-height: 220px;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 15px;
    color: #1e1e2d;
}

.country-item:hover {
    background: #f2f2f6;
}

.country-item .flag-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.country-item .flag-emoji {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.country-item .dial {
    font-weight: 600;
    min-width: 44px;
}

.phone-wrap-rel {
    position: relative;
    width: 100%;
}

.auth-icon,
.auth-icon-inline {
    flex-shrink: 0;
    vertical-align: middle;
}

.auth-icon-inline {
    display: inline-block;
    margin-right: 6px;
}

@media (max-width: 1024px) {
    .auth-view { max-width: 520px; }
    .brand-title { font-size: 21px; }
    .auth-subtitle { font-size: 17px; }
    .view-title { font-size: 22px; }
    .view-subtitle { font-size: 14px; }
}

@media (max-width: 768px) {
    .auth-container { padding: 20px 10px; }
    .auth-view { max-width: 500px; }
    .auth-logo { width: 140px; }
    .brand-title { font-size: 20px; margin-bottom: 20px; }
    .auth-subtitle { font-size: 16px; margin-bottom: 24px; }
    .btn-email, .btn-telegram, .btn-main-action { height: 54px; font-size: 16px; }
    .view-title { font-size: 22px; }
    .view-subtitle { font-size: 13px; margin-bottom: 18px; }
    .back-arrow { font-size: 26px; }
}

@media (max-width: 480px) {
    .auth-container { padding: 18px 10px; }
    .auth-view { max-width: 360px; }
    .auth-logo { width: 100px; }
    .brand-title { font-size: 18px; margin-bottom: 16px; }
    .auth-subtitle { font-size: 15px; margin-bottom: 20px; }
    .view-title { font-size: 20px; margin-top: 12px; }
    .view-subtitle { font-size: 13px; margin-bottom: 14px; }
    .input-wrap, .phone-input-wrap { height: 50px; border-radius: 12px; margin-bottom: 10px; }
    .input-wrap input { font-size: 16px; }
    .btn-email, .btn-telegram, .btn-main-action { height: 50px; border-radius: 14px; font-size: 16px; }
    .auth-small-text { font-size: 12px; margin: 10px 0; }
    .link-btn { font-size: 12px; }
    .check-wrap { font-size: 12px; margin: 6px 0; }
    .back-arrow { font-size: 24px; margin-bottom: 4px; }
}

/* ============================================
   Wexlet Auth v2 layout (waves + right card)
   Added as overrides to keep JS logic intact
   ============================================ */

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(420px, 560px);
    align-items: stretch;
    overflow: hidden;
}

.auth-shell-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-waves {
    position: absolute;
    inset: -120px -120px -120px -120px;
    width: calc(100% + 240px);
    height: calc(100% + 240px);
    opacity: 0.95;
}

.auth-left {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 48px 56px;
}

.auth-left-inner {
    width: 100%;
    max-width: 560px;
    padding-top: 0;
}

.auth-left-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-left: 0;
}

@media (min-width: 1025px) {
    .auth-left-brand {
        margin-left: 250px;
        margin-top: -30px;
    }
}

.auth-left-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    flex: 0 0 auto;
}

.auth-left-name {
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: 0.2px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 10px 30px rgba(2, 6, 23, 0.22);
}

.auth-right {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* shift auth card left */
    padding: 56px 56px;
    /* shift the whole right column left a bit (desktop) */
    margin-left: -80px;
}

.auth-container {
    min-height: 100vh;
    width: 100%;
    padding: 0;
}

.auth-right .auth-container {
    /* override legacy centering from top of file */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 0;
}

.auth-right .auth-box {
    align-items: flex-start;
    width: 100%;
    /* push card further left inside right column */
    padding-left: 0;
}

.auth-right .auth-view {
    margin: 0;
}

/* Move the whole card stack left (desktop) */
@media (min-width: 1025px) {
    .auth-right .auth-box {
        margin-left: -90px;
    }
}

.auth-view {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 28px 28px 24px;
}

.btn-email,
.btn-main-action {
    background: linear-gradient(180deg, #1a73ff 0%, #0065e9 100%);
}

.btn-email:hover,
.btn-main-action:hover {
    background: linear-gradient(180deg, #0b61f2 0%, #0554c9 100%);
    filter: none;
}

.back-arrow {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 4;
}

@media (max-width: 1024px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-left { display: none; }
    .auth-right {
        margin-left: 0;
        justify-content: center;
        padding: 28px 18px;
    }
    .auth-right .auth-container {
        justify-content: center;
        align-items: center;
    }
    .auth-right .auth-box {
        align-items: center;
        margin-left: 0 !important;
        max-width: 520px;
    }
    .auth-right .auth-view {
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-right { padding: 20px 12px; }
}

/* Success / info toasts (Wexlet admin-style, без системного alert) */
.auth-toast-host {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 25000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.auth-toast {
    pointer-events: auto;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #1e1e2d;
    background: #fff;
    border-left: 4px solid #1B1C3C;
    box-shadow: 0 8px 28px rgba(27, 28, 60, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: auth-toast-in 0.28s ease-out;
}
.auth-toast.auth-toast-success {
    border-left-color: #16a34a;
}
.auth-toast.auth-toast-info {
    border-left-color: #0065e9;
}
@keyframes auth-toast-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}
