﻿@keyframes legalFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes legalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes legalBtnShine {
    from { left: -120%; }
    to { left: 140%; }
}

@keyframes legalBgDrift {
    from { transform: scale(1.05); }
    to { transform: scale(1.1); }
}

.legal-page {
    min-height: 100vh;
    background: #0a0a0a;
    position: relative;
    overflow-x: hidden;
}

.legal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url(../image/bg.png);
    background-size: cover;
    background-position: center;
    z-index: 0;
    animation: legalBgDrift 28s ease-in-out infinite alternate;
    will-change: transform;
}

.legal-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 10, 10, 0.72) 0%, rgba(10, 10, 10, 0.88) 100%),
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(231, 76, 60, 0.12) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.legal-page > * {
    position: relative;
    z-index: 1;
}

.legal-header {
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 10;
    animation: legalFadeIn 0.6s ease both;
}

.legal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.legal-brand {
    font-family: "Audiowide", sans-serif;
    color: #fff;
    text-decoration: none;
    font-size: clamp(14px, 2.5vw, 20px);
    letter-spacing: 0.06em;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}

.legal-brand:hover {
    color: #e74c3c;
    letter-spacing: 0.08em;
}

.legal-back {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.legal-back:hover {
    color: #fff;
    transform: translateX(-3px);
}

.legal-main {
    padding: clamp(32px, 6vw, 64px) 0;
}

.legal-card {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 48px);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: legalFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.legal-label {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
    animation: legalFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.legal-card h1 {
    color: #fff;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.2;
    animation: legalFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.legal-updated {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin: 0 0 24px 0;
    animation: legalFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.legal-intro {
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 32px 0;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    animation: legalFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.legal-section {
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--legal-delay, 0s);
}

.legal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.legal-section h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.legal-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 10px 0;
}

.legal-section ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.7;
}

.legal-section li {
    margin-bottom: 8px;
}

.legal-section a,
.legal-contacts a {
    color: #e74c3c;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-section a:hover,
.legal-contacts a:hover {
    color: #ff6b57;
    text-decoration: underline;
}

.legal-contacts {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.legal-contacts li {
    margin-bottom: 8px;
}

.legal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-actions.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.legal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 14px;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease,
        background 0.35s ease,
        border-color 0.35s ease,
        color 0.35s ease;
}

.legal-btn svg {
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-btn--primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 28px rgba(231, 76, 60, 0.35);
}

.legal-btn--primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
}

.legal-btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(231, 76, 60, 0.45);
}

.legal-btn--primary:hover::after {
    animation: legalBtnShine 0.7s ease;
}

.legal-btn--primary:hover svg {
    transform: translateX(4px);
}

.legal-btn--primary:active {
    transform: translateY(-1px);
}

.legal-btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.legal-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.legal-btn--secondary:hover svg {
    transform: translateX(-4px);
}

.legal-page .site-footer {
    animation: legalFadeIn 0.8s ease 0.4s both;
}

@media (prefers-reduced-motion: reduce) {
    .legal-page::before {
        animation: none;
    }

    .legal-header,
    .legal-card,
    .legal-label,
    .legal-card h1,
    .legal-updated,
    .legal-intro,
    .legal-page .site-footer {
        animation: none;
    }

    .legal-section,
    .legal-actions {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (min-width: 560px) {
    .legal-actions {
        flex-direction: row;
        align-items: stretch;
    }

    .legal-btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .legal-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .legal-card {
        border-radius: 16px;
    }
}
