/* ==========================================================
   luxKino — вход / регистрация
   ========================================================== */

:root {
    --au-text: #f3fff0;
    --au-mute: #8d9f89;
    --au-line: rgba(190, 255, 90, .16);
    --au-line-strong: rgba(190, 255, 90, .45);
    --au-g1: #e3ff5c;
    --au-g2: #8fe82c;
    --au-g3: #25b94a;
    --au-grad: linear-gradient(135deg, var(--au-g1) 0%, var(--au-g2) 48%, var(--au-g3) 100%);
    --au-on-grad: #05140a;
    --au-ease: cubic-bezier(.22, .8, .28, 1);
    --au-font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --au-display: 'Unbounded', 'Onest', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: #020503; }

body.au-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(72px, 9vh, 96px) 16px 40px;
    font-family: var(--au-font);
    color: var(--au-text);
    background: transparent;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* фон: чёрно-зелёный градиент, закреплён */
body.au-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(900px 620px at 0% 0%, rgba(70, 180, 40, .26), transparent 65%),
        radial-gradient(800px 620px at 100% 40%, rgba(30, 150, 75, .18), transparent 65%),
        radial-gradient(900px 700px at 20% 100%, rgba(130, 225, 40, .14), transparent 65%),
        linear-gradient(180deg, #030704 0%, #010201 100%);
}
/* мягкая «дышащая» подсветка за карточкой */
body.au-page::after {
    content: '';
    position: fixed;
    left: 50%; top: 50%;
    width: min(680px, 120vw);
    height: min(680px, 120vw);
    z-index: -1;
    pointer-events: none;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(143, 232, 44, .20), transparent 68%);
    animation: au-pulse 7s ease-in-out infinite;
}

/* ---------- Кнопка «закрыть» ---------- */
.au-close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    border: 1px solid var(--au-line);
    background: rgba(8, 12, 8, .65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--au-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .3s var(--au-ease), background .3s, color .3s, border-color .3s, box-shadow .3s;
}
.au-close svg { width: 20px; height: 20px; transition: transform .4s var(--au-ease); }
.au-close:hover {
    background: var(--au-grad);
    color: var(--au-on-grad);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 12px 34px -8px rgba(120, 230, 40, .6);
}
.au-close:hover svg { transform: rotate(90deg); }
.au-close:active { transform: scale(.96); }

/* ---------- Карточка ---------- */
.au-wrap {
    position: relative;
    width: 100%;
    max-width: 456px;
    animation: au-rise .7s var(--au-ease) both;
}

.au-card {
    position: relative;
    padding: clamp(24px, 5vw, 38px);
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(18, 26, 18, .88) 0%, rgba(7, 10, 7, .92) 100%);
    border: 1px solid var(--au-line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 40px 90px -30px rgba(0, 0, 0, .95),
        0 0 80px -30px rgba(143, 232, 44, .45),
        inset 0 1px 0 rgba(255, 255, 255, .06);
    overflow: hidden;
    z-index: 2;
}
/* зелёный блик по верхнему краю */
.au-card::before {
    content: '';
    position: absolute;
    left: 12%; right: 12%; top: 0;
    height: 2px;
    background: var(--au-grad);
    filter: blur(.5px);
    box-shadow: 0 0 24px 2px rgba(143, 232, 44, .6);
}

/* ---------- Декор ---------- */
.au-deco {
    position: absolute;
    width: var(--s, 48px);
    height: var(--s, 48px);
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 8px 14px rgba(110, 220, 40, .45));
    transform: rotate(var(--r, 0deg));
    animation: au-float 6s ease-in-out infinite;
    animation-delay: var(--dl, 0s);
}
.au-deco--blur { filter: blur(3px) drop-shadow(0 8px 14px rgba(110, 220, 40, .35)); opacity: .85; }
.au-deco--back { z-index: 1; }

/* ---------- Логотип ---------- */
.au-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
    text-decoration: none;
}
.au-logo img {
    display: block;
    height: clamp(44px, 9vw, 56px);
    width: auto;
    max-width: 78%;
    object-fit: contain;
    filter: drop-shadow(0 6px 22px rgba(143, 232, 44, .35));
}
.au-logo-text {
    display: none;
    font-family: var(--au-display);
    font-weight: 900;
    font-size: 30px;
    letter-spacing: -.02em;
    background: var(--au-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.au-title {
    margin: 0 0 6px;
    text-align: center;
    font-family: var(--au-display);
    font-weight: 800;
    font-size: clamp(20px, 5vw, 25px);
    letter-spacing: -.02em;
    line-height: 1.15;
}
.au-sub {
    margin: 0 0 24px;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    color: var(--au-mute);
}

/* ---------- Переключатель Вход / Регистрация ---------- */
.au-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 5px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--au-line);
}
.au-tabs::before {
    content: '';
    position: absolute;
    top: 5px; bottom: 5px; left: 5px;
    width: calc(50% - 5px);
    border-radius: 12px;
    background: var(--au-grad);
    box-shadow: 0 8px 24px -8px rgba(120, 230, 40, .7);
    transition: transform .45s var(--au-ease);
}
.au-tabs[data-mode="register"]::before { transform: translateX(100%); }
.au-tab {
    position: relative;
    z-index: 1;
    padding: 12px 8px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    color: #bfd0ba;
    transition: color .3s;
}
.au-tab:hover { color: #fff; }
.au-tab.is-active, .au-tab.is-active:hover { color: var(--au-on-grad); }

/* ---------- Ошибка ---------- */
.au-alert {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 107, 107, .4);
    background: rgba(255, 70, 70, .10);
    color: #ffb3b3;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    animation: au-shake .5s var(--au-ease);
}

/* ---------- Форма ---------- */
.au-field { margin-bottom: 16px; }
.au-label {
    display: block;
    margin: 0 0 8px 2px;
    font-size: 13px;
    font-weight: 700;
    color: #c4d6bf;
}
.au-input-wrap { position: relative; }
.au-input {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid var(--au-line);
    background: rgba(255, 255, 255, .045);
    color: var(--au-text);
    font-family: inherit;
    font-size: 16px;               /* 16px — чтобы iOS не приближал страницу при вводе */
    font-weight: 500;
    outline: none;
    transition: border-color .25s, background .25s, box-shadow .25s;
}
.au-input::placeholder { color: #5f7059; }
.au-input:hover { border-color: rgba(190, 255, 90, .28); }
.au-input:focus {
    border-color: var(--au-g2);
    background: rgba(143, 232, 44, .06);
    box-shadow: 0 0 0 4px rgba(143, 232, 44, .16);
}
.au-input--pw { padding-right: 56px; }

.au-eye {
    position: absolute;
    right: 6px; top: 50%;
    width: 42px; height: 42px;
    margin-top: -21px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--au-mute);
    cursor: pointer;
    transition: color .25s, background .25s;
}
.au-eye:hover { color: var(--au-g1); background: rgba(255, 255, 255, .06); }
.au-eye svg { width: 22px; height: 22px; }
.au-eye .off { display: none; }
.au-eye.is-on .on { display: none; }
.au-eye.is-on .off { display: block; }

/* автозаполнение браузера не должно ломать тёмную тему */
.au-input:-webkit-autofill,
.au-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--au-text);
    -webkit-box-shadow: 0 0 0 1000px #0e140e inset;
    caret-color: var(--au-text);
    transition: background-color 9999s;
}

/* ---------- Кнопка ---------- */
.au-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    margin-top: 8px;
    border: 0;
    border-radius: 16px;
    background: var(--au-grad);
    color: var(--au-on-grad);
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(190, 255, 90, .35), 0 14px 40px -10px rgba(120, 230, 40, .55);
    transition: transform .3s var(--au-ease), box-shadow .3s var(--au-ease);
}
.au-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: au-shine 3.6s ease-in-out infinite;
}
.au-submit:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(190, 255, 90, .6), 0 20px 50px -8px rgba(120, 230, 40, .7); }
.au-submit:active { transform: scale(.98); }
.au-submit.is-busy { pointer-events: none; opacity: .75; }
.au-submit.is-busy::before {
    content: '';
    width: 18px; height: 18px;
    margin-right: 10px;
    border-radius: 50%;
    border: 3px solid rgba(5, 20, 10, .3);
    border-top-color: var(--au-on-grad);
    animation: au-spin .7s linear infinite;
}

/* ---------- Назад ---------- */
.au-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--au-mute);
    text-decoration: none;
    transition: color .25s, gap .25s var(--au-ease);
}
.au-back svg { width: 18px; height: 18px; }
.au-back:hover { color: var(--au-g1); gap: 12px; }

.au-focus-ring a:focus-visible, .au-page a:focus-visible, .au-page button:focus-visible {
    outline: 2px solid var(--au-g2);
    outline-offset: 3px;
}

/* ---------- Анимации ---------- */
@keyframes au-rise  { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes au-float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-10px) rotate(calc(var(--r, 0deg) + 7deg)); } }
@keyframes au-pulse { 0%, 100% { opacity: .65; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } }
@keyframes au-shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes au-spin  { to { transform: rotate(360deg); } }
@keyframes au-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ---------- Телефон ---------- */
@media (max-width: 520px) {
    body.au-page { place-items: start center; padding-top: 84px; padding-bottom: 28px; }
    .au-card { border-radius: 24px; }
    .au-close { height: 44px; padding: 0 14px 0 12px; font-size: 13px; }
    .au-deco { --s: 38px !important; }
}
@media (max-height: 640px) and (min-width: 521px) {
    body.au-page { place-items: start center; }
}

@media (prefers-reduced-motion: reduce) {
    .au-page *, .au-page *::before, .au-page *::after { animation: none !important; transition-duration: .01ms !important; }
}