/* ===================================================================
   Legal Pages & Cookie Consent Styles
   Стили для страниц политики конфиденциальности, cookies и баннера
   =================================================================== */

/* ===== Cookie Consent Banner ===== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
}

.cookie-consent.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-consent-backdrop {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 100%);
    padding-top: 20px;
}

.cookie-consent-container {
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.15);
    padding: 24px 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-consent-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #007aff, #0051d5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.cookie-consent-text {
    flex: 1;
    min-width: 280px;
}

.cookie-consent-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-consent-title svg {
    width: 20px;
    height: 20px;
    color: #007aff;
}

.cookie-consent-description {
    font-size: 0.95rem;
    color: #6e6e73;
    line-height: 1.5;
    margin: 0;
}

.cookie-consent-description a {
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
}

.cookie-consent-description a:hover {
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-consent-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cookie-consent-btn-accept {
    background: linear-gradient(135deg, #007aff, #0051d5);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.cookie-consent-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.cookie-consent-btn-settings {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.cookie-consent-btn-settings:hover {
    background: #e8e8ed;
    border-color: #c6c6cc;
}

.cookie-consent-btn-decline {
    background: transparent;
    color: #86868b;
    padding: 12px 16px;
}

.cookie-consent-btn-decline:hover {
    color: #1d1d1f;
    background: #f5f5f7;
}

/* ===== Legal Pages Styles ===== */
.legal-page {
    padding: 0 0 80px;
    background: #ffffff;
}

.legal-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 80px 0 60px;
    text-align: center;
}

.legal-hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #007aff, #0051d5);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.legal-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
    line-height: 1.2;
}

.legal-hero-subtitle {
    font-size: 1.15rem;
    color: #86868b;
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.legal-hero-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legal-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #6e6e73;
}

.legal-hero-meta-item svg {
    width: 16px;
    height: 16px;
    color: #007aff;
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.legal-toc {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 48px;
}

.legal-toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-toc-title svg {
    width: 18px;
    height: 18px;
    color: #007aff;
}

.legal-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
}

.legal-toc-list li {
    list-style: none;
}

.legal-toc-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #6e6e73;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.legal-toc-list a:hover {
    background: white;
    color: #007aff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.legal-toc-list .toc-number {
    width: 24px;
    height: 24px;
    background: #e5e5ea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #86868b;
    flex-shrink: 0;
}

.legal-toc-list a:hover .toc-number {
    background: #007aff;
    color: white;
}

.legal-section {
    margin-bottom: 48px;
    scroll-margin-top: 100px;
}

.legal-section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.legal-section-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #007aff, #0051d5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.legal-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.3;
    margin: 0;
    padding-top: 6px;
}

.legal-section-content {
    padding-left: 56px;
}

.legal-section-content p {
    font-size: 1rem;
    color: #4d4d4d;
    line-height: 1.8;
    margin-bottom: 16px;
}

.legal-section-content p:last-child {
    margin-bottom: 0;
}

.legal-section-content ul,
.legal-section-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.legal-section-content li {
    font-size: 1rem;
    color: #4d4d4d;
    line-height: 1.7;
    margin-bottom: 8px;
}

.legal-section-content strong {
    color: #1d1d1f;
    font-weight: 600;
}

.legal-section-content a {
    color: #007aff;
    text-decoration: none;
}

.legal-section-content a:hover {
    text-decoration: underline;
}

/* Highlight boxes */
.legal-highlight {
    background: #f0f7ff;
    border-left: 4px solid #007aff;
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}

.legal-highlight-warning {
    background: #fff8e6;
    border-left-color: #ff9500;
}

.legal-highlight-success {
    background: #e8f9ee;
    border-left-color: #34c759;
}

.legal-highlight p {
    margin: 0;
    font-size: 0.95rem;
}

.legal-highlight p:last-child {
    margin-bottom: 0;
}

/* Contact card in legal pages */
.legal-contact-card {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e5e5ea;
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
}

.legal-contact-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-contact-title svg {
    width: 20px;
    height: 20px;
    color: #007aff;
}

.legal-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.legal-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-contact-icon {
    width: 40px;
    height: 40px;
    background: #f5f5f7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legal-contact-icon svg {
    width: 18px;
    height: 18px;
    color: #007aff;
}

.legal-contact-info {
    display: flex;
    flex-direction: column;
}

.legal-contact-label {
    font-size: 0.8rem;
    color: #86868b;
    font-weight: 500;
}

.legal-contact-value {
    font-size: 0.95rem;
    color: #1d1d1f;
    font-weight: 500;
}

.legal-contact-value a {
    color: #007aff;
    text-decoration: none;
}

.legal-contact-value a:hover {
    text-decoration: underline;
}

/* Cookie types table */
.cookie-types-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}

.cookie-types-table th,
.cookie-types-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e5ea;
}

.cookie-types-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1d1d1f;
}

.cookie-types-table td {
    color: #4d4d4d;
}

.cookie-types-table tr:last-child td {
    border-bottom: none;
}

.cookie-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cookie-type-badge.necessary {
    background: #e8f9ee;
    color: #34c759;
}

.cookie-type-badge.analytics {
    background: #f0f7ff;
    color: #007aff;
}

.cookie-type-badge.marketing {
    background: #fff8e6;
    color: #ff9500;
}

.cookie-type-badge.functional {
    background: #f3e8ff;
    color: #af52de;
}

/* Legal navigation at bottom */
.legal-nav {
    display: flex;
    gap: 16px;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid #e5e5ea;
    flex-wrap: wrap;
}

.legal-nav-item {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.legal-nav-item:hover {
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.1);
}

.legal-nav-label {
    font-size: 0.8rem;
    color: #86868b;
    margin-bottom: 4px;
}

.legal-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-nav-title svg {
    width: 16px;
    height: 16px;
    color: #007aff;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-settings-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.cookie-settings-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-settings-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-settings-title svg {
    width: 24px;
    height: 24px;
    color: #007aff;
}

.cookie-settings-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f7;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    transition: all 0.2s ease;
}

.cookie-settings-close:hover {
    background: #e8e8ed;
    color: #1d1d1f;
}

.cookie-settings-body {
    padding: 24px;
}

.cookie-setting-item {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 12px;
}

.cookie-setting-item:last-child {
    margin-bottom: 0;
}

.cookie-setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cookie-setting-info {
    flex: 1;
}

.cookie-setting-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-setting-required {
    font-size: 0.7rem;
    background: #e8f9ee;
    color: #34c759;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.cookie-setting-desc {
    font-size: 0.9rem;
    color: #6e6e73;
    line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5ea;
    transition: .3s;
    border-radius: 16px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #007aff, #0051d5);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-settings-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-settings-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 140px;
}

.cookie-settings-btn-save {
    background: linear-gradient(135deg, #007aff, #0051d5);
    color: white;
}

.cookie-settings-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.cookie-settings-btn-all {
    background: #34c759;
    color: white;
}

.cookie-settings-btn-all:hover {
    background: #30b350;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent-container {
        padding: 20px;
        border-radius: 16px 16px 0 0;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .cookie-consent-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    
    .cookie-consent-text {
        min-width: auto;
    }
    
    .cookie-consent-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-consent-btn {
        width: 100%;
        justify-content: center;
    }
    
    .legal-hero {
        padding: 60px 0 40px;
    }
    
    .legal-hero-icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }
    
    .legal-hero-title {
        font-size: 2rem;
    }
    
    .legal-content {
        padding: 40px 16px;
    }
    
    .legal-section-content {
        padding-left: 0;
        margin-top: 16px;
    }
    
    .legal-section-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .legal-section-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .legal-section-title {
        font-size: 1.25rem;
        padding-top: 0;
    }
    
    .legal-nav {
        flex-direction: column;
    }
    
    .legal-nav-item {
        min-width: auto;
    }
    
    .cookie-types-table {
        display: block;
        overflow-x: auto;
    }
    
    .legal-toc-list {
        grid-template-columns: 1fr;
    }
    
    .cookie-settings-content {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .cookie-settings-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .legal-hero-title {
        font-size: 1.75rem;
    }
    
    .legal-hero-subtitle {
        font-size: 1rem;
    }
    
    .legal-hero-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .legal-contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Print styles */
@media print {
    .cookie-consent,
    .cookie-settings-modal {
        display: none !important;
    }
    
    .legal-page {
        padding: 20px;
    }
    
    .legal-hero {
        padding: 20px 0;
        background: white;
    }
    
    .legal-section-number,
    .legal-hero-icon {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
