/* ==========================================
AUTH v3 — стекло, неон, страницы восстановления
========================================== */
@keyframes auIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Сцена ---------- */
.au-page {
    position: relative;
    min-height: calc(100vh - 68px);
    display: flex; align-items: center; justify-content: center;
    padding: 60px 20px;
    box-sizing: border-box;
}
.au-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}
.au-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: url('/static/images/banner_main.avif') center / cover no-repeat;
    background-attachment: fixed;
    filter: brightness(.8) saturate(1.1);
}
.au-bg::after {
    content: '';
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, rgba(13,14,17,.30) 0%, rgba(13,14,17,.45) 55%, rgba(10,10,10,.94) 100%);
}

/* ---------- Карточка ---------- */
.auth-box {
    position: relative; z-index: 2;
    width: min(470px, 100%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 30px 38px;
    background: rgba(13,14,17,.78);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,77,109,.4);
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(255,77,109,.12);
    animation: auIn .5s ease both;
    transition: height .35s ease;
}
.auth-box.au-narrow { width: min(450px, 100%); }

/* ---------- Плашка-уведомление (ВСЕГДА блок, над табами) ---------- */
.au-notice {
    display: block;
    border-radius: 10px; padding: 12px 14px;
    font-size: 12.5px; line-height: 1.55;
    border: 1px solid; margin: 0 0 20px;
    animation: auIn .4s ease both;
}
.au-notice.ok { color: #4ade80; border-color: rgba(74,222,128,.45); background: rgba(74,222,128,.08); }
.au-notice.err { color: #f87171; border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.08); }

/* ---------- Табы ---------- */
.au-tabs { display: flex; justify-content: center; gap: 56px; margin-bottom: 26px; }
.au-tab {
    position: relative;
    font-size: 20px; font-weight: 700; letter-spacing: .3px;
    color: #8b8e98; cursor: pointer; user-select: none;
    padding: 8px 6px 12px;
    transition: color .25s ease;
}
.au-tab:hover { color: #c9ccd4; }
.au-tab.active-text { color: #fff; }
.au-tab.active-text::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 3px; background: #ff4d6d;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 10px rgba(255,77,109,.8), 0 -1px 14px rgba(255,77,109,.45);
}

/* ---------- Заголовки страниц восстановления ---------- */
.au-title {
    font-size: 24px; font-weight: 800; color: #fff; text-align: center;
    margin: 4px 0 10px; letter-spacing: .3px;
    text-shadow: 0 0 18px rgba(255,77,109,.35);
}
.au-sub { font-size: 12.5px; color: #8b8e98; text-align: center; line-height: 1.6; margin: 0 0 24px; }

/* ---------- Контейнер форм (плавная высота, вкладка auth) ---------- */
.forms-wrapper { position: relative; width: 100%; overflow: hidden; transition: height .35s cubic-bezier(0.4, 0, 0.2, 1); }
.auth-form {
    position: absolute; top: 0; left: 0; width: 100%;
    display: flex; flex-direction: column; gap: 16px;
    opacity: 0; transform: translateY(20px); pointer-events: none;
    transition: opacity .35s cubic-bezier(0.4, 0, 0.2, 1), transform .35s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-form.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.auth-form.leaving { opacity: 0; transform: translateY(-20px); pointer-events: none; }

/* ---------- Обычная форма (страницы восстановления): ОТСТУПЫ ---------- */
.au-form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Поля ---------- */
.input-group { display: flex; flex-direction: column; }
.input-group label { font-size: 13px; font-weight: 600; color: #e8e8ec; margin-bottom: 8px; }
.au-field { position: relative; display: flex; align-items: center; }
.au-ico { position: absolute; left: 14px; width: 18px; height: 18px; display: flex; color: #ff4d6d; pointer-events: none; }
.au-ico svg { width: 100%; height: 100%; }
.au-field input {
    width: 100%; box-sizing: border-box;
    font-family: 'MyCustomFont'; font-size: 14px; color: #fff;
    background: rgba(32,33,42,.85);
    border: 1px solid #2c2e36; border-radius: 10px;
    padding: 13px 14px 13px 42px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.au-field.eye input { padding-right: 46px; }
.au-field input::placeholder { color: #5d6068; }
.au-field input:focus { border-color: rgba(255,77,109,.65); box-shadow: 0 0 0 3px rgba(255,77,109,.12); background: #20212a; }
/* Chrome-автозаполнение: тёмное, а не белое */
.au-field input:-webkit-autofill,
.au-field input:-webkit-autofill:hover,
.au-field input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #20212a inset;
    box-shadow: 0 0 0 1000px #20212a inset;
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    transition: background-color 99999s ease-out;
}

/* ---------- Глаз «показать пароль» ---------- */
.show-password-btn {
    position: absolute; right: 10px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    padding: 4px; color: #8b8e98; opacity: .75;
    transition: color .2s ease, opacity .2s ease;
}
.show-password-btn:hover { color: #ff8fa3; opacity: 1; }
.show-password-btn svg { width: 20px; height: 20px; pointer-events: none; }
.eye-slash { stroke-dasharray: 24; stroke-dashoffset: 0; transition: stroke-dashoffset .35s ease; }
.show-password-btn.revealed .eye-slash { stroke-dashoffset: 24; }
.eye-pupil { transform-box: fill-box; transform-origin: center; transition: transform .35s ease; }
.show-password-btn:not(.revealed) .eye-pupil { transform: scale(0.5); }
.show-password-btn.revealed { opacity: 1; color: #ff8fa3; }
input[type="password"]::-ms-reveal { display: none; }

/* ---------- Ошибки ---------- */
.password-error { color: #f87171; font-size: 12px; margin: 7px 2px 0; display: none; }
.error-message {
    color: #f87171; font-size: 12.5px; text-align: center; margin: -4px 0 0;
    opacity: 0; transform: translateY(-4px);
    transition: opacity .25s ease, transform .25s ease;
}
.error-message.visible { opacity: 1; transform: translateY(0); }
.error-message:empty { display: none; }

/* ---------- Согласие ---------- */
.au-agree { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin-top: 2px; }
.au-agree input { accent-color: #ff4d6d; width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; cursor: pointer; }
.au-agree span { font-size: 12.5px; color: #c9ccd4; line-height: 1.45; }
.au-agree a { color: #ff4d6d; text-decoration: underline; text-underline-offset: 2px; }
.au-agree a:hover { color: #ff8fa3; }

/* ---------- Кнопка отправки (outline-неон) ---------- */
.button-one.au-submit {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: 'MyCustomFont'; font-size: 15px; font-weight: 700;
    color: #ff4d6d;
    background: rgba(255,77,109,.04);
    border: 1.5px solid #ff4d6d; border-radius: 10px;
    padding: 13px 18px;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(255,77,109,.35), inset 0 0 12px rgba(255,77,109,.10);
    transition: all .25s ease;
    margin-top: 4px;
}
.button-one.au-submit svg { width: 16px; height: 16px; transition: transform .2s ease; }
.button-one.au-submit:hover {
    background: rgba(255,77,109,.12); color: #fff;
    box-shadow: 0 0 24px rgba(255,77,109,.5), inset 0 0 16px rgba(255,77,109,.16);
    transform: translateY(-1px);
}
.button-one.au-submit:hover svg { transform: translateX(3px); }
.button-one.au-submit:disabled { opacity: .5; cursor: default; transform: none; }

/* ---------- Разделитель ---------- */
.au-divider { display: flex; align-items: center; gap: 12px; color: #6f727c; font-size: 11.5px; margin: 4px 0; }
.au-divider::before, .au-divider::after { content: ''; flex: 1; height: 1px; background: #2c2e36; }

/* ---------- Google ---------- */
.au-google {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: 'MyCustomFont'; font-size: 13.5px; font-weight: 600; color: #c9ccd4;
    background: rgba(32,33,42,.85); border: 1px solid #2c2e36; border-radius: 10px;
    padding: 12px 16px; cursor: pointer;
    transition: all .2s ease;
}
.au-google:hover { border-color: #3a3d46; color: #fff; background: #20212a; }

/* ---------- Нижний переключатель / забыли пароль ---------- */
.au-switch { text-align: center; font-size: 13px; color: #8b8e98; margin-top: 6px; }
.auth-box > .au-switch { margin-top: 20px; }
.au-switch a {
    color: #ff4d6d; font-weight: 700; text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
    transition: color .2s ease;
}
.au-switch a svg { width: 14px; height: 14px; transition: transform .2s ease; }
.au-switch a:hover { color: #ff8fa3; }
.au-switch a:hover svg { transform: translateX(3px); }
.au-forgot { margin-top: 8px; text-align: right; }
.au-forgot a { color: rgba(255,255,255,.4); font-size: 12px; text-decoration: none; transition: color .2s ease; }
.au-forgot a:hover { color: #ff8fa3; }

/* ---------- Dev-ссылка (письмо не ушло) ---------- */
.au-devlink {
    display: flex; flex-direction: column; gap: 6px;
    background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.4);
    border-radius: 10px; padding: 12px 14px;
    font-size: 12px; color: #fbbf24; line-height: 1.5;
}
.au-devlink b { font-size: 12.5px; }
.au-devlink a { color: #ffd3db; word-break: break-all; text-decoration: underline; text-underline-offset: 2px; }
.au-devlink a:hover { color: #fff; }

/* ---------- Адаптив ---------- */
@media (max-width: 560px) {
    .au-page {
        padding: 24px 12px 24px !important;
        min-height: auto !important;
        flex: 1 0 auto !important;
        align-items: center !important;
    }
    .auth-box {
        width: min(340px, 92vw) !important;
        padding: 18px 16px 18px !important;
        border-radius: 16px !important;
        margin: 0 auto !important;
    }
    .au-tabs {
        gap: 20px !important;
        margin-bottom: 14px !important;
    }
    .au-tab {
        font-size: 15px !important;
        padding: 4px 6px 8px !important;
    }
    .auth-form {
        gap: 11px !important;
    }
    .input-group label {
        font-size: 11.5px !important;
        margin-bottom: 4px !important;
    }
    .au-field input {
        font-size: 13px !important;
        padding: 9px 12px 9px 36px !important;
        border-radius: 9px !important;
    }
    .au-field.eye input {
        padding-right: 38px !important;
    }
    .au-ico {
        left: 11px !important;
        width: 15px !important;
        height: 15px !important;
    }
    .show-password-btn {
        right: 8px !important;
    }
    .show-password-btn svg {
        width: 17px !important;
        height: 17px !important;
    }
    .au-forgot {
        margin-top: 4px !important;
    }
    .au-forgot a {
        font-size: 11px !important;
    }
    .button-one.au-submit {
        padding: 9px 14px !important;
        font-size: 13.5px !important;
        min-height: 40px !important;
        margin-top: 3px !important;
        border-radius: 9px !important;
    }
    .au-divider {
        margin: 2px 0 !important;
        font-size: 11px !important;
    }
    .au-google {
        padding: 9px 14px !important;
        font-size: 12.5px !important;
        min-height: 38px !important;
        border-radius: 9px !important;
    }
    .au-switch {
        font-size: 12px !important;
        margin-top: 4px !important;
    }
    .auth-box > .au-switch {
        margin-top: 14px !important;
    }
    .au-agree span {
        font-size: 11px !important;
    }
    .au-notice {
        padding: 9px 12px !important;
        font-size: 11.5px !important;
        margin-bottom: 12px !important;
    }
    .au-title {
        font-size: 20px !important;
    }
}

/* ---------- Собственная графическая капча (жест / рисование) ---------- */
.auth-captcha-group {
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
}
.auth-captcha-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(22, 24, 33, 0.85);
    border: 1px solid rgba(255, 77, 109, 0.28);
    border-radius: 12px;
    padding: 9px 12px;
    margin-bottom: 8px;
}
.auth-captcha-icon {
    width: 26px;
    height: 26px;
    color: #00f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}
.auth-captcha-icon svg {
    width: 100%;
    height: 100%;
}
.auth-captcha-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.auth-captcha-task {
    font-size: 13px;
    font-weight: 700;
    color: #00f0ff;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-captcha-sub {
    font-size: 10.5px;
    color: #94a3b8;
    line-height: 1.2;
}
.auth-captcha-reload-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.auth-captcha-reload-btn:hover {
    background: rgba(255, 77, 109, 0.15);
    border-color: rgba(255, 77, 109, 0.4);
    color: #ff4d6d;
    transform: rotate(90deg);
}

.auth-canvas-container {
    position: relative;
    width: 100%;
    height: 140px;
    background: #090a0f;
    border: 1.5px dashed rgba(255, 77, 109, 0.32);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.7);
    margin-bottom: 8px;
    transition: border-color 0.25s, box-shadow 0.25s;
    cursor: crosshair;
}
.auth-canvas-container.drawing {
    border-color: #00f0ff;
    box-shadow: inset 0 0 16px rgba(0, 240, 255, 0.15), 0 0 14px rgba(0, 240, 255, 0.25);
}
.auth-canvas-container.verified {
    border-color: #10b981;
    border-style: solid;
    box-shadow: inset 0 0 16px rgba(16, 185, 129, 0.15), 0 0 14px rgba(16, 185, 129, 0.3);
}

.auth-canvas-container canvas {
    display: block;
    width: 100%;
    height: 140px;
    touch-action: none;
}

.auth-canvas-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.28);
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    transition: opacity 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 90%;
}
.auth-canvas-hint svg {
    opacity: 0.45;
}
.auth-canvas-hint.hidden {
    opacity: 0;
}

.auth-canvas-status {
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.auth-canvas-status.visible {
    opacity: 1;
}
.auth-canvas-status.ok {
    color: #10b981;
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}
.auth-canvas-status.err {
    color: #f87171;
    text-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

.auth-canvas-gen-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 10, 15, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-canvas-gen-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-canvas-gen-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 240, 255, 0.12);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
    transition: all 0.2s ease;
}

.auth-canvas-gen-btn:hover {
    background: rgba(0, 240, 255, 0.22);
    border-color: #00f0ff;
    color: #fff;
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.45);
    transform: scale(1.02);
}

.auth-canvas-gen-btn:active {
    transform: scale(0.97);
}

.auth-canvas-gen-btn svg {
    flex-shrink: 0;
}

.auth-captcha-actions {
    display: flex;
    gap: 8px;
}
.auth-captcha-btn {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
}
.auth-captcha-btn.clear {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 0 0 85px;
}
.auth-captcha-btn.clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.auth-captcha-btn.verify {
    flex: 1;
    background: rgba(0, 240, 255, 0.12);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}
.auth-captcha-btn.verify:hover {
    background: rgba(0, 240, 255, 0.22);
    color: #fff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}
.auth-captcha-btn.verify.verified {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
    cursor: default;
}
.auth-captcha-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

