/* assets/auth.css */

/* Базовые цвета страниц входа и регистрации */
:root {
    --auth-purple: #7457e8;
    --auth-pink: #ff007f;
    --auth-cyan: #00f5d4;
    --auth-bg: #0b0c10;
    --auth-card: rgba(31, 40, 51, 0.78);
    --auth-input: #11141d;
    --auth-text: #fff;
    --auth-muted: #b3aec9;
}

body.auth-page,
body.auth-page * {
    box-sizing: border-box;
}

/*
 * Важно: column ставит основной контент и подвал
 * друг под другом, а не рядом.
 */
body.auth-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: Inter, Arial, sans-serif;
}

/* Фоновый градиент */
body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 90% 12%,
            rgba(255, 0, 127, 0.11),
            transparent 35%
        ),
        radial-gradient(
            circle at 8% 90%,
            rgba(0, 245, 212, 0.08),
            transparent 35%
        ),
        linear-gradient(
            125deg,
            #0b0c10 0%,
            #15101b 48%,
            #0b1115 100%
        );
}

/* Убираем возможное свечение из старого оформления */
body.auth-page::after {
    content: none;
}

/*
 * Основной контейнер занимает всю ширину.
 * Сброс max-width и margin важен: эти свойства заданы inline в layout.php.
 */
body.auth-page > main.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 0 auto;
    align-items: flex-start;
    justify-content: center;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding:
        max(20px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        24px
        max(16px, env(safe-area-inset-left)) !important;
}

/* Подвал регистрации — отдельная строка под формой */
body.auth-register-page > footer.footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    padding:
        14px
        max(16px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left)) !important;
    color: #9290a2 !important;
    font-size: 13px;
    line-height: 1.65;
    text-align: center;
}

body.auth-register-page > footer.footer a {
    color: #a892ff !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Общая карточка формы */
.auth-card {
    width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    background: var(--auth-card);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
}

/* Регистрация */
.auth-register-shell {
    width: 100%;
    max-width: 560px;
    min-width: 0;
    margin: auto;
    padding: 0;
}

.auth-register-shell .auth-card {
    max-width: 560px;
    padding: clamp(20px, 5vw, 32px);
}

.auth-register-shell h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(23px, 5vw, 28px);
    line-height: 1.25;
    text-align: center;
}

.auth-register-shell .auth-subtitle {
    margin: 10px 0 24px;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

/* Заголовки, поля и подписи регистрации */
.auth-register-shell .auth-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.auth-register-shell .auth-field label {
    min-width: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.auth-register-shell .auth-field input,
.auth-register-shell .auth-field select,
.auth-register-shell .auth-location input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    outline: none;
    background: var(--auth-input);
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    box-shadow: none;
}

.auth-register-shell .auth-field input:focus,
.auth-register-shell .auth-field select:focus,
.auth-register-shell .auth-location input:focus {
    border-color: #b8a5ff;
    box-shadow: 0 0 0 3px rgba(116, 87, 232, 0.2);
}

.auth-register-shell .auth-field input::placeholder {
    color: #858392;
    opacity: 1;
}

/* Не допускаем жёлтую/светлую заливку автозаполнения браузера */
.auth-register-shell input:-webkit-autofill,
.auth-register-shell input:-webkit-autofill:hover,
.auth-register-shell input:-webkit-autofill:focus,
.auth-shell input:-webkit-autofill,
.auth-shell input:-webkit-autofill:hover,
.auth-shell input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #11141d inset;
    caret-color: #fff;
    transition: background-color 9999s ease-out;
}

/* Поля «Возраст / Ваш пол» */
.auth-register-shell .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.auth-register-shell .form-grid > * {
    min-width: 0;
}

/* Блок выбора локации */
.auth-register-shell .auth-location {
    width: 100%;
    min-width: 0;
    padding: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    background: rgba(11, 12, 16, 0.32) !important;
}

.auth-register-shell .auth-location legend {
    max-width: 100%;
    padding: 0 6px !important;
    color: var(--auth-cyan) !important;
    font-size: 14px !important;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.auth-register-shell .auth-location input {
    margin: 0 !important;
}

/* Согласие: чекбокс и текст остаются рядом, текст не сжимается */
.auth-register-shell .auth-consent {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start !important;
    gap: 10px !important;
    min-width: 0;
    margin-top: 16px !important;
}

.auth-register-shell .auth-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0 !important;
    accent-color: var(--auth-cyan);
}

.auth-register-shell .auth-consent label {
    min-width: 0;
    color: #c6c2d1 !important;
    font-size: 14px !important;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* Кнопки шагов регистрации */
.auth-register-shell .auth-button {
    min-width: 0;
    min-height: 52px;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

.auth-register-shell .auth-button:focus-visible,
.auth-shell button:focus-visible,
.auth-shell a:focus-visible {
    outline: 3px solid rgba(0, 245, 212, 0.75);
    outline-offset: 3px;
}

/* Вход — сохраняем карточку и комфортную ширину */
.auth-shell {
    width: 100%;
    max-width: 480px;
    min-width: 0;
    margin: auto;
    padding: 0;
}

.auth-shell .auth-card {
    width: 100%;
    padding: clamp(22px, 5vw, 35px);
}

.auth-brand-title {
    color: #fff;
    font-family: Montserrat, Inter, Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.auth-shell .auth-subtitle {
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.auth-field-block {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-label {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.auth-input-neon {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    outline: none;
    background: rgba(11, 12, 16, 0.8);
    color: #fff;
    font: inherit;
    font-size: 16px;
}

.auth-input-neon:focus {
    border-color: var(--auth-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.14);
}

.btn-neon-purple,
.btn-neon-cyan {
    width: 100%;
    min-height: 50px;
    padding: 13px 16px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-neon-purple {
    background: linear-gradient(110deg, #7359c7, #a35fba);
}

.btn-neon-cyan {
    background: linear-gradient(110deg, #00d9c0, #7359c7);
    color: #10131a;
}

.btn-link-gray {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
    text-decoration: none;
}

/* На узких экранах форма не прижимается к краям */
@media (max-width: 600px) {
    body.auth-page > main.container {
        padding:
            max(12px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            18px
            max(12px, env(safe-area-inset-left)) !important;
    }

    .auth-register-shell,
    .auth-shell {
        width: 100%;
        max-width: 480px;
    }

    .auth-register-shell .auth-card,
    .auth-shell .auth-card {
        border-radius: 20px;
    }

    body.auth-register-page > footer.footer {
        padding-top: 10px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .auth-register-shell .auth-card {
        padding: 18px 14px;
    }

    .auth-register-shell .form-grid {
        gap: 8px !important;
    }

    .auth-register-shell .form-grid label {
        font-size: 14px;
    }

    .auth-register-shell .auth-button {
        padding: 11px 9px !important;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.auth-page *,
    body.auth-page *::before,
    body.auth-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}