/* ── Language modal (first visit) ── */
.lang-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lang-modal.lang-modal--visible {
    display: flex;
}

.lang-modal[hidden]:not(.lang-modal--visible) {
    display: none !important;
}

.lang-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 10, 22, 0.82);
    backdrop-filter: blur(10px);
}

.lang-modal__card {
    position: relative;
    width: min(500px, 100%);
    padding: 40px 36px 34px;
    border-radius: 24px;
    background: linear-gradient(165deg, #122240 0%, #060d1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 207, 240, 0.08) inset;
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.28s ease;
}

.lang-modal--visible .lang-modal__card {
    transform: translateY(0) scale(1);
}

.lang-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(0, 207, 240, 0.12);
    border: 1px solid rgba(0, 207, 240, 0.28);
    color: #00cff0;
}

.lang-modal__card h2 {
    margin: 0 0 10px;
    font-size: 1.625rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.lang-modal__card > p {
    margin: 0 0 28px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.62);
}

.lang-modal__choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.lang-modal__choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.lang-modal__choice:hover,
.lang-modal__choice:focus-visible {
    border-color: rgba(0, 207, 240, 0.55);
    background: rgba(0, 207, 240, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0, 207, 240, 0.18);
    outline: none;
}

.lang-modal__flag {
    display: block;
    width: 58px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

.lang-modal__flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.lang-modal__label {
    font-size: 1rem;
    font-weight: 700;
}

body.lang-modal-open {
    overflow: hidden;
}

/* ── Language switch (header) ── */
.lang-switch {
    display: inline-flex;
    gap: 2px;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.55);
    transition: background 0.15s, color 0.15s;
}

.lang-switch a:hover {
    color: #fff;
}

.lang-switch a.active {
    background: rgba(0, 207, 240, 0.22);
    color: #00cff0;
    box-shadow: 0 0 0 1px rgba(0, 207, 240, 0.25);
}

.lang-switch--dark {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.lang-switch--dark a {
    color: rgba(255, 255, 255, 0.55);
}

.lang-switch--dark a:hover {
    color: #fff;
}

.lang-switch--dark a.active {
    background: rgba(0, 207, 240, 0.22);
    color: #00cff0;
}

.lang-switch--light {
    background: var(--bg, #f0f4f8);
    border-color: rgba(15, 40, 71, 0.1);
}

.lang-switch--light a {
    color: rgba(20, 32, 51, 0.55);
}

.lang-switch--light a:hover {
    color: #142033;
}

.lang-switch--light a.active {
    background: #fff;
    color: #1a6fe8;
    box-shadow: 0 1px 6px rgba(6, 13, 26, 0.08);
}

/* ── Cookie banner ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(6, 13, 26, 0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
    animation: cookie-in 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner--hide {
    animation: cookie-out 0.32s ease forwards;
}

.cookie-banner--customizing {
    box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.45);
}

@keyframes cookie-in {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cookie-out {
    to { opacity: 0; transform: translateY(100%); }
}

.cookie-banner__glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #1a6fe8, #00cff0, #1a6fe8);
    background-size: 200% 100%;
    animation: cookie-glow 4s linear infinite;
}

@keyframes cookie-glow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.cookie-banner__inner {
    width: 100%;
    padding: 18px clamp(16px, 4vw, 48px) 20px;
}

.cookie-banner__layout {
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-banner__main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
}

.cookie-banner__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(0, 207, 240, 0.1);
    border: 1px solid rgba(0, 207, 240, 0.22);
    color: #00cff0;
}

.cookie-banner__copy strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.cookie-banner__copy p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
    max-width: 720px;
}

.cookie-banner__policy {
    color: #00cff0;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.cookie-banner__policy:hover {
    color: #fff;
    text-decoration: underline;
}

.cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-banner__btn {
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 18px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.cookie-banner__btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.cookie-banner__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.cookie-banner__btn--text {
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    padding: 8px 12px;
}

.cookie-banner__btn--text:hover {
    color: #fff;
}

.cookie-banner__btn--primary {
    background: linear-gradient(135deg, #1a6fe8, #00cff0);
    color: #fff;
    box-shadow: 0 6px 24px rgba(26, 111, 232, 0.35);
}

.cookie-banner__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(0, 207, 240, 0.35);
}

.cookie-banner__panel {
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition: max-height 0.35s ease, opacity 0.28s ease, transform 0.28s ease, margin-top 0.28s ease;
}

.cookie-banner__panel[hidden] {
    display: block !important;
}

.cookie-banner--customizing .cookie-banner__panel {
    margin-top: 18px;
    max-height: 520px;
    opacity: 1;
    transform: translateY(0);
}

.cookie-banner--customizing .cookie-banner__actions--compact {
    display: none;
}

.cookie-banner__panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-banner__panel-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.cookie-banner__panel-head p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.cookie-banner__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.cookie-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-card--locked {
    background: rgba(255, 255, 255, 0.025);
}

.cookie-card__icon {
    font-size: 18px;
    line-height: 1;
}

.cookie-card__body {
    flex: 1;
}

.cookie-card__body strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.cookie-card__body p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.52);
}

.cookie-card__badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.cookie-toggle {
    position: relative;
    align-self: flex-end;
    width: 48px;
    height: 28px;
    margin-top: auto;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-toggle__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cookie-toggle input:checked + .cookie-toggle__track {
    background: linear-gradient(135deg, #1a6fe8, #00cff0);
}

.cookie-toggle input:checked + .cookie-toggle__track::after {
    transform: translateX(20px);
}

.cookie-toggle input:focus-visible + .cookie-toggle__track {
    outline: 2px solid #00cff0;
    outline-offset: 2px;
}

.cookie-banner__panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
}

body.cookie-bar-visible {
    padding-bottom: 96px;
}

body.cookie-bar-visible.cookie-bar-expanded {
    padding-bottom: 340px;
}

body.bn-va.cookie-bar-visible .bn-top {
    bottom: calc(28px + 96px);
}

body.bn-va.cookie-bar-visible.cookie-bar-expanded .bn-top {
    bottom: calc(28px + 340px);
}

.bn-footer__cookie-btn {
    border: none;
    padding: 0;
    background: none;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.bn-footer__links .bn-footer__cookie-btn {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.62);
    transition: color 0.2s;
}

.bn-footer__links .bn-footer__cookie-btn:hover {
    color: #00cff0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .cookie-banner__grid {
        grid-template-columns: 1fr;
    }

    .cookie-card {
        min-height: 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .cookie-card__body {
        flex: 1 1 200px;
    }

    .cookie-toggle,
    .cookie-card__badge {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .lang-modal__choices {
        grid-template-columns: 1fr;
    }

    .cookie-banner__main {
        grid-template-columns: 1fr;
    }

    .cookie-banner__icon {
        display: none;
    }

    .cookie-banner__grid {
        gap: 10px;
    }

    .cookie-banner__actions--compact,
    .cookie-banner__panel-actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-banner__btn {
        flex: 1;
        width: 100%;
        text-align: center;
    }

    body.cookie-bar-visible {
        padding-bottom: 170px;
    }

    body.cookie-bar-visible.cookie-bar-expanded {
        padding-bottom: min(72vh, 560px);
    }

    body.bn-va.cookie-bar-visible .bn-top {
        bottom: calc(20px + 170px);
    }

    body.bn-va.cookie-bar-visible.cookie-bar-expanded .bn-top {
        bottom: calc(20px + min(72vh, 560px));
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 14px 12px;
    }

    .cookie-banner__title {
        font-size: 15px;
    }

    .cookie-card {
        padding: 12px;
    }

    .lang-modal__dialog {
        margin: 12px;
        width: calc(100% - 24px);
    }

    body.cookie-bar-visible {
        padding-bottom: 190px;
    }
}

@supports (padding: max(0px)) {
    .cookie-banner {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .lang-modal__dialog {
        margin-bottom: max(12px, env(safe-area-inset-bottom));
    }
}
