/* ============================================================
   Theme v3 : DARK + Inter + palette gold/emerald + syntax-highlight
   Shared across all SaaS of the portfolio.
   ============================================================ */

:root {
    /* Brand accents */
    --brand-primary:       #ffc107;      /* warm gold — CTAs */
    --brand-primary-hover: #e5ac00;
    --brand-primary-dark:  #b8860b;
    --brand-success:       #10b981;      /* emerald — verified / success */
    --brand-success-light: rgba(16, 185, 129, 0.15);
    --brand-success-text:  #34d399;

    /* Dark surfaces (slate) */
    --bg-root:     #0b1220;              /* body background — deepest slate */
    --bg-surface: #111a2e;               /* cards / sections */
    --bg-elevated: #172036;              /* hovered/focused surfaces */
    --bg-code:    #0d1524;               /* code blocks bg */

    /* Borders */
    --border-subtle: #1e2a47;
    --border-default: #273553;

    /* Text */
    --text:        #e2e8f0;              /* default text */
    --text-strong: #f8fafc;              /* headings / strong */
    --text-muted:  #94a3b8;              /* muted */
    --text-dim:    #64748b;              /* dim / placeholders */
}

/* ---------- Base typography ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    color: var(--text);
    background: var(--bg-root);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}
.lead, p, li { color: var(--text); }
.text-muted, .text-secondary { color: var(--text-muted) !important; }
.text-muted-2 { color: var(--text-muted) !important; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-hover); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn { border-radius: .5rem; font-weight: 600; transition: all .15s ease; }
.btn-primary, .btn-warning {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #1f2937;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
    color: #1f2937 !important;
}
.btn-outline-dark, .btn-outline-light {
    border-color: var(--border-default);
    color: var(--text-strong);
}
.btn-outline-dark:hover, .btn-outline-light:hover {
    background-color: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-strong);
}
.btn-outline-secondary {
    border-color: var(--border-default);
    color: var(--text);
}
.btn-outline-secondary:hover {
    background-color: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-strong);
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: .75rem;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.card.rounded-4 { border-radius: 1rem; }
.card-body { color: var(--text); }
.card.border-primary { border-color: var(--brand-primary); }
.card.border-success { border-color: var(--brand-success); }
.card.border-danger  { border-color: #ef4444; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    background-color: var(--bg-elevated);
    border-color: var(--brand-primary);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}
.form-control::placeholder { color: var(--text-dim); }
.form-label { color: var(--text-strong); font-weight: 500; }
.form-text, .form-check-label { color: var(--text-muted); }
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #ef4444;
    background-image: none;
}
.invalid-feedback { color: #fca5a5; }

/* ---------- Navbar ---------- */
.navbar { padding-top: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-subtle); }
.navbar.bg-white,
.navbar {
    background: rgba(11, 18, 32, 0.85) !important;
    backdrop-filter: blur(10px);
}
.navbar-light .navbar-brand,
.navbar .navbar-brand { color: var(--text-strong); font-weight: 800; letter-spacing: -0.02em; }
.navbar-light .navbar-nav .nav-link,
.navbar .navbar-nav .nav-link { color: var(--text-muted); }
.navbar-light .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link:hover { color: var(--text-strong); }
.navbar-toggler { border-color: var(--border-default); }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(255, 193, 7, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-root) 0%, var(--bg-root) 100%);
    padding: 1.5rem 0 4rem;
    border-bottom: 1px solid var(--border-subtle);
}
.hero h1 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--text-strong); }
.hero .lead { color: var(--text-muted); font-size: 1.15rem; }
.hero .badge {
    background: var(--brand-success-light);
    color: var(--brand-success-text);
    font-weight: 600;
    padding: .5rem 1rem;
    border-radius: 2rem;
    font-size: .85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ---------- Sections ---------- */
section { padding-top: 4rem; padding-bottom: 4rem; }
.bg-white, .bg-light, .bg-surface-alt { background: var(--bg-surface) !important; }
.border-top { border-top: 1px solid var(--border-subtle) !important; }
.border-bottom { border-bottom: 1px solid var(--border-subtle) !important; }

/* ---------- Footer ---------- */
footer.site-footer {
    background: var(--bg-root);
    color: var(--text-muted);
    padding: 3rem 0;
    margin-top: 5rem;
    border-top: 1px solid var(--border-subtle);
}
footer.site-footer a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
footer.site-footer a:hover { color: var(--brand-primary); }
footer.site-footer .footer-heading { color: var(--text-strong); font-weight: 600; margin-bottom: 1rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
footer.site-footer hr { border-color: var(--border-subtle) !important; }

/* ---------- Code / Syntax highlighting ---------- */
pre, pre code.hljs, pre code {
    background: var(--bg-code) !important;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: .75rem;
    overflow-x: auto;
    font-size: .875rem;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, Consolas, monospace;
    border: 1px solid var(--border-subtle);
    margin: 1rem 0;
}
pre code { background: transparent !important; padding: 0; border: 0; }
/* Inline code */
:not(pre) > code {
    background: var(--bg-elevated);
    color: var(--brand-primary);
    padding: .125rem .375rem;
    border-radius: .25rem;
    font-size: .875em;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, Consolas, monospace;
    border: 1px solid var(--border-subtle);
}

/* ---------- Dashboard sidebar ---------- */
.dashboard-sidebar {
    background: var(--bg-root);
    border-right: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 240px;
    min-height: 100vh;
}
.dashboard-sidebar .nav-link { color: var(--text-muted); border-radius: .5rem; padding: .5rem .75rem; margin-bottom: .25rem; }
.dashboard-sidebar .nav-link:hover { background: var(--bg-surface); color: var(--text-strong); }
.dashboard-sidebar .nav-link.active { background: var(--brand-primary); color: #1f2937; font-weight: 600; }

/* ---------- Step numbers ---------- */
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: var(--brand-primary); color: #1f2937;
    font-weight: 800; margin-bottom: 1rem;
}

/* ---------- Feature icons ---------- */
.feature-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem; border-radius: .75rem;
    background: var(--brand-success-light); color: var(--brand-success-text);
    font-size: 1.5rem; margin-bottom: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ---------- Pricing slider ---------- */
.pricing-slider { width: 100%; height: .5rem; -webkit-appearance: none; appearance: none; background: var(--border-default); border-radius: 1rem; outline: none; }
.pricing-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-primary); cursor: pointer; box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4); }
.pricing-slider::-moz-range-thumb { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-primary); cursor: pointer; border: 0; }

/* ---------- Badges ---------- */
.badge.bg-light, .badge.bg-light.text-dark {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-subtle);
}
.badge-verified { background: var(--brand-success-light); color: var(--brand-success-text); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-basic    { background: var(--bg-elevated); color: var(--text-muted); }
.badge-disposable { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* ---------- Markdown docs ---------- */
.markdown-body h1 { margin-top: 0; font-size: 2rem; }
.markdown-body h2 { margin-top: 2.5rem; font-size: 1.5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border-subtle); }
.markdown-body h3 { margin-top: 2rem; font-size: 1.25rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol { color: var(--text); line-height: 1.65; }
.markdown-body table { width: 100%; margin: 1rem 0; border-collapse: collapse; }
.markdown-body table th, .markdown-body table td { padding: .5rem .75rem; border: 1px solid var(--border-subtle); text-align: left; }
.markdown-body table th { background: var(--bg-elevated); font-weight: 600; color: var(--text-strong); }

/* ---------- Accordion (FAQ) ---------- */
.accordion-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: .75rem !important;
    margin-bottom: .75rem;
    overflow: hidden;
    color: var(--text);
}
.accordion-button {
    background: var(--bg-surface);
    color: var(--text-strong);
    font-weight: 600;
}
.accordion-button:not(.collapsed) {
    background: var(--bg-elevated);
    color: var(--text-strong);
    box-shadow: none;
}
.accordion-button:focus { box-shadow: none; border-color: var(--brand-primary); }
.accordion-button::after { filter: invert(0.8); }
.accordion-body { color: var(--text-muted); background: var(--bg-surface); }

/* ---------- Alerts ---------- */
.alert-success { background: var(--brand-success-light); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--brand-success-text); }
.alert-danger  { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-warning { background: rgba(255, 193, 7, 0.1); border: 1px solid rgba(255, 193, 7, 0.3); color: #fde68a; }
.alert-info    { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #93c5fd; }

/* ---------- Tables ---------- */
.table { color: var(--text); --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border-subtle); }
.table > :not(caption) > * > * { background: transparent; color: var(--text); border-color: var(--border-subtle); }
.table-light > :not(caption) > * > * { background: var(--bg-elevated) !important; color: var(--text-strong) !important; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(255, 255, 255, 0.02); color: var(--text); }

/* ---------- Copy button ---------- */
.btn-copied { background: var(--brand-success) !important; border-color: var(--brand-success) !important; color: #fff !important; }

/* ---------- Utility ---------- */
.bg-surface-alt { background: var(--bg-surface) !important; }
.text-muted-2 { color: var(--text-muted) !important; }
hr { border-color: var(--border-subtle); opacity: 1; }

/* Modals (Bootstrap overrides) */
.modal-content { background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border-subtle); }
.btn-close { filter: invert(0.9); }

/* ============================================================
   Docs : full-width layout, sticky sidebar, on-page TOC
   ============================================================ */
.docs-layout {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: calc(100vh - 64px);
}

/* --- Left sidebar --- */
.docs-sidebar {
    flex: 0 0 264px;
    border-right: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--bg-root) 0%, rgba(11, 18, 32, 0.6) 100%);
    position: sticky;
    top: 64px;
    align-self: flex-start;
    height: calc(100vh - 64px);
    overflow-y: auto;
}
.docs-sidebar-inner { padding: 1.75rem 1rem 2.5rem; }
.docs-sidebar-section {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 700;
    padding: 0 0.75rem 0.85rem;
}
.docs-nav { display: flex; flex-direction: column; gap: 1px; }
.docs-nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.docs-nav-item:hover {
    background: var(--bg-surface);
    color: var(--text-strong);
}
.docs-nav-item.active {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.10), transparent 65%);
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 600;
}

/* --- Main column --- */
.docs-main {
    flex: 1 1 auto;
    display: flex;
    gap: 3rem;
    padding: 2.5rem 3rem 5rem;
    min-width: 0;
}
.docs-article {
    flex: 1 1 auto;
    max-width: 820px;
    min-width: 0;
}
.docs-article.markdown-body h1 { margin-top: 0; }

/* --- Right TOC --- */
.docs-toc {
    flex: 0 0 220px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    font-size: 0.85rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--border-subtle);
}
.docs-toc-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 0.85rem;
}
.docs-toc-nav { display: flex; flex-direction: column; }
.docs-toc-nav a {
    display: block;
    padding: 0.3rem 0 0.3rem 0.85rem;
    margin-left: -1px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    line-height: 1.4;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.docs-toc-nav a:hover { color: var(--text-strong); }
.docs-toc-nav a.active {
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 500;
}
.docs-toc-nav a.toc-h3 {
    padding-left: 1.7rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}
.docs-toc-nav a.toc-h3.active { color: var(--brand-primary); }

/* --- Pager --- */
.docs-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}
.docs-pager-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.12s ease, background-color 0.12s ease, transform 0.12s ease;
}
.docs-pager-link:hover {
    border-color: var(--brand-primary);
    background: var(--bg-elevated);
    color: var(--text-strong);
}
.docs-pager-link.next { text-align: right; align-items: flex-end; }
.docs-pager-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.docs-pager-title { font-weight: 600; color: var(--text-strong); }

/* --- Smooth scroll + headings hover anchors --- */
html { scroll-behavior: smooth; }
.docs-article h2, .docs-article h3 { scroll-margin-top: 80px; }

/* --- Responsive --- */
@media (max-width: 1200px) {
    .docs-toc { display: none; }
    .docs-main { gap: 0; padding: 2rem 2.5rem 4rem; }
}
@media (max-width: 768px) {
    .docs-layout { flex-direction: column; }
    .docs-sidebar {
        flex: 0 0 auto;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        background: var(--bg-surface);
    }
    .docs-sidebar-inner { padding: 1rem; }
    .docs-main { padding: 1.5rem 1rem 3rem; }
    .docs-pager { grid-template-columns: 1fr; }
}
