/* =================================================================
   «Войдите, чтобы открыть раздел» (template/v2/pages/need-auth.twig)
   Макет NeedAuth: размытый список, поверх — карточка входа
   ================================================================= */

.need-auth {
    position: relative;

    box-sizing: border-box;
    /* Поля по бокам — как у контента в макете (24px, на телефоне 16px) */
    width: calc(100% - 48px);
    max-width: 1232px;
    /* Высоту задаёт размытая заглушка; минимум — чтобы карточка поместилась
       (раньше 860px — под заглушкой оставалась пустая полоса) */
    min-height: 620px;
    margin: 28px auto 64px;

    border-radius: 20px;
    overflow: hidden;
}


/* ---------- Размытая заглушка ---------- */

.need-auth__skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;

    filter: blur(2px);
    opacity: 0.7;

    pointer-events: none;
    user-select: none;
}

/* Четыре плитки сверху */
.need-auth__tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.need-auth__tile {
    box-sizing: border-box;
    height: 70px;
    padding: 14px;

    display: flex;
    flex-direction: column;
    gap: 8px;

    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--line);
}

/* Список ботов */
.need-auth__list {
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--line);

    overflow: hidden;
}

.need-auth__row {
    display: grid;
    grid-template-columns: 60px 200px 1fr 80px;
    gap: 14px;
    align-items: center;

    padding: 16px 20px;

    border-bottom: 1px solid var(--line);
}

.need-auth__bot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.need-auth__lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.need-auth__actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* Полоска-заглушка с бегущим бликом */
.need-auth__sk {
    display: block;

    border-radius: 6px;
    background: linear-gradient(90deg, var(--soft) 0%, var(--line) 50%, var(--soft) 100%);
    background-size: 200% 100%;

    animation: need-auth-shine 1.6s ease-in-out infinite;
}

.need-auth__sk--avatar {
    width: 28px;
    height: 28px;

    border-radius: 50%;
}

.need-auth__sk--btn {
    width: 30px;
    height: 30px;

    border-radius: 8px;
}

@keyframes need-auth-shine {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}


/* ---------- Карточка входа ---------- */

/* Пелена поверх заглушки, карточка — сверху по центру */
.need-auth__veil {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding: clamp(24px, 6vw, 70px) 16px 16px;

    background: linear-gradient(180deg, rgba(243, 245, 249, 0.5), rgba(243, 245, 249, 0.85));
}

.need-auth__card {
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    padding: 32px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;

    border-radius: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(11, 18, 32, 0.18);

    text-align: center;
}

/* Замок */
.need-auth__icon {
    width: 56px;
    height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.need-auth__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.need-auth__why {
    max-width: 360px;
    margin: 0;

    color: var(--muted);
    font-size: 14px;
}

/* «Войти через бот» — фирменный голубой Telegram */
.need-auth__tg {
    box-sizing: border-box;
    width: 100%;
    margin-top: 4px;
    padding: 14px 18px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border-radius: 13px;
    background: #229ED9;

    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;

    transition: filter 0.15s ease, transform 0.1s ease;
}

.need-auth__tg:hover {
    filter: brightness(1.08);
}

.need-auth__tg:active {
    transform: translateY(1px);
}

.need-auth__tg:focus-visible {
    outline: 3px solid #8FB0FF;
    outline-offset: 2px;
}

.need-auth__divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;

    background: var(--line);
}

/* «После входа доступно» */
.need-auth__perks {
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 8px;

    text-align: left;
}

.need-auth__perks-title {
    color: var(--muted);
    font-size: 13px;
}

.need-auth__perk {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--ink-2);
    font-size: 14px;
}

.need-auth__perk svg {
    flex: 0 0 auto;
    margin-top: 3px;

    color: var(--up);
}

.need-auth__terms {
    color: var(--muted-2);
    font-size: 12px;
}

.need-auth__terms a {
    color: var(--accent-ink);
    text-decoration: none;
}

.need-auth__terms a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ---------- Тёмная тема: пелена под цвет фона ---------- */

:root[data-theme="dark"] .need-auth__veil {
    background: linear-gradient(180deg, rgba(10, 15, 26, 0.55), rgba(10, 15, 26, 0.85));
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .need-auth__veil {
        background: linear-gradient(180deg, rgba(10, 15, 26, 0.55), rgba(10, 15, 26, 0.85));
    }
}


/* ---------- Телефон ---------- */

@media (max-width: 720px) {
    .need-auth {
        width: calc(100% - 32px);
        margin: 16px auto 40px;
    }

    .need-auth__card {
        padding: 24px 20px;
    }

    .need-auth__tiles,
    .need-auth__bot,
    .need-auth__actions {
        display: none;
    }

    .need-auth__row {
        grid-template-columns: 48px 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .need-auth__sk {
        animation: none;
    }

    .need-auth__tg {
        transition: none;
    }
}
