/* ══════════════════════════════════════════════
   Habit Planner — Legal Pages Stylesheet
   Ananta Software © 2026
   ══════════════════════════════════════════════ */

:root {
    --primary: #00C853;
    --primary-dark: #00A844;
    --primary-light: #E8F5E9;
    --bg: #F8FAF8;
    --surface: #FFFFFF;
    --border: #E8ECE8;
    --text-primary: #1A1A2E;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --accent-dark: #1A1A2E;
    --error: #EF5350;
    --radius: 16px;
    --max-width: 780px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ── Navigation ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 250, 248, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.nav-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
}

/* ── Hero ── */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 40px;
    text-align: center;
}

.hero-icon {
    width: 72px;
    height: 72px;
    background: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.hero-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.hero h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.hero .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.hero .effective-date {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Table of Contents ── */
.toc {
    max-width: var(--max-width);
    margin: 0 auto 40px;
    padding: 0 24px;
}

.toc-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.toc h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.toc ol {
    list-style: none;
    counter-reset: toc-counter;
    columns: 2;
    column-gap: 24px;
}

.toc li {
    counter-increment: toc-counter;
    margin-bottom: 8px;
}

.toc li a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
    transition: color 0.2s;
}

.toc li a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    min-width: 20px;
}

.toc li a:hover {
    color: var(--primary-dark);
}

/* ── Content ── */
.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.section-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.section p {
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
}

.section ul, .section ol {
    margin: 12px 0 16px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.section li {
    margin-bottom: 8px;
    line-height: 1.7;
}

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

/* ── Highlight boxes ── */
.highlight-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 12px 12px 0;
    padding: 16px 20px;
    margin: 20px 0;
}

.highlight-box p {
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 0;
}

.warning-box {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
    border-radius: 0 12px 12px 0;
    padding: 16px 20px;
    margin: 20px 0;
}

.warning-box p {
    color: #E65100;
    font-weight: 500;
    margin-bottom: 0;
}

/* ── Data table ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table thead {
    background: var(--accent-dark);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.data-table tbody tr:nth-child(even) {
    background: var(--bg);
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

/* ── Contact card ── */
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 20px;
}

.contact-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.contact-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.contact-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--primary);
}

.contact-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-value a {
    color: var(--primary);
    text-decoration: none;
}

.contact-value a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    text-align: center;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ── Back to top ── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
    transition: transform 0.2s;
    z-index: 50;
}

.back-to-top:hover {
    transform: scale(1.1);
}

.back-to-top.visible {
    display: flex;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 26px;
    }

    .toc ol {
        columns: 1;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 13px;
    }

    .section h2 {
        font-size: 18px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .contact-card {
        padding: 20px;
    }
}

/* ── Print styles ── */
@media print {
    .nav, .back-to-top, .toc {
        display: none;
    }

    .hero {
        padding-top: 20px;
    }

    body {
        font-size: 14px;
    }
}
