/* ===== TOKENS ===== */
:root {
    --primary:       #10b981;
    --primary-hover: #059669;
    --primary-light: #ecfdf5;
    --dark:          #0f172a;
    --dark-2:        #1e293b;
    --muted:         #64748b;
    --border:        #e2e8f0;
    --bg:            #f8fafc;
    --white:         #ffffff;
    --radius:        12px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:     0 4px 12px rgba(0,0,0,.08);
    --shadow-lg:     0 10px 30px rgba(0,0,0,.12);
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
.d-none { display: none !important; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--dark);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== NAVBAR ===== */
.site-nav {
    background: var(--dark);
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.brand-accent { color: var(--primary); }

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

.nav-link-item {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all .2s;
}
.nav-link-item:hover { color: white; background: rgba(255,255,255,.07); }

.btn-nav-feedback {
    font-size: .8rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15);
    background: transparent;
    color: rgba(255,255,255,.8);
    cursor: pointer;
    transition: all .2s;
}
.btn-nav-feedback:hover { border-color: var(--primary); color: var(--primary); }

/* ===== HERO ===== */
.hero-section {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    padding: 56px 24px 52px;
    text-align: center;
}

.hero-inner { max-width: 620px; margin: 0 auto; }

.hero-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    line-height: 1.15;
    margin: 0 0 14px;
}

.hero-highlight {
    background: linear-gradient(90deg, var(--primary), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    color: rgba(255,255,255,.6);
    font-size: .95rem;
    line-height: 1.6;
    margin: 0 0 24px;
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.pill {
    font-size: .75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(16,185,129,.12);
    color: #34d399;
    border: 1px solid rgba(16,185,129,.2);
    letter-spacing: .3px;
}

/* ===== TOOL AREA ===== */
.tool-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
    flex: 1;
    width: 100%;
}

/* ===== STATS BAR ===== */
.stats-bar {
    position: sticky;
    top: 58px;
    z-index: 90;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.stats-left { display: flex; align-items: center; gap: 14px; }

.stat-item { display: flex; flex-direction: column; gap: 2px; }

.stat-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.4);
    font-weight: 600;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}
.stat-value.accent { color: var(--primary); }

.stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,.1);
}

.stat-badge {
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(16,185,129,.15);
    color: #34d399;
    border: 1px solid rgba(16,185,129,.2);
}

.stats-right { display: flex; align-items: center; gap: 10px; }

.btn-ghost {
    font-size: .8rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: transparent;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    transition: all .2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,.3); color: white; }

.btn-primary-action {
    font-size: .85rem;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 9px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
    letter-spacing: .2px;
}
.btn-primary-action:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,.4); }
.btn-primary-action:disabled { background: #475569; transform: none; box-shadow: none; cursor: not-allowed; opacity: .7; }

/* ===== TOOL CARD ===== */
.tool-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 40px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

/* DROP ZONE */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 36px 24px;
    min-height: 220px;
    cursor: pointer;
    transition: all .25s ease;
    text-align: center;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.drop-zone.has-file:hover { border-color: #a7f3d0; background: #f0fdf4; }
.drop-zone.drag-over { transform: scale(1.015); }

.drop-icon {
    width: 60px; height: 60px;
    background: rgba(16,185,129,.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 8px;
    transition: all .25s;
}
.drop-zone:hover .drop-icon, .drop-zone.drag-over .drop-icon {
    background: rgba(16,185,129,.18);
    transform: translateY(-2px);
}

.drop-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}
.drop-sub {
    font-size: .8rem;
    color: var(--muted);
    margin: 0;
}
.drop-limit {
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--muted);
    margin-top: 4px;
}

/* Drop zone states */
.dz-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.dz-link {
    color: var(--primary);
    font-weight: 600;
}

.dz-selected {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: center;
    padding: 8px 0;
}

.dz-check-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 2px solid #a7f3d0;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    flex-shrink: 0;
}

.dz-sel-name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dz-sel-size {
    font-size: .75rem;
    color: var(--muted);
    margin: 3px 0 0;
}

.dz-change-btn {
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 999px;
    padding: 5px 16px;
    cursor: pointer;
    transition: all .2s;
    margin-top: 4px;
}
.dz-change-btn:hover { color: var(--dark); border-color: #94a3b8; }

.drop-zone.has-file {
    border-style: solid;
    border-color: #a7f3d0;
    background: #f0fdf4;
    cursor: pointer;
}

/* Centered upload wrapper (dividir / ocr) */
.upload-centered-wrap {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* "Como funciona" steps row */
.tool-how {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 36px auto 0;
}

.tool-how-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.tool-how-num {
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    flex-shrink: 0;
}

.tool-how-label {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.45;
}

.alert-assinatura {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-size: .8rem;
    font-weight: 500;
    text-align: left;
}

/* CONFIG RIGHT */
.config-label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    margin: 0 0 4px;
}
.config-sub {
    font-size: .85rem;
    color: var(--muted);
    margin: 0 0 20px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 8px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--white);
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.level-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.level-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--dark);
}
.level-desc {
    font-size: .7rem;
    color: var(--muted);
}

.level-btn--ocr {
    border-color: var(--dark-2);
    background: var(--dark-2);
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 10px;
}
.level-btn--ocr .level-name { color: white; }
.level-btn--ocr .level-desc { color: rgba(255,255,255,.55); }
.level-btn--ocr:hover { border-color: var(--primary); background: var(--dark); }

.config-tip {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.4;
}
.config-tip svg { flex-shrink: 0; margin-top: 1px; }

/* ===== PREVIEW GRID ===== */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.page-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
}
.page-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.canvas-wrapper {
    height: 110px;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

canvas { width: 100%; height: auto; border-radius: 6px; transform: translateY(-70px); }

.skeleton-card {
    border-radius: var(--radius);
    padding: 14px;
    background: white;
    animation: skeleton-glow 1.5s infinite;
    border: 1.5px solid var(--border);
}
.skeleton-img {
    width: 100%; aspect-ratio: 3/4;
    background: #f1f5f9;
    border-radius: 8px;
}
@keyframes skeleton-glow { 0%, 100% { opacity: .5; } 50% { opacity: .9; } }

.form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: .5rem .75rem;
    font-size: .82rem;
    color: var(--dark);
}

/* ===== ZOOM BUTTON ===== */
.preview-zoom-btn {
    border: 0;
    background: transparent;
    padding: 4px 6px;
    border-radius: 8px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.preview-zoom-btn:hover { background: var(--border); color: var(--dark); }

/* ===== PROGRESS OVERLAY ===== */
#progressOverlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 30, 0.97);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    gap: 16px;
}

.overlay-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: pulse-icon 2s infinite;
}
@keyframes pulse-icon { 0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.3); } 50% { box-shadow: 0 0 0 10px rgba(16,185,129,0); } }

.overlay-status {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-align: center;
}

.overlay-progress-wrap { width: 100%; }

.overlay-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}
.overlay-progress-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #34d399);
    border-radius: 999px;
    transition: width .4s ease;
}

.progress-details { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.progress-pill {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .75rem;
    color: rgba(255,255,255,.7);
}

#logConsole {
    width: 100%;
    height: 140px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: .75rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #30363d transparent;
}
#logConsole::-webkit-scrollbar { width: 5px; }
#logConsole::-webkit-scrollbar-thumb { background: #30363d; border-radius: 8px; }

.log-line { margin-bottom: 3px; }
.log-info { color: #58a6ff; }

.overlay-hint {
    font-size: .75rem;
    color: rgba(255,255,255,.35);
    margin: 0;
}

#btnCancelar {
    padding: 9px 24px;
    border-radius: 9px;
    border: 1.5px solid rgba(239,68,68,.4);
    background: rgba(239,68,68,.08);
    color: #f87171;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
#btnCancelar:hover { background: rgba(239,68,68,.15); border-color: #f87171; }

#statusText { transition: opacity .2s ease-in-out; }

/* ===== LUPA MODAL ===== */
.pdf-modal.hidden { display: none; }
.pdf-modal { position: fixed; inset: 0; z-index: 9999; }
.pdf-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.pdf-modal__panel {
    position: relative;
    width: min(1100px, 96vw);
    height: min(90vh, 900px);
    margin: 4vh auto;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
}
.pdf-modal__header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.pdf-modal__title { color: #e5e7eb; font-weight: 600; font-size: .85rem; }
.pdf-modal__actions { display: flex; gap: 8px; }
.btn-mini {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #e5e7eb;
    cursor: pointer;
    font-size: .8rem;
    transition: background .2s;
}
.btn-mini:hover { background: rgba(255,255,255,.12); }
.pdf-modal__body { flex: 1; overflow: auto; padding: 14px; }
.pdf-modal__canvasWrap { display: flex; justify-content: center; }
#pdfPreviewCanvas { background: white; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }

/* ===== FEEDBACK MODAL ===== */
.fb-modal.hidden { display: none; }
.fb-modal { position: fixed; inset: 0; z-index: 9999; }
.fb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.fb-panel {
    position: relative;
    width: min(560px, 94vw);
    margin: 10vh auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.fb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.fb-title { font-weight: 800; color: var(--dark); }
.fb-close {
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: .8rem;
}
.fb-body { padding: 18px; }
.fb-hint { color: var(--muted); font-size: .8rem; margin-top: 8px; }
.fb-stars { display: flex; gap: 8px; margin-top: 6px; }
.fb-star {
    font-size: 28px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #cbd5e1;
    padding: 2px 4px;
    transition: color .15s, transform .15s;
}
.fb-star:hover, .fb-star.active { color: #f59e0b; transform: scale(1.1); }
.fb-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fb-status { font-size: .8rem; color: var(--muted); }

/* ===== FOOTER ===== */
.site-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    padding: 28px 24px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-brand-col { display: flex; flex-direction: column; gap: 6px; }
.footer-brand-row { display: flex; align-items: center; gap: 8px; }
.footer-brand { font-weight: 700; color: var(--dark); font-size: .9rem; }
.footer-tagline { color: var(--muted); font-size: .78rem; margin: 0; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .83rem; transition: color .2s; }
.footer-links a:hover { color: var(--dark); }
.footer-copy { color: #94a3b8; font-size: .78rem; }

/* ===== DOCS / COMO USAR ===== */
.docs-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    padding: 52px 24px 44px;
    text-align: center;
}
.docs-hero .hero-inner { max-width: 640px; margin: 0 auto; }
.docs-hero .hero-title { margin-bottom: 10px; }
.docs-hero .hero-sub { margin: 0; }

.docs-body {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    flex: 1;
}

.docs-section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    margin-bottom: 16px;
}

.docs-tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 32px;
}

.docs-tool-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.docs-tool-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1.5px solid;
}

.docs-tool-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.docs-tool-name {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: -.2px;
}

.docs-tool-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.docs-tool-body > p {
    font-size: .83rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}

.docs-steps { display: flex; flex-direction: column; gap: 9px; }

.docs-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .82rem;
    color: var(--dark);
    line-height: 1.4;
}

.docs-step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.docs-tool-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: opacity .2s;
    margin-top: 2px;
}
.docs-tool-btn:hover { opacity: .75; }

.docs-warning {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    font-size: .84rem;
    line-height: 1.55;
    color: #7c2d12;
    margin-bottom: 8px;
}
.docs-warning-icon { color: #ea580c; flex-shrink: 0; margin-top: 1px; }
.docs-warning strong { display: block; margin-bottom: 4px; font-size: .87rem; }
.docs-warning p { margin: 0; }

.docs-faq { display: flex; flex-direction: column; gap: 0; }

.docs-faq-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.docs-faq-item:last-child { border-bottom: none; }

.docs-faq-q {
    font-size: .88rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.docs-faq-a {
    font-size: .83rem;
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 760px) {
    .docs-tools { grid-template-columns: 1fr; }
    .docs-hero { padding: 36px 16px 30px; }
    .docs-body { padding: 32px 16px 60px; }
}

/* ===== LANDING PAGE ===== */
.hero-section { background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%); padding: 64px 24px 56px; text-align: center; }
.hero-inner { max-width: 560px; margin: 0 auto; }
.hero-title { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; color: white; letter-spacing: -1px; line-height: 1.15; margin: 0 0 14px; }
.hero-highlight { background: linear-gradient(90deg, var(--primary), #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { color: rgba(255,255,255,.6); font-size: .95rem; line-height: 1.6; margin: 0; }

.landing-tools { max-width: 1000px; margin: 0 auto; padding: 48px 24px 80px; }

.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.tool-card-link { text-decoration: none; display: block; }

.tool-card-home {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all .25s ease;
    cursor: pointer;
}
.tool-card-home:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0,0,0,.09);
    transform: translateY(-3px);
}

.tool-card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-card-title { font-size: 1.05rem; font-weight: 700; color: var(--dark); margin: 0; }
.tool-card-desc { font-size: .85rem; color: var(--muted); line-height: 1.55; margin: 0; flex: 1; }
.tool-card-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .83rem;
    font-weight: 700;
    margin-top: 4px;
}

/* ===== TOOL PAGES ===== */
.tool-page { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }

.tool-page-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}
.tool-page-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tool-page-title { font-size: 1.5rem; font-weight: 800; color: var(--dark); margin: 0 0 4px; letter-spacing: -.4px; }
.tool-page-desc { font-size: .875rem; color: var(--muted); margin: 0; }

.tool-main-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 36px;
    box-shadow: var(--shadow-sm);
}
.tool-main-card--centered {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tool-upload-col { display: flex; flex-direction: column; }
.tool-config-col { display: flex; flex-direction: column; }

/* Quality selector */
.quality-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.quality-option { cursor: pointer; }
.quality-option input[type="radio"] { display: none; }

.quality-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all .2s;
    cursor: pointer;
}
.quality-option input:checked + .quality-card {
    border-color: var(--primary);
    background: var(--primary-light);
}
.quality-card:hover { border-color: #94a3b8; }
.quality-card--recommended { border-color: #93c5fd; background: #f0f9ff; }
.quality-option input:checked + .quality-card--recommended { border-color: var(--primary); background: var(--primary-light); }

.quality-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.quality-name { font-size: .85rem; font-weight: 700; color: var(--dark); }
.quality-tag { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .3px; }
.quality-tag--green { background: #dcfce7; color: #15803d; }
.quality-tag--blue { background: #dbeafe; color: #1d4ed8; }
.quality-tag--orange { background: #ffedd5; color: #c2410c; }
.quality-desc { font-size: .78rem; color: var(--muted); margin: 0 0 6px; line-height: 1.4; }
.quality-ratio { font-size: .75rem; font-weight: 700; color: var(--primary); }

.btn-tool-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .2px;
}
.btn-tool-action:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16,185,129,.35); }
.btn-tool-action:disabled { background: #94a3b8; transform: none; box-shadow: none; cursor: not-allowed; }
.btn-tool-action--blue { background: #3b82f6; }
.btn-tool-action--blue:hover { background: #2563eb; box-shadow: 0 4px 14px rgba(59,130,246,.35); }
.btn-tool-action--purple { background: #8b5cf6; }
.btn-tool-action--purple:hover { background: #7c3aed; box-shadow: 0 4px 14px rgba(139,92,246,.35); }

.tool-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid;
    font-size: .82rem;
    line-height: 1.5;
}
.tool-info-box svg { flex-shrink: 0; margin-top: 1px; }

.drop-zone--large { min-height: 200px; }

/* ===== OVERLAY ANIMATION ===== */
.overlay-inner--in {
    animation: overlaySlideUp .4s cubic-bezier(.16, 1, .3, 1);
}
@keyframes overlaySlideUp {
    from { transform: translateY(28px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ===== OVERLAY FILENAME ===== */
.overlay-filename {
    font-size: .78rem;
    color: rgba(255,255,255,.45);
    margin: 0;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* ===== STEP INDICATOR ===== */
.overlay-steps {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.o-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.o-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: border-color .3s, background .3s, box-shadow .3s;
}

.o-step-label {
    font-size: .68rem;
    font-weight: 500;
    color: rgba(255,255,255,.25);
    white-space: nowrap;
    transition: color .3s;
}

.o-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,.1);
    margin-bottom: 24px;
    border-radius: 2px;
    transition: background .4s;
    min-width: 24px;
}
.o-step-line.done { background: var(--primary); }

/* active step */
.o-step.active .o-step-dot {
    border-color: var(--primary);
    background: rgba(16,185,129,.12);
    box-shadow: 0 0 0 5px rgba(16,185,129,.12);
    animation: stepPulse 1.8s ease-in-out infinite;
}
.o-step.active .o-step-label { color: #34d399; font-weight: 700; }

/* done step */
.o-step.done .o-step-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}
.o-step.done .o-step-dot::after {
    content: '✓';
    font-size: 13px;
    font-weight: 700;
    color: white;
}
.o-step.done .o-step-label { color: rgba(255,255,255,.55); }

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(16,185,129,.35); }
    50%       { box-shadow: 0 0 0 9px rgba(16,185,129,0);   }
}

/* ===== BUTTON SPINNER ===== */
.btn-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .tool-card { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
    .level-grid { grid-template-columns: repeat(3, 1fr); }
    .tools-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
    .tool-main-card { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
    .tool-how { grid-template-columns: 1fr; max-width: 320px; }
}

@media (max-width: 640px) {
    .hero-section { padding: 36px 16px 32px; }
    .tool-area { padding: 20px 16px 48px; }
    .stats-bar { flex-wrap: wrap; top: 58px; }
    .preview-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .page-card { padding: 10px; }
    .level-grid { grid-template-columns: repeat(2, 1fr); }
    .canvas-wrapper { height: auto; min-height: 100px; }
    canvas { transform: none !important; }
    .pdf-modal__panel { width: 100vw; height: 100vh; margin: 0; border-radius: 0; }
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
    .hero-title { font-size: 1.6rem; }
    .preview-grid { grid-template-columns: 1fr 1fr; }
}
