/* ===================================
   Legal Pages Styles
   =================================== */

.legal-page {
    min-height: 100vh;
    padding: 32px 0 80px;
}

.legal-header {
    padding: 24px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.legal-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.legal-logo:hover {
    color: var(--color-primary);
}

.legal-content {
    max-width: 820px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
    box-shadow: 0 8px 32px rgba(0, 67, 111, 0.06);
}

.legal-content h1 {
    font-size: clamp(28px, 4vw, 40px);
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.legal-meta {
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.legal-meta p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.legal-section {
    margin-bottom: 40px;
}

.legal-section:last-of-type {
    margin-bottom: 48px;
}

.legal-section h2 {
    font-size: clamp(22px, 3vw, 28px);
    color: var(--text-primary);
    margin-bottom: 16px;
    margin-top: 0;
    line-height: 1.3;
}

.legal-section h3 {
    font-size: clamp(18px, 2.5vw, 22px);
    color: var(--text-primary);
    margin-bottom: 12px;
    margin-top: 24px;
    line-height: 1.3;
}

.legal-section p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 16px;
}

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

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

.legal-section li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 10px;
}

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

.legal-section a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 181, 194, 0.3);
    transition: border-color var(--transition-fast);
}

.legal-section a:hover {
    border-bottom-color: var(--color-primary);
}

.legal-section strong {
    font-weight: 700;
    color: var(--text-primary);
}

.legal-section code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
    font-size: 0.9em;
    background: rgba(0, 181, 194, 0.08);
    color: var(--color-primary-deep);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Cookie Table */
.cookie-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: #ffffff;
}

.cookie-table thead {
    background: var(--bg-soft);
}

.cookie-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-strong);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-table td {
    padding: 14px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

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

.cookie-table tbody tr:hover {
    background: rgba(0, 181, 194, 0.02);
}

.cookie-table code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
    font-size: 0.9em;
    background: rgba(0, 181, 194, 0.08);
    color: var(--color-primary-deep);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Mobile table optimization */
@media (max-width: 768px) {
    .cookie-table-wrapper {
        border: none;
        border-radius: 0;
    }

    .cookie-table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .cookie-table thead,
    .cookie-table tbody,
    .cookie-table tr {
        display: block;
    }

    .cookie-table thead {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .cookie-table th,
    .cookie-table td {
        display: inline-block;
        padding: 10px 12px;
        min-width: 120px;
    }

    .cookie-table th:first-child,
    .cookie-table td:first-child {
        min-width: 180px;
        font-weight: 600;
    }

    .cookie-table th:nth-child(2),
    .cookie-table td:nth-child(2) {
        min-width: 100px;
    }

    .cookie-table th:nth-child(3),
    .cookie-table td:nth-child(3) {
        min-width: 100px;
    }

    .cookie-table th:nth-child(4),
    .cookie-table td:nth-child(4) {
        min-width: 240px;
    }
}

/* Alternative mobile table: card layout */
@media (max-width: 576px) {
    .cookie-table {
        display: block;
        white-space: normal;
    }

    .cookie-table thead {
        display: none;
    }

    .cookie-table tbody,
    .cookie-table tr {
        display: block;
    }

    .cookie-table tr {
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 12px;
        background: #ffffff;
    }

    .cookie-table tr:hover {
        background: #ffffff;
    }

    .cookie-table td {
        display: block;
        padding: 8px 0;
        border-bottom: none;
        min-width: 0 !important;
    }

    .cookie-table td:not(:last-child) {
        border-bottom: 1px solid var(--border);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .cookie-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        display: block;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 4px;
    }
}

/* Footer Navigation */
.legal-footer-nav {
    padding-top: 32px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: transform var(--transition-fast),
                color var(--transition-fast);
}

.legal-back-link:hover {
    transform: translateX(-3px);
    color: var(--color-primary-deep);
}

.legal-back-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .legal-page {
        padding: 24px 0 64px;
    }

    .legal-header {
        padding: 16px 0 32px;
        margin-bottom: 32px;
    }

    .legal-content {
        padding: 32px 24px;
    }

    .legal-section {
        margin-bottom: 32px;
    }

    .legal-section h2 {
        margin-bottom: 12px;
    }

    .legal-section h3 {
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .legal-section p,
    .legal-section li {
        font-size: 15px;
    }

    .legal-section ul,
    .legal-section ol {
        padding-left: 20px;
    }
}

@media (max-width: 576px) {
    .legal-content {
        border-radius: var(--radius-lg);
        padding: 24px 20px;
    }

    .legal-meta {
        padding-bottom: 24px;
        margin-bottom: 24px;
    }

    .legal-section {
        margin-bottom: 28px;
    }
}
