/* ============================================================
   SmartQR Documentation — guide.css
   Clean editorial layout: Stripe-style sidebar + prose content
   ============================================================ */

:root {
    --sidebar-w:    248px;
    --content-max:  700px;
    --gap:          56px;
    --radius:       8px;

    --bg:           #ffffff;
    --sidebar-bg:   #f8f9fb;
    --border:       #e8eaed;
    --border-light: #f0f2f5;

    --text:         #0f1923;
    --muted:        #52616d;
    --subtle:       #8a97a3;

    --accent:       #2563eb;
    --accent-dim:   rgba(37, 99, 235, 0.08);
    --accent-mid:   rgba(37, 99, 235, 0.18);

    --green:        #166534;
    --green-bg:     #f0fdf4;
    --green-border: #bbf7d0;

    --amber:        #92400e;
    --amber-bg:     #fffbeb;
    --amber-border: #fde68a;
}

/* ─── Reset & base ───────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { display: block; max-width: 100%; height: auto; }

/* ─── Two-column docs layout ─────────────────────────── */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
    align-items: start;
}

/* ─── Sticky sidebar ─────────────────────────────────── */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 36px 0 48px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.sidebar-brand-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.sidebar-brand-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--subtle);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ─── Nav groups ─────────────────────────────────────── */

.toc { padding: 0 12px; }

.toc-group { margin-bottom: 20px; }

.toc-group-label {
    display: block;
    padding: 0 8px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--subtle);
}

.toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc li { margin: 0; }

.toc a {
    display: block;
    padding: 5px 8px;
    font-size: 13px;
    color: var(--muted);
    border-radius: 5px;
    transition: background 0.1s, color 0.1s;
    text-decoration: none;
    line-height: 1.4;
}

.toc a:hover {
    background: var(--border);
    color: var(--text);
    text-decoration: none;
}

/* ─── Main content column ────────────────────────────── */

.doc {
    padding: 60px var(--gap) 96px;
    max-width: calc(var(--content-max) + var(--gap) * 2);
}

/* ─── Page header ────────────────────────────────────── */

.doc-header {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.doc-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

h1 {
    margin: 0 0 16px;
    font-size: clamp(1.9rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
}

.doc-lead {
    margin: 0 0 24px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted);
    max-width: 600px;
}

.doc-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.doc-summary-item {
    background: var(--bg);
    padding: 16px 18px;
}

.doc-summary-item strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.doc-summary-item span {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.doc-support {
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--subtle);
    line-height: 1.6;
}

/* ─── Section structure ──────────────────────────────── */

main { max-width: var(--content-max); }

section { margin: 0; }

section + section {
    margin-top: 56px;
    padding-top: 52px;
    border-top: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 6px;
}

h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text);
}

.section-part {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--subtle);
    white-space: nowrap;
}

.section-intro {
    margin: 8px 0 24px;
    color: var(--muted);
    font-size: 14.5px;
}

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ─── Steps ──────────────────────────────────────────── */

.steps { margin-top: 24px; }

.step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0 16px;
    margin-bottom: 32px;
}

.step:last-child { margin-bottom: 0; }

.step-num {
    padding-top: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.step-num-badge {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--accent-mid);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.step-num-line {
    width: 1px;
    flex: 1;
    min-height: 20px;
    background: var(--border);
    margin-top: 6px;
}

.step:last-child .step-num-line { display: none; }

.step-body { padding-bottom: 4px; }

.step-label {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--subtle);
}

h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
}

/* Steps inside a section (not using .steps grid layout) */

.section-steps .section-step {
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px dashed var(--border);
}

.section-steps .section-step:first-child { margin-top: 4px; }

/* ─── Callouts ───────────────────────────────────────── */

.callout {
    margin: 20px 0;
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--accent-dim);
    font-size: 14px;
    line-height: 1.65;
}

.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }

.callout-title {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.callout.warn {
    border-left-color: #d97706;
    background: var(--amber-bg);
}
.callout.warn .callout-title { color: var(--amber); }

.callout.ok {
    border-left-color: #16a34a;
    background: var(--green-bg);
}
.callout.ok .callout-title { color: var(--green); }

/* ─── Checklists ─────────────────────────────────────── */

.checklist {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    position: relative;
    padding: 9px 0 9px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
}

.checklist li:last-child { border-bottom: 0; }

.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
}

.checklist strong {
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 1px;
}

/* Ordered list variant */
.num-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: numlist;
}

.num-list li {
    position: relative;
    padding: 9px 0 9px 26px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    line-height: 1.65;
    counter-increment: numlist;
}

.num-list li:last-child { border-bottom: 0; }

.num-list li::before {
    content: counter(numlist);
    position: absolute;
    left: 0;
    top: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 10.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 18px;
}

.num-list strong { font-weight: 600; color: var(--text); }

/* ─── Panels grid ────────────────────────────────────── */

.panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.panels.cols-1 { grid-template-columns: 1fr; }
.panels.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panels.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--sidebar-bg);
}

.panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    display: block;
}

.panel p {
    margin: 0 0 4px;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.55;
}

.panel p:last-child { margin-bottom: 0; }
.panel code { font-size: 0.88em; }

/* ─── Tables ─────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; min-width: 420px; }

th, td {
    padding: 10px 16px;
    text-align: left;
    vertical-align: top;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-light);
}

th {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--subtle);
    background: var(--sidebar-bg);
}

tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--accent-dim); }

/* ─── Code ───────────────────────────────────────────── */

code {
    padding: 0.12em 0.4em;
    border-radius: 4px;
    background: #eff2f7;
    color: #1e40af;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
    border: 1px solid #dde3ef;
    white-space: nowrap;
}

/* ─── Screenshots ────────────────────────────────────── */

figure { margin: 0; }

.shot {
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sidebar-bg);
}

.shot img { width: 100%; }

figcaption {
    padding: 9px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.5;
    background: var(--sidebar-bg);
}

/* ─── Section divider label ──────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 52px 0 36px;
    color: var(--subtle);
}

.divider span {
    white-space: nowrap;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Footer ─────────────────────────────────────────── */

.doc-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ─── Responsive ─────────────────────────────────────── */

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

    .sidebar {
        position: static;
        height: auto;
        padding: 20px 0 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-brand { padding-bottom: 16px; }

    .toc { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 16px; }
    .toc-group { margin-bottom: 0; }
    .toc-group-label { display: none; }
    .toc ul { display: flex; flex-wrap: wrap; gap: 4px; }

    .toc a {
        padding: 4px 10px;
        border: 1px solid var(--border);
        border-radius: 20px;
        font-size: 12.5px;
    }
    .toc a:hover { background: var(--accent-dim); color: var(--accent); }

    .doc { padding: 40px 28px 64px; }
    .doc-summary { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 14.5px; }
    .doc { padding: 28px 18px 52px; }
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.3rem; }
    .panels, .panels.cols-3, .panels.cols-4 { grid-template-columns: 1fr; }
    .step { grid-template-columns: 1fr; }
    .step-num { display: none; }
}
