/* ============================================
   DOCUMENTAÇÃO PÚBLICA - BRASMOBI
   Estilos compartilhados (estáticos)
   ============================================ */

:root {
    --primary-color: #009EF7;
    --primary-dark: #0077c2;
    --success-color: #50CD89;
    --warning-color: #FFC700;
    --danger-color: #F1416C;
    --purple-color: #7239EA;
    --info-color: #17a2b8;
    --ink: #2b2b3b;
    --muted: #6c757d;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 70px;
    line-height: 1.65;
    color: var(--ink);
    background-color: #f4f6fb;
}

a {
    text-decoration: none;
}

/* ============ Navbar ============ */
.navbar-brand img {
    height: 32px;
    width: 32px;
    border-radius: 8px;
    margin-right: 8px;
}

.navbar-brand {
    font-weight: 700;
    display: flex;
    align-items: center;
}

.navbar.bg-brasmobi {
    background: linear-gradient(135deg, #0077c2 0%, #009EF7 100%);
}

.navbar .nav-link {
    font-weight: 500;
}

.navbar .nav-link.active {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 6px;
}

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 90px 0;
}

.hero h1,
.hero .lead {
    color: #fff;
}

.hero .lead {
    color: rgba(255, 255, 255, 0.92);
}

.hero-icon {
    font-size: 13rem;
    color: #fff;
    opacity: 0.12;
}

/* Hero menor para páginas internas */
.hero-page {
    background: linear-gradient(135deg, #0077c2 0%, #009EF7 100%);
    color: #fff;
    padding: 48px 0;
    margin-bottom: 0;
}

.hero-page h1,
.hero-page p {
    color: #fff;
}

.hero-page .breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
}

.hero-page .breadcrumb .active {
    color: #fff;
}

.hero-page .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
}

/* ============ Module Cards ============ */
.module-card {
    transition: all 0.3s ease;
    border: none;
    border-top: 4px solid var(--primary-color);
    height: 100%;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13) !important;
}

.module-card .module-icon {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
}

.module-card.c-green { border-top-color: var(--success-color); }
.module-card.c-blue { border-top-color: var(--primary-color); }
.module-card.c-purple { border-top-color: var(--purple-color); }
.module-card.c-orange { border-top-color: var(--warning-color); }
.module-card.c-red { border-top-color: var(--danger-color); }
.module-card.c-teal { border-top-color: var(--info-color); }

/* ============ Steps ============ */
.steps {
    position: relative;
}

.step-item {
    display: flex;
    gap: 18px;
    margin-bottom: 26px;
    align-items: flex-start;
}

.step-number {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h5 {
    margin-bottom: 4px;
    color: #333;
}

/* ============ Sidebar (Sumário) ============ */
.doc-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 18px 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.doc-sidebar h6 {
    color: var(--muted);
    padding: 0 12px;
    letter-spacing: 0.5px;
}

.doc-sidebar .nav-link {
    color: #555;
    padding: 8px 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.93rem;
    border-radius: 0 6px 6px 0;
}

.doc-sidebar .nav-link:hover {
    background-color: #f0f7ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.doc-sidebar .nav-link.active {
    background-color: #e7f3ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.doc-sidebar::-webkit-scrollbar { width: 6px; }
.doc-sidebar::-webkit-scrollbar-track { background: #f1f1f1; }
.doc-sidebar::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 3px; }
.doc-sidebar::-webkit-scrollbar-thumb:hover { background: #999; }

/* ============ Conteúdo ============ */
.doc-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.doc-content h1 {
    color: #2b2b3b;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 700;
}

.doc-content h2 {
    color: #34344a;
    margin-top: 42px;
    margin-bottom: 18px;
    font-size: 1.7rem;
    font-weight: 600;
    scroll-margin-top: 90px;
}

.doc-content h3 {
    color: #4a4a5a;
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    scroll-margin-top: 90px;
}

.doc-content h4 {
    color: #5a5a68;
    margin-top: 22px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.doc-content ol,
.doc-content ul {
    margin-bottom: 16px;
}

.doc-content li {
    margin-bottom: 6px;
}

.doc-content section {
    scroll-margin-top: 90px;
}

/* ============ Callouts / Alertas ============ */
.callout {
    border-left: 4px solid;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 6px;
}

.callout p:last-child { margin-bottom: 0; }
.callout ul:last-child { margin-bottom: 0; }

.callout-tip {
    background: #e9f9ef;
    border-color: var(--success-color);
}

.callout-warning {
    background: #fff8e1;
    border-color: var(--warning-color);
}

.callout-danger {
    background: #ffe8ee;
    border-color: var(--danger-color);
}

.callout-info {
    background: #e7f3ff;
    border-color: var(--primary-color);
}

.callout-magic {
    background: #f3edff;
    border-color: var(--purple-color);
}

/* ============ Código ============ */
pre {
    background: #f7f8fa;
    border: 1px solid #e3e6ec;
    border-left: 4px solid var(--primary-color);
    padding: 14px 16px;
    border-radius: 6px;
    overflow-x: auto;
}

code {
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    color: #c7254e;
    font-size: 0.9em;
}

pre code {
    background: none;
    padding: 0;
    color: #333;
}

/* Caminho de menu */
.menu-path {
    display: inline-block;
    background: #eef2f7;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.9rem;
    color: #34344a;
    font-weight: 500;
}

.menu-path i {
    color: var(--muted);
    font-size: 0.75rem;
    margin: 0 4px;
}

/* ============ Tabelas ============ */
.table-custom thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.table-custom th {
    border: none !important;
    font-weight: 600;
}

/* ============ TOC (sumário em caixa) ============ */
.toc {
    background: #f8f9fb;
    border: 1px solid #e9edf3;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 30px;
}

.toc h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
}

.toc ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    columns: 2;
}

.toc ul li {
    padding: 4px 0;
    break-inside: avoid;
}

.toc ul li a {
    color: var(--muted);
    transition: all 0.2s;
}

.toc ul li a:hover {
    color: var(--primary-color);
    padding-left: 6px;
}

/* ============ Cards de recurso ============ */
.feature-box {
    padding: 28px 22px;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.feature-box:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.6rem;
    color: var(--primary-color);
}

/* ============ Badges de status ============ */
.badge-status {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ============ Botões de navegação ============ */
.doc-nav-buttons {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

/* ============ Footer ============ */
footer.site-footer {
    background: #1e1e2d;
    color: #c8c8d4;
}

footer.site-footer a {
    color: #9aa0b5;
}

footer.site-footer a:hover {
    color: #fff;
}

/* ============ Botão voltar ao topo ============ */
#backToTop {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none;
    z-index: 1030;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
    align-items: center;
    justify-content: center;
}

/* ============ Responsivo ============ */
@media (max-width: 991px) {
    .doc-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 24px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 56px 0;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .doc-content {
        padding: 22px;
    }

    .toc ul {
        columns: 1;
    }
}

/* ============ Impressão ============ */
@media print {
    .navbar,
    footer,
    .doc-sidebar,
    #backToTop,
    .doc-nav-buttons {
        display: none !important;
    }

    body {
        padding-top: 0;
        background: #fff;
    }

    .doc-content {
        box-shadow: none;
        padding: 0;
    }
}
