/* ============================================
   Teamworks Security Pages — Shared Styles
   Inherits design tokens from the marketing site
   ============================================ */

:root {
    --orange-500: #E86A3A;
    --orange-400: #FF7F5C;
    --orange-600: #D14B1F;
    --orange-700: #B33D15;
    --coral-100: #FFF1EB;
    --coral-200: #FFE0D3;
    --coral-300: #FFDAC8;
    --peach-50: #FFF9F5;
    --peach-100: #FFE8DD;
    --cream: #FFFCFA;
    --dark-900: #1B1B2F;
    --dark-800: #2D2D44;
    --dark-700: #3A3A55;
    --gray-500: #6B6B80;
    --gray-400: #8E8EA0;
    --gray-300: #B5B5C3;
    --gray-200: #D8D8E3;
    --gray-100: #EEEEF4;
    --green-100: #E8F8F0;
    --green-600: #2D9F6F;
    --amber-100: #FFF3D6;
    --amber-700: #B8860B;
    --red-100: #FDE8E8;
    --red-700: #B91C1C;
    --white: #FFFFFF;
    --font-display: 'Bricolage Grotesque', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 2px 8px rgba(27, 27, 47, 0.06);
    --shadow-md: 0 4px 20px rgba(27, 27, 47, 0.08);
    --shadow-lg: 0 8px 40px rgba(27, 27, 47, 0.1);
    --shadow-orange: 0 8px 32px rgba(232, 106, 58, 0.3);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--dark-800);
    background: var(--cream);
    line-height: 1.65;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: inherit; background: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

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

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-900);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 4vw, 3rem); }
h2 { font-size: 1.65rem; margin-top: 56px; margin-bottom: 16px; scroll-margin-top: 88px; }
h3 { font-size: 1.2rem; margin-top: 32px; margin-bottom: 10px; scroll-margin-top: 88px; }
h4 { font-size: 1rem; margin-top: 20px; margin-bottom: 8px; }

p {
    color: var(--dark-800);
    font-size: 1rem;
    margin-bottom: 16px;
}

strong { color: var(--dark-900); font-weight: 600; }

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--gray-100);
    color: var(--dark-900);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================
   Navigation (matches marketing site)
   ============================================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all var(--transition-medium);
    background: rgba(255, 252, 250, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(232, 106, 58, 0.08);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--orange-500);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(232, 106, 58, 0.3);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.nav-logo-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-900);
    letter-spacing: -0.02em;
}

.nav-logo-tagline {
    font-size: 0.65rem;
    color: var(--gray-400);
    font-weight: 500;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-500);
    transition: color var(--transition-fast);
    position: relative;
    padding: 4px 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: var(--orange-500);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}
.nav-link:hover { color: var(--dark-900); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active {
    color: var(--orange-500);
    font-weight: 600;
}
.nav-link.active::after { transform: scaleX(1); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 22px;
    border-radius: 60px;
    transition: all var(--transition-fast);
}
.btn-primary {
    background: var(--orange-500);
    color: var(--white);
    box-shadow: var(--shadow-orange);
}
.btn-primary:hover {
    background: var(--orange-600);
    transform: translateY(-2px);
}
.btn-secondary {
    background: var(--white);
    color: var(--dark-800);
    border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover {
    border-color: var(--orange-400);
    color: var(--orange-600);
}

.btn-icon { width: 18px; height: 18px; }

/* ============================================
   Page Header (hero replacement for doc pages)
   ============================================ */
.page-header {
    padding: 140px 0 48px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--gray-100);
}

.page-header::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at 30% 40%, var(--coral-200) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.4;
    pointer-events: none;
}

.page-header-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--coral-100);
    border: 1px solid var(--coral-300);
    padding: 5px 14px 5px 8px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--orange-600);
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}
.page-eyebrow-dot {
    width: 8px; height: 8px;
    background: var(--orange-500);
    border-radius: 50%;
}

.page-title { margin-bottom: 14px; }

.page-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 24px;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 0.85rem;
    color: var(--gray-400);
}
.page-meta strong {
    color: var(--dark-800);
    font-weight: 600;
    margin-right: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* ============================================
   Sub-Nav (security section)
   ============================================ */
.sub-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 70px;
    z-index: 100;
}
.sub-nav-inner {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sub-nav-inner::-webkit-scrollbar { display: none; }

.sub-nav-link {
    padding: 14px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.sub-nav-link:hover { color: var(--dark-900); }
.sub-nav-link.active {
    color: var(--orange-500);
    border-bottom-color: var(--orange-500);
    font-weight: 600;
}

/* ============================================
   Doc Layout (sidebar TOC + content)
   ============================================ */
.doc-section {
    padding: 56px 0 96px;
}

.doc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 64px;
    align-items: start;
}

.doc-toc {
    position: sticky;
    top: 140px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    font-size: 0.85rem;
    padding-right: 8px;
}
.doc-toc-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--orange-500);
    margin-bottom: 14px;
}
.doc-toc ol {
    counter-reset: toc-item;
    border-left: 1.5px solid var(--gray-200);
}
.doc-toc li { counter-increment: toc-item; }
.doc-toc a {
    display: block;
    padding: 7px 14px 7px 16px;
    color: var(--gray-500);
    border-left: 2px solid transparent;
    margin-left: -1.5px;
    transition: all var(--transition-fast);
    line-height: 1.35;
}
.doc-toc a:hover { color: var(--dark-900); }
.doc-toc a.active {
    color: var(--orange-500);
    border-left-color: var(--orange-500);
    font-weight: 600;
}

.doc-content {
    max-width: 720px;
    min-width: 0;
}
.doc-content > h2:first-child { margin-top: 0; }
.doc-content ul, .doc-content ol {
    margin: 0 0 18px 24px;
    list-style: revert;
}
.doc-content li {
    margin-bottom: 8px;
    line-height: 1.65;
}
.doc-content a {
    color: var(--orange-600);
    border-bottom: 1px dotted var(--orange-400);
    transition: all var(--transition-fast);
}
.doc-content a:hover {
    color: var(--orange-700);
    border-bottom-style: solid;
}
.doc-content hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 48px 0;
}

/* Tables */
.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 24px;
    font-size: 0.92rem;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
}
.doc-content thead {
    background: var(--peach-50);
}
.doc-content th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--dark-900);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--coral-200);
}
.doc-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--dark-800);
    vertical-align: top;
}
.doc-content tbody tr:last-child td { border-bottom: none; }
.doc-content tbody tr:hover { background: var(--peach-50); }

/* Callouts */
.callout {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    border-left: 4px solid;
    background: var(--gray-100);
    border-left-color: var(--gray-300);
}
.callout-title {
    font-weight: 600;
    color: var(--dark-900);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.callout-title svg { width: 18px; height: 18px; flex-shrink: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout-info { background: var(--coral-100); border-left-color: var(--orange-500); }
.callout-info .callout-title { color: var(--orange-700); }
.callout-warning { background: var(--amber-100); border-left-color: var(--amber-700); }
.callout-warning .callout-title { color: var(--amber-700); }
.callout-success { background: var(--green-100); border-left-color: var(--green-600); }
.callout-success .callout-title { color: var(--green-600); }

/* Status badges (for compliance / roadmap tables) */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-yes { background: var(--green-100); color: var(--green-600); }
.badge-no { background: var(--red-100); color: var(--red-700); }
.badge-partial { background: var(--amber-100); color: var(--amber-700); }
.badge-planned { background: var(--coral-100); color: var(--orange-600); }

/* Resource cards (download links etc.) */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}
.resource-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all var(--transition-fast);
}
.resource-card:hover {
    border-color: var(--orange-400);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.resource-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--coral-100);
    color: var(--orange-500);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.resource-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--dark-900);
    font-size: 1.02rem;
}
.resource-card-desc {
    font-size: 0.88rem;
    color: var(--gray-500);
    line-height: 1.5;
}
.resource-card-link {
    font-size: 0.85rem;
    color: var(--orange-600);
    font-weight: 600;
    margin-top: auto;
    padding-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-bottom: none !important;
}

/* ============================================
   Footer (matches marketing site)
   ============================================ */
.footer {
    padding: 64px 0 32px;
    border-top: 1px solid var(--gray-100);
    background: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand-desc {
    font-size: 0.88rem;
    color: var(--gray-400);
    line-height: 1.7;
    margin-top: 14px;
    max-width: 280px;
}

.footer-col-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--dark-900);
    margin-bottom: 16px;
}
.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--gray-400);
    padding: 4px 0;
    transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--orange-500); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 28px;
    border-top: 1px solid var(--gray-100);
}
.footer-bottom p {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin: 0;
}
.footer-bottom-links {
    display: flex;
    gap: 22px;
}
.footer-bottom-links a {
    font-size: 0.8rem;
    color: var(--gray-400);
    transition: color var(--transition-fast);
}
.footer-bottom-links a:hover { color: var(--orange-500); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .doc-layout { grid-template-columns: 1fr; gap: 0; }
    .doc-toc {
        position: static;
        max-height: none;
        margin-bottom: 32px;
        padding: 16px 20px;
        background: var(--white);
        border-radius: var(--radius-md);
        border: 1px solid var(--gray-200);
    }
    .doc-toc ol { border-left: none; }
    .doc-toc a { border-left: none; padding-left: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
    .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .page-header { padding: 110px 0 36px; }
    .nav-links { display: none; }
    .doc-content { font-size: 0.95rem; }
    .doc-content table { font-size: 0.82rem; }
    .doc-content th, .doc-content td { padding: 10px 12px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ============================================
   Print styles — for "Download PDF" via browser print
   ============================================ */
@media print {
    @page {
        size: letter;
        margin: 0.75in 0.75in;
    }
    body { background: white; color: black; font-size: 10.5pt; line-height: 1.5; }
    body::before { display: none; }

    .nav, .sub-nav, .footer, .page-actions, .doc-toc,
    .no-print, .page-header::before { display: none !important; }

    .container { max-width: 100%; padding: 0; }
    .page-header { padding: 0 0 18pt; border-bottom: 1pt solid #888; margin-bottom: 18pt; }
    .doc-section { padding: 0; }
    .doc-layout { display: block; }
    .doc-content { max-width: 100%; }

    h1 { font-size: 22pt; color: black; }
    h2 { font-size: 14pt; color: black; margin-top: 18pt; page-break-after: avoid; }
    h3 { font-size: 12pt; color: black; margin-top: 12pt; page-break-after: avoid; }
    p, li { color: black; orphans: 3; widows: 3; }

    .page-eyebrow { display: none; }
    .page-meta { font-size: 9pt; color: #555; }

    table {
        box-shadow: none;
        border: 1pt solid #ccc;
        page-break-inside: auto;
        font-size: 9.5pt;
    }
    thead { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; }
    tr { page-break-inside: avoid; }

    .callout {
        border: 1pt solid #999;
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        page-break-inside: avoid;
    }
    .badge {
        border: 0.5pt solid #999;
        background: white !important;
        color: black !important;
    }

    .resource-grid, .resource-card { display: none; }

    a {
        color: black;
        border-bottom: none !important;
    }
    .doc-content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
    }

    /* Page footer with URL and version */
    .print-footer {
        display: block !important;
        position: running(printFooter);
        font-size: 8pt;
        color: #888;
        border-top: 0.5pt solid #ccc;
        padding-top: 6pt;
        margin-top: 18pt;
        text-align: center;
    }
}
.print-footer { display: none; }
