/* Подключение шрифта Audiowide */
@font-face {
    font-family: 'Audiowide';
    src: url('../fonts/Audiowide.woff2') format('woff2'),
        url('../fonts/Audiowide.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: #000000;
    color: #FFFFFF;
    overflow-x: hidden;
}

.background {
    min-height: 100vh;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ---------- адаптивные фоновые круги ---------- */
:root {
    /* легко менять радиус сразу для обеих фигур */
    --circle-size: 100vmax;
    /* всегда ≥ высоты окна и ≥ ширины */
    --blur: 120px;
}

/* обе фигуры получают одинаковую основу */
.blur-circle-left,
.blur-circle-right {
    position: fixed;
    /* привязаны к окну, а не к .background */
    top: 50%;
    width: var(--circle-size);
    height: var(--circle-size);
    border-radius: 50%;
    transform: translateY(-50%);
    /* центр по вертикали */
    filter: blur(var(--blur));
    opacity: .8;
    pointer-events: none;
    /* не перехватывают клики */
    z-index: 1;
    /* под оверлеем, но над чистым фоном */
}

/* индивидуальные отличия */
.blur-circle-left {
    left: calc(-0.7 * var(--circle-size));
    /* половина круга скрыта левее */
    background: #000000;
    /* чёрный «глубокий» оттенок */
}

.blur-circle-right {
    right: calc(-0.7 * var(--circle-size));
    /* половина круга скрыта правее */
    background: #03b3ff7e;
    /* бирюзовый свет */
}

/* ---------- адаптивный фон-текст ---------- */
.background-text {
    position: fixed;
    /* вместе с кругами закреплён */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 0;
    /* под кругами, чтобы лёгкий туман их «размыл» */
    pointer-events: none;
}

.ursa {
    font-family: 'Audiowide', sans-serif;
    font-size: clamp(8rem, 25vw, 30rem);
    /* 6rem ←→ 20rem в зависимости от окна */
    color: rgba(163, 163, 163, 0.76);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1;
    display: block;
}

.invest {
    font-family: 'Audiowide', sans-serif;
    font-size: clamp(1.5rem, 4vw, 4rem);
    color: rgba(159, 159, 159, 0.751);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: .5em;
    display: block;
}



.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
    /* Поверх кругов */
}

.container {
    position: relative;
    z-index: 4;
    width: 90%;
    max-width: 400px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.content-box {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- стекло-матовое оформление формы ---------- */
.form-wrapper {
    background: rgba(255, 255, 255, 0.06);
    /* лёгкая “молочная” вуаль */
    border: 1px solid rgba(255, 255, 255, 0.18);
    /* тонкая «ледяная» рамка */
    border-radius: 20px;
    padding: 45px 35px;
    /* внутр. отступы вместо margin у h2 и полей */
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
    /* мягкая тень вокруг стекла */

    /* главный эффект: размывает всё, что ПОД этим блоком */
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);

    /* лёгкая полупрозрачная белая линия внутри (необязательный штрих) */
    position: relative;
}

.form-wrapper::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 19px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, .2) 0%,
            rgba(255, 255, 255, .05) 100%);
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* чтобы элементы не прилипали к стенкам стекла на узких экранах */
@media(max-width:480px) {
    .form-wrapper {
        padding: 35px 25px;
    }
}


.form-box {
    width: 100%;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.form-box h2,
.form-box .input-group,
.form-box .btn,
.form-box .switch {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-box.hidden h2,
.form-box.hidden .input-group,
.form-box.hidden .btn,
.form-box.hidden .switch {
    opacity: 0;
    transform: translateY(20px);
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 10px 0;
}

.input-group {
    margin-bottom: 15px;
    position: relative;
}

input {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid #4A4A4A;
    background: transparent;
    color: #FFFFFF;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-bottom-color: #D4A017;
}

input::placeholder {
    color: #AAAAAA;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #D4A017;
    border: none;
    border-radius: 3px;
    color: #121212;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #E5B528;
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.5);
}

.switch {
    margin-top: 10px;
    font-size: 1rem;
    color: #AAAAAA;
}

.switch a {
    color: #D4A017;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.switch a:hover {
    color: #E5B528;
}

.error {
    color: #FF5555;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.success {
    color: #55FF55;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    h2 {
        font-size: 1.8rem;
    }

    input,
    .btn {
        font-size: 1rem;
    }

    .content-box {
        margin-top: 30px;
    }

    .blur-circle-left {
        width: 100vh;
        height: 100vh;
        left: -50%;
    }

    .blur-circle-right {
        width: 100vh;
        height: 100vh;
        right: -50%;
    }

    .ursa {
        font-size: 12rem;
    }

    .invest {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.6rem;
    }

    .content-box {
        width: 95%;
        margin-top: 20px;
    }

    .blur-circle-left {
        width: 100vh;
        height: 100vh;
        left: -50%;
    }

    .blur-circle-right {
        width: 100vh;
        height: 100vh;
        right: -50%;
    }

    .ursa {
        font-size: 7rem;
    }

    .invest {
        font-size: 1.2rem;
    }
}

/* ---------- звёздное небо ---------- */
.starfield {
    position: fixed;
    /* приклеено к экрану */
    inset: 0;
    pointer-events: none;
    /* не ловит клики */
    z-index: 0;
    /* под кругами (z-index:1) */
    overflow: hidden;
}

/* отдельная звезда */
/* ---------- обновлённая "звезда" с плавным дрейфом ---------- */
.star {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #fff;
    border-radius: 40%;
    opacity: .8;
    /* две анимации:
       ① float — индивидуальный дрейф,
       ② twinkle — мерцание (уже есть) */
    animation: float var(--float-dur) linear infinite alternate,
        twinkle var(--twinkle-dur) ease-in-out infinite alternate;
}

/* индивидуальная траектория: 0 → dx,dy → назад */
@keyframes float {
    to {
        transform: translate(var(--dx), var(--dy));
    }
}


/* медленный дрейф в случайном направлении */
@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(var(--tx), var(--ty));
    }

    100% {
        transform: translate(0, 0);
    }
}

/* плавное мерцание */
@keyframes twinkle {

    0%,
    100% {
        opacity: .85;
    }

    50% {
        opacity: .05;
    }
}

/* ---------- DASHBOARD (Обновление) ---------- */

/* контейнер выравниваем по центру */
.content-box.dash-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* сетка 3×2, центрирована */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 350px);
    grid-template-rows: repeat(2, 350px);
    gap: 40px;
    justify-content: center;
    align-content: center;
}

/* карточка */
.card {
    position: relative;
    width: 350px;
    height: 350px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Montserrat', sans-serif;

    /* начало анимации */
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.card.show {
    animation: cardShow .6s cubic-bezier(.25, .46, .45, .94) forwards;
}

@keyframes cardShow {
    to {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

/* тонкий изящный заголовок */
.card-title {
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: .5px;
    margin-bottom: 15px;
    text-align: center;
}

/* квадратная иконка-кнопка */
.icon-btn {
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    /* Прозрачный фон */
    border: none !important;
    /* Без границы */
    border-radius: 12px;
    cursor: pointer;
    transition: transform .2s;
}

.icon-btn:hover {
    transform: scale(1.05);
}

.icon-btn img {
    width: 250px;
    height: 250px;
}

/* а) визуально тушим кнопку */
.icon-btn.need-premium {
    opacity: .35;
    cursor: not-allowed;
}

.icon-btn.need-premium:hover {
    transform: none;
}

/* б) для полной блокировки кликов, если вдруг забудут JS */
.icon-btn.disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* серый текст «В разработке» */
.in-progress {
    margin-top: 15px;
    font-size: .9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ---------- АККАУНТ ---------- */
#card-account .avatar-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    margin-bottom: 10px;
}

#card-account .avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}

#card-account .avatar-wrapper:hover img {
    transform: scale(1.05);
}

/* переключатель */
.gender-switch {
    display: flex;
    gap: 10px;
    font-size: .85rem;
    margin-top: 8px;
}

.gender-switch input {
    accent-color: #fff;
    cursor: pointer;
}

/* всплывающее меню */
.account-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    display: grid;
    grid-template-columns: repeat(3, 80px);
    gap: 10px;
    transition: transform .3s, opacity .3s;
}

.account-menu.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* маленькие стеклянные карточки */
.mini-card {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mini-card a {
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.mini-card:hover {
    background: rgba(255, 255, 255, 0.28);
}


/* ---------- TEST PAGE ---------- */

/* полупрозрачный фон */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999
}

/* “стеклянный” бокс */
.tests-modal {
    width: 720px;
    max-width: 90vw;
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .25);
    backdrop-filter: blur(14px);
    color: #fff;
    font-family: Montserrat
}

/* сетка 3×2 */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 26px;
    margin-top: 30px
}

/* кнопка-квадрат */
.test-tile {
    border: 2px solid rgba(255, 255, 255, .5);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: .2s
}

.test-tile:hover:not(.locked):not(.done) {
    transform: scale(1.05)
}

.test-tile.locked {
    opacity: .35;
    cursor: not-allowed
}

.test-tile.done {
    border-color: #4dff7c;
    position: relative
}

.test-tile.done::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.6rem;
    color: #4dff7c
}

.test-tile small {
    margin-top: 10px;
    font-size: .85rem;
    opacity: .8
}

#close-tests {
    margin-top: 34px
}


/* широкий “стеклянный” бокс */
.content-box.test-content {
    max-width: 1200px;
    width: calc(100% - 80px);
    /* 40 px поля слева/справа */
    margin: 0 auto;
    padding: 60px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);

    display: flex;
    flex-direction: column;
}

/* заголовок вопроса */
.question {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #fff;
}

/* блок вопроса */
.question-block {
    margin-bottom: 32px;
    width: 100%;
}

/* контейнер вариантов – кликабельно по всей ширине */
.option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    cursor: pointer;
    user-select: none;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 300;
}

/* сам кружок */
.option input {
    /* сбрасываем нативный вид */
    appearance: none;
    -webkit-appearance: none;

    /* строгая геометрия */
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    /* ← не даст растянуться / сплющиться */
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    position: relative;
    cursor: pointer;
}

/* белая точка внутри */
.option input::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .15s ease;
}

/* когда выбрано – масштаб 1 */
.option input:checked::before {
    transform: translate(-50%, -50%) scale(1);
}

/* кнопка Далее / Завершить */
.test-btn {
    align-self: center;
    margin-top: 20px;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform .2s, background .2s;
}

.test-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* шапка таймера/прогресса */
.test-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    color: #fff;
    font-weight: 700;
}

#timer {
    font-size: 1.4rem;
}

#progress {
    font-size: 1rem;
}

/* контейнер, чтобы бокс был по центру экрана */
.test-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

/* общий util */
.result {
    text-align: center;
    color: #fff;
}

.hidden {
    display: none !important;
}

.finish-actions {
    margin-top: 25px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 28px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.btn-primary {
    background: rgba(255, 255, 255, .18);
    text-decoration: none;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, .3);
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(0, 145, 255, .25);
}

.btn-secondary:hover {
    background: rgba(0, 145, 255, .35);
    transform: scale(1.05);
}

.btn-secondary:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

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

.modal-box {
    max-width: 400px;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(14px);
    padding: 30px;
    border-radius: 18px;
    text-align: center;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

.modal-box h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    gap: 18px;
    justify-content: center;
}

/* кнопки reuse */