/* --- Общие стили и переменные --- */
:root {
    color-scheme: dark;
    --main-red: #D90429;
    --dark-bg: #121212;
    --card-bg: #1f1f1f;
    --text-white: #FFFFFF;
    --text-grey: #c0c0c0; /* WCAG AA: ранее #a0a0a0 не дотягивал до 4.5:1 на #121212 */
    --border-color: rgba(255, 255, 255, 0.1);
    --focus-ring: 3px solid #ff8a9b;
    --focus-offset: 2px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-white);
    overflow-x: hidden;
}

/* Visually-hidden helper (table captions etc.) */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Universal focus-visible (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.nav a:focus-visible,
.language-switcher .lang-option:focus-visible,
.burger-menu:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: 4px;
}

/* Responsible-gambling disclaimer in footer */
.responsible-gambling {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-grey);
    text-align: center;
    line-height: 1.5;
}
.responsible-gambling a {
    color: var(--text-white);
    text-decoration: underline;
}
.responsible-gambling a:hover { color: var(--main-red); }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .scroll-down {
        animation: none !important;
    }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; background: transparent; border: none; }

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-weight: 700;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(180deg, #E60023 0%, #B3001B 100%);
    box-shadow: 0px 4px 15px rgba(217, 4, 41, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 20px rgba(217, 4, 41, 0.5);
}

.btn--large {
    padding: 18px 50px;
    font-size: 18px;
}

/* --- Стили хедера --- */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 25px 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Убираем flex-grow у header-middle, чтобы корректно работало центрирование nav */
}

.logo img {
    height: 35px;
    display: block;
}

.nav {
    flex-grow: 1; /* Позволяет навигации занимать доступное пространство для центрирования */
    display: flex;
    justify-content: center; /* Центрирует пункты меню */
}
.nav ul { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: 14px; color: var(--text-grey); transition: color 0.3s; }
.nav a:hover { color: var(--text-white); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-btn { font-size: 14px; }

/* Кнопка "Войти" для десктопа */
.header-actions .btn {
    display: block; /* Показываем кнопку на десктопе */
}

.burger-menu { display: none; }

/* --- Стили переключателя языков --- */
.language-switcher {
    display: flex;
    gap: 8px;
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 4px;
    font-size: 13px;
    font-weight: 700;
}

.language-switcher .lang-option {
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--text-grey);
    transition: background-color 0.3s, color 0.3s;
    text-transform: uppercase; /* Добавил, чтобы RU/EN/FR/AR выглядели одинаково */
}

.language-switcher .lang-option.active {
    background-color: var(--main-red);
    color: var(--text-white);
}

.language-switcher .lang-option:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

/* Скрываем мобильный переключатель на десктопе */
.nav-item--language-mobile,
.nav-item--login-mobile {
    display: none;
}

/* --- Стили первого экрана (Hero) --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 100px;
    position: relative;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(180, 20, 40, 0.15), transparent 40%),
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 100% 100%, 50px 50px, 50px 50px;
}

.hero-content { max-width: 800px; }
.hero-logo { margin-bottom: 30px; }
.hero-logo img { max-width: 500px; width: 100%; height: auto; }
.hero h1 { font-size: 48px; font-weight: 700; line-height: 1.2; }
.hero p { font-size: 32px; font-weight: 400; color: var(--text-grey); margin-top: 10px; margin-bottom: 40px; }
.hero-btn {
    padding: 14px 30px; /* Немного изменил паддинг для иконок */
    font-size: 18px;
    display: flex; /* Для выравнивания иконки и текста */
    align-items: center;
    justify-content: center;
    gap: 12px; /* Расстояние между иконкой и текстом */
}

/* === НОВЫЕ СТИЛИ НАЧАЛО === */

/* Контейнер для кнопок */
.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* Расстояние между кнопками */
    flex-wrap: wrap; /* Перенос кнопок на новую строку на маленьких экранах */
}

/* Кнопка для Android */
.btn-android {
    background: linear-gradient(180deg, #3DDC84 0%, #27A15B 100%);
    box-shadow: 0px 4px 15px rgba(61, 220, 132, 0.3);
}
.btn-android:hover {
    box-shadow: 0px 6px 20px rgba(61, 220, 132, 0.5);
    transform: translateY(-2px);
}

/* Кнопка для iOS */
.btn-ios {
    background: linear-gradient(180deg, #4a4a4c 0%, #2c2c2e 100%);
    box-shadow: 0px 4px 15px rgba(44, 44, 46, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-family: inherit;
    color: #fff;
}
.btn-ios:hover {
    box-shadow: 0px 6px 20px rgba(44, 44, 46, 0.5);
    transform: translateY(-2px);
}
.btn:disabled,
.btn[disabled] {
    opacity: 0.9;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}
.btn-ios small {
    display: inline;
    font-size: 0.8em;
    font-weight: 400;
    opacity: 0.85;
    margin-inline-start: 4px;
}
/* Кнопки в hero-секции одинаковой высоты */
.hero-buttons .btn {
    min-height: 56px;
    box-sizing: border-box;
}
/* === НОВЫЕ СТИЛИ КОНЕЦ === */


.scroll-down { position: absolute; bottom: 30px; animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- Стили секции "Преимущества" --- */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 40px;
    font-weight: 900;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--main-red);
}

.feature-icon {
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 40px;
    height: 40px;
    color: var(--main-red);
}

.feature-card h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-white);
}

.feature-card p {
    color: var(--text-grey);
    line-height: 1.6;
    font-size: 15px;
}

/* --- Стили заголовка внутренней страницы --- */
.page-title-section {
    padding-top: 140px;
    padding-bottom: 40px;
}

.page-title {
    font-size: 48px;
    font-weight: 900;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
}

/* --- Стили CTA секции --- */
.cta-section {
    padding: 60px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--text-white);
}

.cta-section p {
    color: var(--text-grey);
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* --- Стили текстового контента --- */
.content-block {
    padding: 40px 0;
}
.cta-section + .content-block {
    padding-top: 0;
}

.text-content {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-grey);
    line-height: 1.7;
    font-size: 16px;
}

.content-lead {
    font-size: 18px;
    color: var(--text-white);
    margin-bottom: 2em;
}

.text-content h2,
.text-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-white);
    margin-top: 2em;
    margin-bottom: 1em;
}

.text-content p {
    margin-bottom: 1.5em;
}

.text-content strong,
.text-content b {
    color: var(--text-white);
    font-weight: 700;
}

.text-content a {
    color: var(--main-red);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.3s;
}

.text-content a:hover {
    color: #ff4d6a;
}

.text-content ol {
    margin-bottom: 1.5em;
    padding-left: 20px;
}

.text-content ul {
    margin-bottom: 1.5em;
    padding-left: 20px;
    list-style-type: disc;
}

.text-content li {
    margin-bottom: 0.75em;
    padding-left: 10px;
}

.text-content ul li::marker {
    color: var(--main-red);
    font-size: 1.2em;
}

.text-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 15px;
}

.text-content th,
.text-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.text-content thead th {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    font-weight: 700;
}

.text-content tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.text-content figure {
    margin: 2em 0;
}
.text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}
.text-content figcaption {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: var(--text-grey);
    font-style: italic;
}

/* --- Стили секции FAQ --- */
.faq {
    padding: 80px 0;
    background-color: #000;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.faq-question {
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--main-red);
}

.faq-question::after {
    content: '+';
    font-size: 28px;
    font-weight: 300;
    color: var(--text-grey);
    transition: transform 0.3s ease;
}

.faq-item[open] > .faq-question::after {
    content: '−';
    transform: rotate(180deg);
}
.faq-item[open] > .faq-question {
    color: var(--text-white);
}

.faq-answer {
    padding-top: 20px;
    color: var(--text-grey);
    line-height: 1.6;
}
.faq-answer p {
    margin: 0;
}

/* --- Стили футера --- */
.footer {
    background-color: var(--dark-bg);
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1;
    min-width: 180px;
}

.footer-col--logo {
    flex-basis: 30%;
}

.footer-col--logo .logo img {
    height: 30px;
}

.footer-description {
    color: var(--text-grey);
    margin-top: 20px;
    line-height: 1.6;
    max-width: 300px;
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-links a {
    color: var(--text-grey);
    transition: color 0.3s, padding-left 0.3s;
}

.footer-links a:hover {
    color: var(--text-white);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    text-align: center;
}

.copyright {
    color: var(--text-grey);
    font-size: 14px;
}

/* --- Адаптация и мобильное меню (до 1024px) --- */
@media (max-width: 1024px) {
    /* Скрываем навигацию и кнопку Войти на мобильных, пока бургер не активен */
    .nav {
        display: none; /* Скрываем nav полностью для бургер-меню */
    }

    .nav.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(18, 18, 18, 0.9);
        backdrop-filter: blur(8px);
        display: flex; /* Показываем nav, когда active */
        justify-content: center;
        align-items: center;
        opacity: 1;
        visibility: visible;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        z-index: 100;
    }

    .nav ul {
        flex-direction: column;
        gap: 40px;
        text-align: center; /* Центрируем текст в мобильном меню */
    }

    .nav ul li {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav.active ul li {
        opacity: 1;
        transform: translateY(0);
    }

    .nav.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav.active li:nth-child(5) { transition-delay: 0.5s; }
    .nav.active li:nth-child(6) { transition-delay: 0.6s; }

    .nav a {
        font-size: 22px;
        font-weight: 700;
        color: var(--text-white);
    }

    .nav-item--highlight a {
        background: var(--main-red);
        padding: 12px 40px;
        border-radius: 6px;
    }
    .nav-item--highlight a:hover { background: #B3001B; }

    /* Скрываем десктопную кнопку "Войти" на мобильных */
    .header-actions .btn {
        display: none;
    }

    .burger-menu {
        display: block;
        z-index: 101;
    }
    .burger-menu span {
        display: block; width: 25px; height: 2px;
        background-color: var(--text-white); margin: 6px 0;
        transition: all 0.3s ease-in-out;
    }
    .burger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .burger-menu.active span:nth-child(2) { opacity: 0; }
    .burger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero h1 {
        font-size: 32px;
    }
    .hero p {
        font-size: 22px;
    }

    .section-title {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .page-title-section {
        padding-top: 120px;
        padding-bottom: 30px;
    }

    /* ================== ИСПРАВЛЕНИЕ: Уменьшаем H1 на мобильных ================== */
    .page-title {
        font-size: 32px; /* Уменьшаем до 32px для консистентности */
        padding-bottom: 30px;
    }

    .cta-section {
        padding: 40px 0;
    }
    .cta-section h2 {
        font-size: 28px;
    }

    .text-content h2,
    .text-content h3 {
        font-size: 22px;
    }
    .content-lead {
        font-size: 17px;
    }
    .text-content {
        font-size: 15px;
    }

    .faq-question {
        font-size: 18px;
    }

    .footer-top {
        flex-direction: column;
        gap: 30px;
    }

    /* === НОВОЕ: Центрирование колонок футера на мобильных === */
    .footer-col {
        text-align: center; /* Центрируем текст во всех колонках футера */
    }

    .footer-col--logo {
        flex-basis: auto;
    }
    .footer-description {
        max-width: none;
    }

    /* Скрываем десктопный переключатель на мобильных */
    .language-switcher--desktop {
        display: none;
    }

    /* Показываем мобильный переключатель в меню */
    .nav-item--language-mobile,
    .nav-item--login-mobile {
        display: block; /* Показываем только в мобильном меню */
        margin-top: 20px; /* Добавляем отступ сверху, чтобы отделить от других пунктов меню */
    }
    .nav-item--language-mobile .language-switcher,
    .nav-item--login-mobile .btn {
        justify-content: center; /* Центрируем кнопки языков и кнопку "Войти" в мобильном меню */
    }

    /* Стили для кнопки "Войти" в мобильном меню */
    .nav-item--login-mobile .btn {
        width: fit-content; /* Ширина по контенту */
        margin: 0 auto; /* Центрируем кнопку */
        padding: 12px 40px; /* Увеличиваем паддинг для удобства нажатия */
        font-size: 18px;
    }
}

/* === НОВЫЙ МЕДИА-ЗАПРОС ДЛЯ КНОПОК НАЧАЛО === */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column; /* Кнопки в столбец */
        gap: 15px;
        align-items: stretch; /* Растянуть кнопки на всю ширину контейнера */
    }

    /* Увеличиваем одиночную кнопку Sign up в hero на мобильных */
    .hero-content > .hero-btn {
        width: 100%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
        padding: 18px 40px;
        font-size: 20px;
        min-height: 56px;
    }
}
/* === НОВЫЙ МЕДИА-ЗАПРОС ДЛЯ КНОПОК КОНЕЦ === */

/* --- Стили для виджета Trustpilot в футере --- */
.footer-col .trustpilot-widget {
    width: 250px;              /* matches data-style-width on the widget element */
    max-width: 100%;
}
@media (max-width: 1024px) {
    .footer-col .trustpilot-widget {
        margin: 0 auto;        /* центрируем виджет, т.к. колонка растягивается */
    }
}

/* --- Обновление шрифта для арабского языка --- */
[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

/* --- Универсальные исправления для RTL --- */

/* Таблицы: выравнивание текста */
[dir="rtl"] .text-content th, 
[dir="rtl"] .text-content td {
    text-align: right;
}

/* Списки: отступы */
[dir="rtl"] .text-content ul, 
[dir="rtl"] .text-content ol {
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .text-content li {
    padding-left: 0;
    padding-right: 10px;
}

/* FAQ: иконка плюса/минуса слева */
[dir="rtl"] .faq-question::after {
    margin-right: auto;
    margin-left: 0;
}

/* Футер: эффект при наведении на ссылки */
[dir="rtl"] .footer-links a:hover {
    padding-left: 0;
    padding-right: 5px;
}

/* Бургер-меню на мобильных (чтобы не перекрывало лого) */
@media (max-width: 1024px) {
    [dir="rtl"] .header-inner {
        flex-direction: row; /* Флекс сам поменяет порядок элементов при dir=rtl */
    }
}

/* Иконки в кнопках (если есть) - разворот по горизонтали */
[dir="rtl"] .hero-btn svg {
    transform: scaleX(-1);
}

/* Конкретные правки позиционирования, если используются left/right */
.header {
    inset-inline-start: 0; /* Вместо left: 0 */
}

/* Если в мобильном меню используется выезд слева, меняем на право */
@media (max-width: 1024px) {
    .nav.active {
        left: auto;
        right: 0;
    }
}