/* ===========================
   Legal Pages — Shared Styles
   =========================== */

/* Override body for legal pages */
body.legal-page {
    padding-top: 0;
}

/* ===========================
   Legal Hero
   =========================== */
.legal-hero {
    background: linear-gradient(135deg, #0d4f2e 0%, #1a7a4a 100%);
    padding: 100px 0 60px;
    position: relative;
    overflow: hidden;
}
.legal-hero::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    top: -100px; right: -80px;
    pointer-events: none;
}

.legal-hero-content {
    max-width: 760px;
    position: relative;
    z-index: 1;
}
.legal-hero-content .section-tag {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}
.legal-hero-content h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: white;
    margin: 16px 0 20px;
    line-height: 1.2;
}
.legal-hero-content p {
    color: rgba(255,255,255,0.85);
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 28px;
}
.legal-hero-content strong { color: white; }

.legal-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.legal-meta span {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.15);
}

/* ===========================
   Legal Content Layout
   =========================== */
.legal-content {
    padding: 64px 0 96px;
    background: var(--bg-light);
}

.legal-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: start;
}

/* ===========================
   Table of Contents (Sidebar)
   =========================== */
.toc {
    position: sticky;
    top: 96px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.toc h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.toc nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.toc a {
    display: block;
    padding: 7px 10px;
    font-size: 0.83rem;
    color: var(--text-body);
    border-radius: 8px;
    line-height: 1.4;
    transition: background var(--transition), color var(--transition);
    border-left: 2px solid transparent;
}
.toc a:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.toc a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

/* ===========================
   Legal Body
   =========================== */
.legal-body {
    background: white;
    border-radius: var(--radius-xl);
    padding: 48px 52px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.legal-body section {
    padding: 0 0 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}
.legal-body section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.legal-body h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.legal-body h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.legal-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 28px 0 12px;
}

.legal-body p {
    font-size: 0.93rem;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 16px;
}
.legal-body p:last-child { margin-bottom: 0; }

.legal-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legal-body a:hover { color: var(--primary-dark); }

/* ===========================
   Legal List
   =========================== */
.legal-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.legal-list li {
    position: relative;
    padding-left: 20px;
    font-size: 0.93rem;
    color: var(--text-body);
    line-height: 1.6;
}
.legal-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
}
.legal-list strong { color: var(--text-dark); }

/* ===========================
   Info / Warning Boxes
   =========================== */
.info-box, .warning-box {
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 20px 0;
    font-size: 0.9rem;
    line-height: 1.65;
}
.info-box {
    background: #e8f5e9;
    border-left: 4px solid var(--primary);
}
.info-box strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.info-box p { color: #2e5e3e; margin-bottom: 0; }

.warning-box {
    background: #fff8e1;
    border-left: 4px solid #f5a623;
}
.warning-box strong {
    display: block;
    color: #8a5a0a;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.warning-box p { color: #7a5000; margin-bottom: 0; }
.warning-box a { color: var(--primary); }

/* ===========================
   Use Case Grid
   =========================== */
.use-case-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0 24px;
}
.use-case {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: box-shadow var(--transition);
}
.use-case:hover { box-shadow: var(--shadow-sm); }
.use-case h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.use-case p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.55;
}

/* ===========================
   Rights Grid
   =========================== */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0 24px;
}
.right-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}
.right-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.right-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.right-item p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.55;
}

/* ===========================
   Contact Card
   =========================== */
.contact-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cc-item strong {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 4px;
}
.cc-item span, .cc-item a {
    font-size: 0.92rem;
    color: var(--text-dark);
    display: block;
    line-height: 1.5;
}
.cc-item a { color: var(--primary); }
.cc-item a:hover { text-decoration: underline; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px) {
    .legal-layout { grid-template-columns: 1fr; }
    .toc { position: static; max-height: none; }
    .toc nav { display: grid; grid-template-columns: repeat(2, 1fr); }
    .legal-body { padding: 32px 28px; }
}

@media (max-width: 640px) {
    .use-case-grid, .rights-grid { grid-template-columns: 1fr; }
    .toc nav { grid-template-columns: 1fr; }
    .legal-body { padding: 24px 20px; }
    .legal-body h2 { font-size: 1.25rem; }
}
