/**
 * Legal Pages CSS - CreatorFlow
 * Brand Compliance: ONLY #000000 for dark backgrounds, #d1fe17 for lime green accents
 * NO box-shadows | NO gradients on dark backgrounds | Stack Sans Headline for headings
 * Mobile-first responsive design
 */

/* ===================================
   LEGAL HERO SECTION
   =================================== */

.legal-hero {
    background: #ffffff;
    padding: 8rem 2rem 4rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.legal-hero__container {
    max-width: 800px;
    margin: 0 auto;
}

.legal-hero__title {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #000000;
    margin-bottom: 2rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.legal-hero__meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9375rem;
    color: #6b7280;
}

.legal-meta__item {
    margin: 0;
}

.legal-meta__item strong {
    font-weight: 600;
    color: #374151;
    margin-right: 0.5rem;
}

/* Tablet and up */
@media (min-width: 640px) {
    .legal-hero {
        padding: 10rem 2rem 5rem 2rem;
    }

    .legal-hero__meta {
        flex-direction: row;
        gap: 2rem;
        justify-content: center;
    }
}

/* ===================================
   LEGAL CONTENT SECTION
   =================================== */

.legal-content {
    background: #ffffff;
    padding: 4rem 2rem;
}

.legal-content__container {
    max-width: 900px;
    margin: 0 auto;
}

/* Introduction */
.legal-intro {
    background: #f9fafb;
    border-left: 4px solid #d1fe17;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 3rem;
}

.legal-intro p {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #374151;
    margin: 0;
}

/* Table of Contents */
.legal-toc {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
}

.legal-toc__title {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1rem;
}

.legal-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.legal-toc__item {
    counter-increment: toc-counter;
    margin-bottom: 0.75rem;
}

.legal-toc__link {
    color: #374151;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
    transition: color 0.2s ease;
    display: inline-block;
}

.legal-toc__link::before {
    content: counter(toc-counter) ". ";
    font-weight: 600;
    color: #000000;
    margin-right: 0.5rem;
}

.legal-toc__link:hover {
    color: #d1fe17;
}

/* Desktop */
@media (min-width: 1024px) {
    .legal-content {
        padding: 5rem 2rem;
    }
}

/* ===================================
   LEGAL SECTIONS
   =================================== */

.legal-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px; /* Account for sticky header */
}

.legal-section__title {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #000000;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.75rem;
}

.legal-section__content {
    margin-bottom: 1.5rem;
}

.legal-section__content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1rem;
}

.legal-section__footer {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #6b7280;
}

/* Subsections */
.legal-subsection {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 3px solid #d1fe17;
}

.legal-subsection__title {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 1rem;
}

.legal-subsection__content {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1rem;
}

/* ===================================
   LISTS
   =================================== */

.legal-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.legal-list__item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
}

.legal-list__item::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: #d1fe17;
    color: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.legal-list__item strong {
    font-weight: 600;
    color: #000000;
}

/* Links in lists */
.legal-links-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.legal-links-list li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
}

.legal-links-list a {
    color: #000000;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.legal-links-list a:hover {
    color: #d1fe17;
}

/* ===================================
   DEFINITIONS (DPA, Terms)
   =================================== */

.legal-definitions {
    margin: 2rem 0;
    padding: 0;
}

.legal-definitions__term {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.legal-definitions__term:first-child {
    margin-top: 0;
}

.legal-definitions__definition {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    margin-left: 0;
    margin-bottom: 0;
}

/* ===================================
   TABLES (Cookie Policy)
   =================================== */

.legal-cookie-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.legal-table thead {
    background: #f9fafb;
}

.legal-table thead th {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    color: #000000;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.legal-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    vertical-align: top;
}

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

.legal-table tbody tr:hover {
    background: #f9fafb;
}

/* Cookie type badges */
.cookie-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-type--essential {
    background: #dbeafe;
    color: #1e40af;
}

.cookie-type--analytics {
    background: #fef3c7;
    color: #92400e;
}

.cookie-type--marketing {
    background: #fce7f3;
    color: #831843;
}

.cookie-type--functional {
    background: #d1fae5;
    color: #065f46;
}

/* ===================================
   PLANS (Refund Policy)
   =================================== */

.legal-plans {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.legal-plan-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.legal-plan-card:hover {
    border-color: #d1fe17;
}

.legal-plan__name {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.5rem;
}

.legal-plan__price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #d1fe17;
    margin-bottom: 0.75rem;
}

.legal-plan__features,
.legal-plan__billing {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0.5rem;
}

.legal-plan__billing strong {
    font-weight: 600;
    color: #000000;
    margin-right: 0.5rem;
}

/* Tablet and up */
@media (min-width: 640px) {
    .legal-plans {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .legal-plans {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* ===================================
   SUBPROCESSORS (DPA)
   =================================== */

.legal-subprocessors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.legal-subprocessor-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.legal-subprocessor-card:hover {
    border-color: #d1fe17;
}

.legal-subprocessor__name {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1rem;
}

.legal-subprocessor__purpose,
.legal-subprocessor__location,
.legal-subprocessor__safeguards {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0.75rem;
}

.legal-subprocessor__purpose strong,
.legal-subprocessor__location strong,
.legal-subprocessor__safeguards strong {
    display: block;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.25rem;
}

/* Tablet and up */
@media (min-width: 640px) {
    .legal-subprocessors {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   CONTACT INFORMATION
   =================================== */

.legal-contact {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
}

.legal-contact p {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0.75rem;
}

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

.legal-contact strong {
    font-weight: 600;
    color: #000000;
    display: inline-block;
    min-width: 100px;
}

.legal-contact a {
    color: #000000;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.legal-contact a:hover {
    color: #d1fe17;
}

.legal-contact__note {
    font-size: 0.9375rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 1rem;
}

.legal-contact__address {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ===================================
   CTA SECTION
   =================================== */

.legal-cta {
    background: #000000; /* ONLY #000000 for dark backgrounds */
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 32px;
    margin: 3rem auto;
    max-width: 1400px;
}

.legal-cta__container {
    max-width: 800px;
    margin: 0 auto;
}

.legal-cta__title {
    font-family: 'Stack Sans Headline', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.legal-cta__description {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: #e5e7eb;
    margin-bottom: 2rem;
}

.legal-cta__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.legal-cta__button {
    display: inline-block;
    background: #d1fe17; /* Lime green */
    color: #000000;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 300px;
}

.legal-cta__button:hover {
    background: #ffffff;
    color: #000000;
}

.legal-cta__button--secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.legal-cta__button--secondary:hover {
    background: #ffffff;
    color: #000000;
}

/* Tablet and up */
@media (min-width: 640px) {
    .legal-cta__actions {
        flex-direction: row;
        justify-content: center;
    }

    .legal-cta__button {
        width: auto;
        max-width: none;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .legal-cta {
        padding: 5rem 2rem;
        margin: 4rem auto;
    }
}

/* ===================================
   RESPONSIVE TYPOGRAPHY
   =================================== */

/* Mobile adjustments */
@media (max-width: 639px) {
    .legal-hero {
        padding: 6rem 1.5rem 3rem 1.5rem;
    }

    .legal-content {
        padding: 3rem 1.5rem;
    }

    .legal-section {
        margin-bottom: 3rem;
    }

    .legal-subsection {
        padding-left: 1rem;
    }

    .legal-table {
        font-size: 0.875rem;
    }

    .legal-table thead th,
    .legal-table tbody td {
        padding: 0.75rem;
    }
}

/* Print styles */
@media print {
    .legal-hero,
    .legal-content {
        padding: 1rem 0;
    }

    .legal-cta,
    .announcement-banner,
    .navigation,
    .footer-modern {
        display: none;
    }

    .legal-section {
        page-break-inside: avoid;
    }

    .legal-section__title {
        page-break-after: avoid;
    }
}
