/* ==============================================
   DESIGN TOKENS & RESET
   ============================================== */
:root {
    /* Colors - Light Theme (Default) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #0ea5e9;
    --accent: #f43f5e;

    --bg-main: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-heading: 'Poppins', 'Outfit', 'Inter', 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;

    /* Effects */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 85%;
    /* Slightly reduced to keep it elegant but readable. 70% was too small. */
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition), color var(--transition);
}

h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 1.6rem;
}

h1 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 2rem;
    line-height: 1.2;
}

h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==============================================
   BUTTONS
   ============================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.4);
    color: #ffffff;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--text-muted);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--text-main);
    color: var(--bg-main);
    transform: translateY(-3px);
}

/* ==============================================
   HERO SECTION
   ============================================== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0 60px;
    overflow: hidden;
}

/* Blobs */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    border-radius: 50%;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite;
}

.blob-1 {
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: linear-gradient(to right, rgba(37, 99, 235, 0.4), rgba(14, 165, 233, 0.4));
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: linear-gradient(to right, rgba(244, 63, 94, 0.3), rgba(168, 85, 247, 0.3));
    animation-delay: -5s;
    animation-direction: reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
    animation: fadeInDown 0.8s ease forwards;
}

[data-theme="dark"] .badge {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.badge-tag {
    background: var(--primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    opacity: 1;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   SECTION STYLES
   ============================================== */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    /* Adjusted for consistency */
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.15rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

[data-theme="dark"] .glass-card:hover {
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}

.card-icon {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1.5rem;
}

.gradient-1 {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.gradient-2 {
    background: linear-gradient(135deg, #10b981, #3b82f6);
}

.gradient-3 {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.glass-card h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.glass-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    flex-grow: 1;
    font-size: 1.05rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

.update-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-link {
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-link:hover {
    gap: 12px;
}

/* ==============================================
   BACK TO TOP
   ============================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary));
}

.back-to-top:active {
    transform: translateY(-4px) scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-btns {
        flex-direction: column;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .blob {
        display: none;
    }
}

/* ==============================================
   POLICY & LEGAL DOCUMENT STYLES
   ============================================== */
.policy-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
    /* Deep vibrant blue like the screenshot */
    color: white;
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.policy-hero .container {
    position: relative;
    z-index: 2;
}

.policy-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    color: white;
}

.policy-hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.8rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.effective-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.policy-meta.container {
    max-width: fit-content;
    width: 95%;
    /* Limit width for smaller screens */
    margin: -40px auto 0;
    position: relative;
    z-index: 10;
}

.policy-meta-card {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 25px 30px;
    display: grid;
    grid-template-columns: 1.8fr 0.7fr 1.5fr 2.5fr 1fr; /* Adjusted for better content distribution */
    column-gap: 30px; /* Use gap for even distribution between columns */
    row-gap: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
}


.meta-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .meta-item {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-item:last-child {
    border-right: none;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body); /* Unify font */
}

.meta-label i {
    color: var(--primary);
    font-size: 0.85rem;
}

.meta-value {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
    font-family: var(--font-body); /* Unify font */
    word-break: break-word;
}

.meta-value a {
    color: var(--primary);
    transition: var(--transition);
}

.meta-value a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .policy-meta-card {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px 0;
    }

    .meta-item:nth-child(3) {
        border-right: none;
    }

    .meta-item:nth-child(4) {
        padding-left: 0;
    }
}

@media (max-width: 800px) {
    .policy-meta-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .meta-item {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: 0 0 15px 0 !important;
    }

    [data-theme="dark"] .meta-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .meta-item:last-child {
        border-bottom: none;
    }
}

@media (max-width: 500px) {
    .policy-meta-card {
        grid-template-columns: 1fr;
    }
}

/* Main Layout for Policy */
.policy-container {
    padding: 60px 0;
}

.policy-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

.toc-sidebar {
    position: sticky;
    top: 100px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 30px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
}

.toc-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.toc-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.toc-list li a .toc-number {
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.toc-list li a:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
    transform: translateX(5px);
}

.toc-list li a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.toc-list li a.active .toc-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.policy-content-body {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 60px;
    box-shadow: var(--glass-shadow);
    color: var(--text-main);
}

.policy-section {
    margin-bottom: 80px;
    scroll-margin-top: 120px;
    position: relative;
}

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

.policy-section .section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

.policy-section .section-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.policy-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.policy-section p,
.policy-section li,
.policy-section td {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.policy-section ul {
    margin-bottom: 1.5rem;
}

.policy-section li {
    margin-bottom: 0.8rem;
}

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

/* Highlight Animation */
@keyframes highlightSection {
    0% {
        background-color: transparent;
    }

    20% {
        background-color: rgba(37, 99, 235, 0.1);
    }

    100% {
        background-color: transparent;
    }
}

.policy-section.highlight {
    animation: highlightSection 2s ease;
    border-radius: 15px;
    padding: 10px;
    margin: -10px;
}

@media (max-width: 1100px) {
    .policy-grid {
        grid-template-columns: 1fr;
    }

    .toc-sidebar {
        display: none;
    }

    .policy-content-body {
        padding: 40px 20px;
    }
}