/* ============================================================
   LEGAL PAGES (Privacy Policy / Terms & Conditions)
   Shared styling — matches the site's brand, typography and
   spacing while staying lightweight (no canvas / three.js).
   ============================================================ */

/* ---------- Hero banner ---------- */
.legal-hero {
    position: relative;
    padding: 160px 0 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -100px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.legal-hero::after {
    content: '';
    position: absolute;
    bottom: -140px;
    left: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.12);
}

/* Two-column hero grid: copy on the left, animated visual on the right */
.legal-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: center;
    gap: 48px;
}

.legal-hero-inner {
    max-width: 640px;
    animation: legalFadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.legal-hero .section-label {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.legal-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 16px 0 14px;
}

.legal-hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 640px;
}

.legal-hero .legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 6px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 600;
    animation: legalFadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: 0.15s;
}

@keyframes legalFadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero visual (right side): animated tech/healthcare motif ---------- */
.legal-hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 340px;
    animation: legalFadeInUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: 0.1s;
}

.lhv-stage {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lhv-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(63, 224, 205, 0.28) 0%, rgba(63, 224, 205, 0) 70%);
    animation: lhvPulseGlow 4s ease-in-out infinite;
}

.lhv-ring {
    position: absolute;
    inset: 0;
    border: 1.5px dashed rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    animation: lhvSpin 30s linear infinite;
}

.lhv-ring-2 {
    position: absolute;
    inset: 34px;
    border: 1.5px solid rgba(63, 224, 205, 0.35);
    border-radius: 50%;
    animation: lhvSpin 22s linear infinite reverse;
}

.lhv-core {
    position: relative;
    z-index: 2;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(63, 224, 205, 0.14));
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 50px rgba(63, 224, 205, 0.25);
    animation: lhvFloat 5s ease-in-out infinite;
}

.lhv-core svg {
    width: 62px;
    height: 62px;
    color: #fff;
}

.lhv-pulse-line {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: 74%;
    opacity: 0.55;
}

.lhv-pulse-line svg {
    width: 100%;
    height: auto;
    display: block;
    stroke: #3fe0cd;
}

.lhv-pulse-line path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: lhvDrawPulse 3.2s ease-in-out infinite;
}

.lhv-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 10px;
    border-radius: 100px;
    background: rgba(10, 27, 61, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    animation: lhvFloatChip 4.5s ease-in-out infinite;
}

.lhv-chip svg {
    width: 14px;
    height: 14px;
    color: #3fe0cd;
    flex-shrink: 0;
}

.lhv-chip.c1 { top: 4%; left: -6%; animation-delay: 0s; }
.lhv-chip.c2 { top: 20%; right: -10%; animation-delay: 1s; }
.lhv-chip.c3 { bottom: 8%; left: -10%; animation-delay: 2s; }

@keyframes lhvPulseGlow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

@keyframes lhvSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes lhvFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes lhvFloatChip {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes lhvDrawPulse {
    0%   { stroke-dashoffset: 300; }
    50%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -300; }
}

@media (prefers-reduced-motion: reduce) {
    .legal-hero-inner,
    .legal-hero .legal-updated,
    .legal-hero-visual,
    .lhv-glow,
    .lhv-ring,
    .lhv-ring-2,
    .lhv-core,
    .lhv-chip,
    .lhv-pulse-line path {
        animation: none !important;
    }
}

/* ---------- Body layout: sticky TOC + prose ---------- */
.legal-body {
    padding: 64px 0 96px;
    background: var(--white);
}

.legal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

/* Sidebar table of contents */
.legal-toc {
    position: sticky;
    top: 120px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 22px 20px;
}

.legal-toc h4 {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 14px;
}

.legal-toc ol {
    list-style: none;
    counter-reset: legal-toc-counter;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legal-toc li {
    counter-increment: legal-toc-counter;
}

.legal-toc a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    line-height: 1.4;
    transition: var(--transition);
}

.legal-toc a::before {
    content: counter(legal-toc-counter);
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.legal-toc a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.legal-toc a:hover::before {
    background: var(--primary);
    color: #fff;
}

/* Mobile TOC: rendered as a horizontally-scrollable chip row instead
   of a sticky sidebar (see media query below). */
.legal-toc-mobile {
    display: none;
}

/* ---------- Prose content ---------- */
.legal-content {
    max-width: 760px;
    color: var(--gray-700);
    min-width: 0;
}

.legal-content section {
    scroll-margin-top: 130px;
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--gray-100);
}

.legal-content section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-content .legal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 800;
    margin-right: 12px;
    flex-shrink: 0;
}

.legal-content h2 {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.legal-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 22px 0 10px;
}

.legal-content p {
    font-size: 0.98rem;
    line-height: 1.8;
    margin-bottom: 14px;
}

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

.legal-content ul,
.legal-content ol.legal-list {
    margin: 0 0 14px 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-content ul li,
.legal-content ol.legal-list li {
    position: relative;
    padding-left: 26px;
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
}

.legal-content ol.legal-list {
    counter-reset: legal-item;
}

.legal-content ol.legal-list li::before {
    counter-increment: legal-item;
    content: counter(legal-item);
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-content a.inline-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content strong {
    color: var(--gray-900);
}

.legal-highlight-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--teal);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 18px 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--gray-600);
}

/* Simple responsive table for e.g. data-retention / cookie tables */
.legal-table-wrap {
    overflow-x: auto;
    margin: 18px 0;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
}

.legal-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.legal-table th {
    background: var(--gray-50);
    color: var(--gray-900);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

/* Contact card at the bottom of each legal page */
.legal-contact-card {
    margin-top: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 26px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    align-items: center;
    justify-content: space-between;
}

.legal-contact-card .lcc-text h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.legal-contact-card .lcc-text p {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin: 0;
}

.legal-contact-card .lcc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legal-contact-card .lcc-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 100px;
    background: #fff;
    border: 1px solid var(--gray-200);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    transition: var(--transition);
    white-space: nowrap;
}

.legal-contact-card .lcc-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Cross-link between the two legal pages */
.legal-crosslink {
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.legal-crosslink a {
    color: var(--primary);
    font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .legal-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 36px;
    }
    .legal-hero {
        padding: 150px 0 48px;
    }
    .legal-hero h1 {
        font-size: 2.2rem;
    }
    .legal-hero-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 32px;
    }
    .legal-hero-visual {
        height: 280px;
    }
    .lhv-stage {
        width: 240px;
        height: 240px;
    }
    .lhv-core {
        width: 120px;
        height: 120px;
    }
    .lhv-core svg {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 900px) {
    /* Stack copy above the visual, centered, once the two-column
       layout gets too tight for both to breathe. */
    .legal-hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }
    .legal-hero-inner {
        max-width: 100%;
        margin: 0 auto;
    }
    .legal-hero-inner p {
        margin-left: auto;
        margin-right: auto;
    }
    .legal-hero-visual {
        order: -1;
        height: 220px;
        margin-bottom: 4px;
    }
    .lhv-stage {
        width: 190px;
        height: 190px;
    }
    .lhv-ring-2 {
        inset: 26px;
    }
    .lhv-core {
        width: 96px;
        height: 96px;
    }
    .lhv-core svg {
        width: 40px;
        height: 40px;
    }
    .lhv-chip {
        font-size: 0.64rem;
        padding: 6px 12px 6px 8px;
    }
    .lhv-chip.c1 { left: 0; }
    .lhv-chip.c2 { right: 0; }
    .lhv-chip.c3 { display: none; }
}

@media (max-width: 860px) {
    /* Collapse the sticky sidebar TOC into a horizontally scrollable
       chip row pinned above the content — keeps quick section-jumping
       without eating vertical space on phones/tablets. */
    .legal-layout {
        display: block;
    }
    .legal-toc {
        display: none;
    }
    .legal-toc-mobile {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 4px 14px;
        margin-bottom: 28px;
        border-bottom: 1px solid var(--gray-100);
        scrollbar-width: thin;
    }
    .legal-toc-mobile::-webkit-scrollbar {
        height: 4px;
    }
    .legal-toc-mobile::-webkit-scrollbar-thumb {
        background: var(--gray-200);
        border-radius: 4px;
    }
    .legal-toc-mobile a {
        flex-shrink: 0;
        padding: 8px 16px;
        border-radius: 100px;
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--gray-600);
        white-space: nowrap;
        transition: var(--transition);
    }
    .legal-toc-mobile a:hover,
    .legal-toc-mobile a:active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }
    .legal-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .legal-hero {
        padding: 138px 0 40px;
    }
    .legal-hero h1 {
        font-size: 1.7rem;
    }
    .legal-hero p {
        font-size: 0.95rem;
    }
    .legal-hero-visual {
        height: 190px;
    }
    .lhv-stage {
        width: 160px;
        height: 160px;
    }
    .lhv-core {
        width: 84px;
        height: 84px;
    }
    .lhv-core svg {
        width: 34px;
        height: 34px;
    }
    .lhv-pulse-line {
        width: 60%;
    }
    .legal-body {
        padding: 48px 0 64px;
    }
    .legal-content section {
        scroll-margin-top: 96px;
        padding-bottom: 28px;
        margin-bottom: 28px;
    }
    .legal-content h2 {
        font-size: 1.18rem;
    }
    .legal-content .legal-num {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        margin-right: 10px;
    }
    .legal-contact-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 20px;
    }
    .legal-contact-card .lcc-links {
        width: 100%;
    }
    .legal-contact-card .lcc-links a {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .legal-hero {
        padding: 128px 0 36px;
    }
    .legal-hero h1 {
        font-size: 1.45rem;
    }
    .legal-hero .legal-updated {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
    .legal-content h2 {
        font-size: 1.05rem;
    }
    .legal-content p,
    .legal-content ul li,
    .legal-content ol.legal-list li {
        font-size: 0.92rem;
    }
    .legal-table {
        min-width: 420px;
        font-size: 0.8rem;
    }
}
