/* 1. Global Variables & Base */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.07);
    --border-color: rgba(255, 255, 255, 0.15);
    --hover-bg: rgba(255, 255, 255, 0.15);
    --glow: rgba(255, 255, 255, 0.2);
}

@keyframes floatParticles {
    0% {
        transform: translateY(0) translateX(0);
    }

    100% {
        transform: translateY(-120px) translateX(60px);
    }
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    background: transparent;
    /* Огромный массив звезд */
    box-shadow:
        5vw 15vh 1px #fff, 15vw 5vh 1px #fff, 25vw 25vh 1px #fff, 35vw 10vh 1px #fff,
        45vw 40vh 1px #fff, 55vw 20vh 1px #fff, 65vw 30vh 1px #fff, 75vw 50vh 1px #fff,
        85vw 15vh 1px #fff, 95vw 5vh 1px #fff, 10vw 60vh 1px #fff, 20vw 80vh 1px #fff,
        30vw 70vh 1px #fff, 40vw 90vh 1px #fff, 50vw 75vh 1px #fff, 60vw 85vh 1px #fff,
        70vw 65vh 1px #fff, 80vw 95vh 1px #fff, 90vw 70vh 1px #fff, 5vw 45vh 1px #fff;
    animation:
        floatParticles 12s linear infinite alternate,
        starTwinkle 4s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

body {
    font-family: 'Quicksand', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: transparent;
    /* Массив крупных звезд */
    box-shadow:
        12vw 12vh 2px #fff, 32vw 42vh 2px #fff, 52vw 22vh 2px #fff, 72vw 62vh 2px #fff,
        92vw 32vh 2px #fff, 22vw 82vh 2px #fff, 42vw 52vh 2px #fff, 62vw 12vh 2px #fff,
        82vw 72vh 2px #fff, 5vw 92vh 2px #fff, 18vw 28vh 1px #ffffff88, 38vw 78vh 1px #ffffff88,
        58vw 48vh 1px #ffffff88, 78vw 18vh 1px #ffffff88, 98vw 88vh 1px #ffffff88;
    opacity: 0.5;
    animation:
        floatParticles 25s linear infinite alternate-reverse,
        starTwinkle 6s ease-in-out infinite 1s;
    z-index: -1;
    pointer-events: none;
}

body.inner-page {
    display: flex;
}

body:not(.inner-page) {
    justify-content: space-between;
}

body:not(.inner-page) .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Layout Containers */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.tos-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1;
    z-index: 2;
}

/* 3. Main Page Components */
h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(3rem, 12vh, 7rem);
    letter-spacing: 25px;
    margin: 0;
    text-transform: uppercase;
    text-align: center;
    padding-left: 25px;
    animation: fadeInUp 1s ease-out forwards;
}

.sub-nickname {
    font-size: 1.1rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: #555;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 6vh;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.main-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 7vh;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 900px;
    margin-bottom: 5vh;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* 4. Common Elements */
.nav-btn {
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 12px 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.3s;
    text-align: center;
}

.nav-btn:hover {
    background: white;
    color: black;
    box-shadow: 0 0 20px var(--glow);
}

.social-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 30px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.social-btn i {
    font-size: 1.8rem;
}

.social-btn span {
    font-size: 1.1rem;
    letter-spacing: 2px;
    font-weight: 600;
}

.tos-card,
.price-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.tos-card {
    padding: 40px;
}

/* 5. Inner Pages Specifics */
.tos-header-layout {
    position: relative;
    text-align: center;
    margin-bottom: 50px;
}

.back-link-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    transition: 0.3s;
    z-index: 10;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.back-link-left:hover {
    color: #fff;
}

.tos-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem) !important;
    letter-spacing: 8px !important;
}

.tos-inline-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.tos-inline-header i {
    font-size: 2.5rem;
}

.tos-inline-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
}

.tos-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tos-list li::before {
    content: "›";
    margin-right: 12px;
    color: #555;
}

.large-text li,
.extra-item {
    font-size: 1.1rem;
    line-height: 2.5;
    color: #bbb;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.extra-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

.extra-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

/* 6. Price List Specifics */
.price-section {
    display: flex;
    gap: 30px;
    padding: 30px;
    align-items: flex-start;
}

.price-image {
    flex: 0 0 35%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.price-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.price-info {
    flex: 1;
}

.price-note {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.5;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

/* 7. Footer Components */
footer {
    text-align: center;
    padding: 40px 0;
    flex-shrink: 0;
}

.warning-18 {
    border-left: 2px solid #444;
    border-right: 2px solid #444;
    padding: 0 15px;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}

.copyright {
    font-size: 0.75rem;
    color: #333;
    letter-spacing: 1px;
}

.tos-bottom-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    margin-bottom: 25px;
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* 8. Animations */
.animate-1 {
    animation: fadeInUp 0.8s ease-out 0.1s forwards;
    opacity: 0;
}

.animate-2 {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-3 {
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.animate-4 {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.animate-5 {
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

.animate-6 {
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

/* 9. Order & Form */
.order-instruction-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.instruction-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 180px;
}

.order-form-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 25px;
    color: #ddd;
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-line;
    border-radius: 12px;
}

.copy-trigger-btn {
    margin-top: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
}

.copy-trigger-btn:hover {
    background: white;
    color: black;
}

.copy-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: black;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, -70%);
}

/* -------------------------------------------
   10. RESPONSIVE DESIGN (Исправленная версия)
------------------------------------------- */

/* Общий сброс для предотвращения горизонтального скролла */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 768px) {

    /* 1. Позиционирование главной (пункт 1 из прошлого вопроса) */
    body:not(.inner-page) .container {
        justify-content: flex-start;
        padding-top: 12vh;
    }

    /* Общие исправления для контейнеров */
    .tos-container {
        padding: 40px 15px;
        /* Уменьшаем боковые поля, чтобы контент влез */
        width: 100%;
        box-sizing: border-box;
    }

    /* Исправляем карточки (пункты 1, 2, 5) */
    .tos-card,
    .price-section {
        padding: 20px !important;
        /* Уменьшаем внутренние отступы */
        width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
    }

    /* Исправляем заголовок и иконки (пункты 3, 4) */
    .tos-inline-header {
        flex-direction: column;
        /* Иконка над текстом */
        justify-content: center;
        text-align: center;
        gap: 10px;
        width: 100%;
    }

    .tos-inline-header i {
        font-size: 2.2rem;
        margin: 0 auto;
    }

    .tos-inline-header h2 {
        font-size: 1.1rem;
        width: 100%;
    }

    /* Исправляем списки, чтобы не вылезали (пункты 1, 2, 5) */
    .large-text li,
    .tos-list li {
        white-space: normal;
        /* Разрешаем перенос строк! */
        line-height: 1.4;
        padding: 10px 0;
        font-size: 1rem;
    }

    /* Исправляем кнопки на странице Order (пункт 6) */
    .order-instruction-flex {
        flex-direction: column;
        /* Текст над кнопками */
        text-align: center;
        gap: 20px;
    }

    .instruction-buttons {
        width: 100%;
        min-width: 0;
    }

    .instruction-buttons .nav-btn {
        width: 100%;
        margin: 5px 0;
    }

    /* Исправляем вылет кнопок в футере (Next page / Accept) */
    .tos-footer {
        width: 100%;
        padding: 20px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .tos-footer .nav-btn {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Специфика для Price List */
    .price-section {
        flex-direction: column;
        align-items: center;
    }

    .price-image {
        width: 100%;
        max-width: 260px;
        margin-bottom: 20px;
    }

    .price-info {
        width: 100%;
    }

    /* Заголовки */
    h1 {
        font-size: 3rem;
        letter-spacing: 6px;
        padding-left: 6px;
    }

    /* Сетка соцсетей */
    .social-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    /* Соцсети в одну колонку на самых маленьких */
    .social-grid {
        grid-template-columns: 1fr;
    }

    .social-btn {
        padding: 15px;
    }
}