/* ===================================
   JFL Active Mobile V4 - Styles
   ================================== */

:root {
    --jfl-yellow: #FFD400;
    --jfl-dark-yellow: #E6BE00;
    --jfl-light-yellow: #FFF9CC;
    --jfl-black: #000000;
    --jfl-dark-gray: #1a1a1a;
    --jfl-gray: #333333;
    --jfl-light-gray: #f5f5f5;
    --jfl-medium-gray: #666666;
    --jfl-border: #e0e0e0;
    --sidebar-width: 280px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--jfl-gray);
    background: #fff;
    padding-top: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===================================
   HEADER
   ================================== */
.header {
    background: var(--jfl-black);
    color: white;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: auto !important;
    min-height: unset !important;
}

.logo-jfl {
    color: var(--jfl-yellow);
    font-size: 1.8rem;
    font-weight: 900;
}

.logo-active {
    color: white;
    font-size: 0.9rem;
    font-weight: 400;
}



/* ===================================
   SIDEBAR - LIGHT MODE (FUNDO BRANCO)
   ================================== */
.sidebar {
    width: var(--sidebar-width);
    background: #FFFFFF !important;
    border-right: 1px solid #e0e0e0;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 1.5rem 0;
    transition: transform 0.3s;
}

/* Títulos das seções - Light Mode */
.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #333333 !important;
    padding: 0.75rem 1.5rem 0.5rem;
    letter-spacing: 1px;
}

/* Itens do menu - Light Mode */
.nav-item {
    display: block;
    padding: 0.7rem 1.5rem;
    color: #222222 !important;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    cursor: pointer;
}

/* Ícones no menu - Light Mode */
.nav-item i {
    color: #555555;
    margin-right: 0.75rem;
    width: 1.25rem;
}

/* Hover do item - Light Mode */
.nav-item:hover {
    background: rgba(255, 212, 0, 0.1);
    color: #FFD400 !important;
    border-left-color: #FFD400;
}

.nav-item:hover i {
    color: #FFD400;
}

/* Item ativo/selecionado - Light Mode */
.nav-item.active {
    background: rgba(255, 212, 0, 0.15);
    color: #FFD400 !important;
    font-weight: 600;
    border-left-color: #FFD400;
}

.nav-item.active i {
    color: #FFD400;
}

/* Scrollbar - Light Mode */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #FFD400;
    border-radius: 4px;
}

/* Badge de novidade */
.nav-item .badge {
    background-color: #dc3545 !important;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    margin-left: 0.5rem;
}

/* ===================================
   MAIN CONTENT
   ================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 70px;
    padding: 3rem;
    max-width: 1200px;
    margin-right: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    padding-top: 80px !important;
}

.main-content p,
.main-content li {
    font-size: 0.9rem;
    line-height: 1.5;
}

.content-header {
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--jfl-yellow);
    padding-bottom: 1rem;
}

.content-header h1 {
    color: var(--jfl-black);
    font-size: 2.2rem;
}

.main-content h2 {
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.main-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.main-content h4 {
    font-size: 1.1rem;
}

.main-content h5 {
    font-size: 1rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   FEATURE BOXES
   ================================== */
.feature-box {
    background: linear-gradient(135deg, var(--jfl-yellow) 0%, var(--jfl-dark-yellow) 100%);
    color: var(--jfl-black);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(255, 212, 0, 0.3);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    transition: all 0.3s;
    height: 100%;
    border: 2px solid var(--jfl-border);
    border-radius: 12px;
    background-color: white;
    overflow: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    border-color: var(--jfl-yellow) !important;
    box-shadow: 0 4px 12px rgba(255, 212, 0, 0.25);
    transform: translateY(-4px);
}

.feature-card h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.85rem;
    line-height: 1.4;
    flex-grow: 1;
}

.feature-card img {
    margin-top: 0.5rem;
}

/* ===================================
   IMAGES
   ================================== */
.manual-img {
    width: 280px;
    max-width: 100%;
    border-radius: 10px;
    display: block;
    margin: 8px auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

/* ===================================
   STEPS
   ================================== */
.steps {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
}

.steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--jfl-yellow);
    color: var(--jfl-black);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-step {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ===================================
   PLATFORM SELECTOR
   ================================== */
.platform-selector {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--jfl-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.platform-selector h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--jfl-black);
    text-align: center;
}

.btn-group {
    display: inline-flex !important;
    width: auto !important;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--jfl-border);
    gap: 0;
}

.btn-check {
    position: absolute;
    opacity: 0;
}

.btn {
    padding: 0.2rem 0.6rem;
    border: none;
    transition: all 0.3s ease;
    font-weight: 100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--jfl-light-gray);
    color: var(--jfl-gray);
    font-size: 0.85rem;
    border-radius: 8px;
    width: auto;
}

.btn i {
    font-size: 0.9rem;
    margin-right: 0.3rem !important;
}

.btn-outline-light {
    background-color: var(--jfl-light-gray);
    color: var(--jfl-gray);
    border: none;
}

.btn-outline-light:hover {
    background-color: rgba(255, 212, 0, 0.15);
    color: var(--jfl-dark-yellow);
}

.btn-check:checked+.btn {
    background-color: var(--jfl-yellow);
    color: var(--jfl-black);
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(255, 212, 0, 0.3);
}

/* ===================================
   INSTRUCTIONS BOX
   ================================== */
.instructions {
    background-color: var(--jfl-light-gray);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border-left: 4px solid var(--jfl-yellow);
}

.instructions h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--jfl-black);
}

.instructions ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.instructions li {
    margin-bottom: 0.5rem;
    color: var(--jfl-gray);
}

.instructions strong {
    color: var(--jfl-black);
}

/* ===================================
   BUTTONS
   ================================== */
.btn-continue {
    background: linear-gradient(135deg, var(--jfl-yellow) 0%, var(--jfl-dark-yellow) 100%);
    color: var(--jfl-black);
    border: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s;
    margin-top: 1rem;
    width: 100%;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 212, 0, 0.4);
}

/* ===================================
   UTILITY CLASSES
   ================================== */
.bg-jfl-yellow {
    background-color: var(--jfl-yellow) !important;
}

.text-jfl-yellow {
    color: var(--jfl-yellow) !important;
}

.border-jfl-yellow {
    border-color: var(--jfl-yellow) !important;
}

/* ===================================
   RESPONSIVE - MOBILE FIRST
   ================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        font-size: 0.85rem;
    }



    .content-header h1 {
        font-size: 1.6rem;
    }

    .main-content h2 {
        font-size: 1.4rem;
    }

    .main-content h3 {
        font-size: 1.2rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .custom-btn {
        color: #000;
        border-color: #000;
    }

    .custom-btn:hover {
        color: #000;
        border-color: #000;
        background-color: transparent;
    }
}

/* ===================================
   RESPONSIVIDADE (SMARTPHONE) 
   =================================== */
@media (max-width: 768px) {
    .content-header h1 {
        font-size: 1.4rem !important;
    }



    .logo-active {
        display: inline-block !important;
        font-size: 0.6rem !important;
        white-space: nowrap !important;
    }

    /* Select de idioma - regra ÚNICA e CORRETA */
    #language-selector {
        min-width: 70px !important;
        width: auto !important;
        max-width: none !important;
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
        overflow: visible !important;
        text-overflow: clip !important;
        height: auto !important;
    }

    .header .row {
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .app-icon {
        height: 30px !important;
        width: 30px !important;
    }

    .logo-jfl {
        font-size: 1.1rem !important;
    }

    /* Botão dark mode: tamanho fixo */
    #theme-toggle {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .header .gap-3 {
        gap: 0.4rem !important;
    }
}

/* ===================================
   TEMA PADRÃO (LIGHT MODE)
   ================================== */
body {
    background-color: #f8f9fa;
    color: #212529;
    transition: background 0.3s, color 0.3s;
}

/* ===================================
   TEMA ESCURO (DARK MODE)
   ================================== */
body.dark-mode {
    background-color: #121212;
    color: #eaeaea;
}

/* Cards no dark */
body.dark-mode .card {
    background-color: #1e1e1e;
    color: #ffffff;
    border-color: #333;
}

/* Header no dark */
body.dark-mode .header {
    background-color: #000;
}

/* Inputs no dark */
body.dark-mode .form-select,
body.dark-mode .form-control {
    background-color: #1e1e1e;
    color: #fff;
    border-color: #555;
}

/* ===================================
   DARK MODE FIXES (Bootstrap + Custom)
   ================================== */

/* Cards */
body.dark-mode .card,
body.dark-mode .feature-card,
body.dark-mode .platform-selector {
    background-color: #151515 !important;
    color: #f1f1f1 !important;
    border-color: #2a2a2a !important;
}

/* Alertas */
body.dark-mode .alert {
    background-color: #1c1c1c !important;
    color: #fff !important;
    border-color: var(--jfl-yellow) !important;
}

/* Texto muted */
body.dark-mode .text-muted {
    color: #b5b5b5 !important;
}

/* Abas / botões de plataforma */
body.dark-mode .btn,
body.dark-mode .btn-outline-light {
    background-color: #1a1a1a;
    color: #eee;
    border-color: #333;
}

body.dark-mode .btn:hover {
    background-color: #222;
}

/* Botão ativo */
body.dark-mode .btn-check:checked+.btn {
    background-color: var(--jfl-yellow);
    color: #000;
}

/* Cards de download Android / iOS */
body.dark-mode .download-card,
body.dark-mode .feature-box {
    background: #111;
    border-color: #333;
}

/* Accordion / FAQ */
body.dark-mode .accordion-item {
    background-color: #151515;
    border-color: #333;
}

body.dark-mode .accordion-button {
    background-color: #151515;
    color: #fff;
}

body.dark-mode .accordion-button:not(.collapsed) {
    background-color: #1c1c1c;
    color: var(--jfl-yellow);
}

/* Ícones */
body.dark-mode i {
    opacity: 0.95;
}

/* Linhas e divisores */
body.dark-mode hr {
    border-color: #333;
}

/* ===================================
   DARK MODE HARD FIX (FORÇADO)
   ================================== */

/* Fundo geral */
body.dark-mode {
    background-color: #0e0e0e !important;
    color: #eaeaea !important;
}

/* Área principal */
body.dark-mode .main-content,
body.dark-mode .content-section {
    background-color: transparent !important;
    color: #eaeaea !important;
}

/* TODOS os containers visuais */
body.dark-mode .card,
body.dark-mode .row>div>div,
body.dark-mode .platform-selector,
body.dark-mode .feature-card,
body.dark-mode .instructions {
    background-color: #151515 !important;
    color: #ffffff !important;
    border-color: #2a2a2a !important;
}

/* Corrige textos escondidos */
body.dark-mode p,
body.dark-mode span,
body.dark-mode li,
body.dark-mode small,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5 {
    color: #f1f1f1 !important;
}

/* Textos muted */
body.dark-mode .text-muted {
    color: #bdbdbd !important;
}

/* Alertas */
body.dark-mode .alert {
    background-color: #1a1a1a !important;
    color: #fff !important;
    border-color: var(--jfl-yellow) !important;
}

/* Botões */
body.dark-mode .btn,
body.dark-mode .btn-outline-light {
    background-color: #1c1c1c !important;
    color: #fff !important;
    border-color: #333 !important;
}

body.dark-mode .btn:hover {
    background-color: #262626 !important;
}

/* Botão ativo */
body.dark-mode .btn-check:checked+.btn {
    background-color: var(--jfl-yellow) !important;
    color: #000 !important;
}

/* Inputs */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #1c1c1c !important;
    color: #fff !important;
    border-color: #444 !important;
}

/* Accordion */
body.dark-mode .accordion-item,
body.dark-mode .accordion-button {
    background-color: #151515 !important;
    color: #fff !important;
    border-color: #333 !important;
}

body.dark-mode .accordion-button:not(.collapsed) {
    color: var(--jfl-yellow) !important;
}

/* Bordas bootstrap */
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-start,
body.dark-mode .border-end {
    border-color: #333 !important;
}

/* Ícones */
body.dark-mode i {
    color: inherit !important;
}

/* ===================================
   DARK MODE - ICON FIX (ALL COLORS)
   ================================== */

/* Ícones padrão */
body.dark-mode i,
body.dark-mode .bi {
    color: #f1f1f1 !important;
}

/* Amarelo (warning / destaque JFL) */
body.dark-mode .text-warning,
body.dark-mode .text-jfl-yellow {
    color: var(--jfl-yellow) !important;
}

/* Verde (success) */
body.dark-mode .text-success {
    color: #2ecc71 !important;
}

/* Azul (primary → neutralizado) */
body.dark-mode .text-primary {
    color: #0d6efd !important;
}

/* Vermelho (danger) */
body.dark-mode .text-danger {
    color: #ff6b6b !important;
}

/* Azul claro (info) */
body.dark-mode .text-info {
    color: #4fc3f7 !important;
}

/* Cinza (secondary) */
body.dark-mode .text-secondary {
    color: #b0b0b0 !important;
}

/* Cinza claro (light) */
body.dark-mode .text-light {
    color: #f1f1f1 !important;
}

/* Preto (dark → vira claro no dark mode) */
body.dark-mode .text-dark {
    color: #f1f1f1 !important;
}

/* Branco */
body.dark-mode .text-white {
    color: #ffffff !important;
}

/* Ícones dentro de botões amarelos selecionados */
body.dark-mode .btn-check:checked+.btn i {
    color: #000 !important;
}

/* ===================================
   VIDEO BUTTON - FIX LIGHT + DARK
   ================================== */

.video-tutorial-btn,
body.dark-mode .video-tutorial-btn {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.video-tutorial-btn:hover,
body.dark-mode .video-tutorial-btn:hover {
    background-color: #bb2d3b !important;
    border-color: #bb2d3b !important;
}

.video-tutorial-btn i,
body.dark-mode .video-tutorial-btn i {
    color: #ffffff !important;
}

/* ===================================
   FIX ESPAÇO BRANCO EM TELAS GRANDES
   ================================== */

html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Ajusta o layout para telas muito grandes */
@media (min-width: 1600px) {
    .sidebar {
        width: 320px;
    }

    .main-content {
        margin-left: 320px;
        padding: 3rem 4rem;
    }
}

/* Para telas EXTRA grandes (4K, etc) */
@media (min-width: 2000px) {
    .main-content {
        padding: 3rem 8rem;
    }

    .feature-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

/* Logo e Ícones */
.app-icon {
    transition: transform 0.2s;
    object-fit: contain;
}

/* Botão do menu hambúrguer */
[data-bs-target="#sidebar"] {
    color: #fff !important;
    text-decoration: none;
    z-index: 1100 !important;
    position: relative;
    padding: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar offcanvas */
#sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e0e0e0;
    width: 280px;
}

.offcanvas-lg {
    z-index: 1060 !important;
}

/* ===================================
   DARK MODE - SIDEBAR (FUNCIONA EM TODAS AS TELAS)
   ================================== */

/* Sidebar no dark mode - fundo escuro */
body.dark-mode .sidebar,
body.dark-mode #sidebar,
body.dark-mode .offcanvas-lg,
body.dark-mode .offcanvas-start {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
    border-right: 1px solid #333 !important;
}

/* Títulos no dark mode */
body.dark-mode .nav-section-title {
    color: #999999 !important;
}

/* Itens do menu no dark mode */
body.dark-mode .nav-item {
    color: #cccccc !important;
}

/* Ícones no dark mode */
body.dark-mode .nav-item i {
    color: #888888 !important;
}

/* Hover no dark mode */
body.dark-mode .nav-item:hover {
    background: rgba(255, 212, 0, 0.15) !important;
    color: #FFD400 !important;
}

body.dark-mode .nav-item:hover i {
    color: #FFD400 !important;
}

/* Item ativo no dark mode */
body.dark-mode .nav-item.active {
    background: rgba(255, 212, 0, 0.2) !important;
    color: #FFD400 !important;
}

body.dark-mode .nav-item.active i {
    color: #FFD400 !important;
}

/* Scrollbar no dark mode */
body.dark-mode .sidebar::-webkit-scrollbar-track {
    background: #333;
}

body.dark-mode .sidebar::-webkit-scrollbar-thumb {
    background: #FFD400;
}

/* ===================================
   FORÇA HEADER-TITLE (BARRINHA AMARELA) NO DARK MODE
   ================================== */

/* Remove o d-none do Bootstrap e força a barrinha */
body.dark-mode .header-title.d-none,
body.dark-mode .header-title {
    border-left: 2px solid var(--jfl-yellow) !important;
    color: #fff !important;
    /* Remove qualquer margin/padding extra herdado */
    margin-left: 0.5rem !important;
    padding-left: 0.6rem !important;
    vertical-align: middle !important;
}

/* ===================================
   CORREÇÃO: SIDEBAR NÃO ULTRAPASSA O CONTEÚDO
   ================================== */

/* Garante que o conteúdo principal fique ao lado do sidebar */
.main-content {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
    max-width: calc(100% - 280px) !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Desktop */
@media (min-width: 992px) {
    .sidebar {
        width: 280px !important;
        position: fixed !important;
        left: 0 !important;
        top: 70px !important;
        bottom: 0 !important;
        z-index: 100 !important;
    }

    .main-content {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
        padding: 2rem !important;
    }
}

/* Mobile - conteúdo ocupa 100% */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Remove qualquer overflow */
html,
body {
    overflow-x: hidden !important;
}

.container-fluid,
.row,
.col {
    overflow-x: hidden !important;
}

/* ===================================
   MOBILE FIX - SMARTPHONES
   =================================== */

/* Garante que palavras longas quebrem corretamente */
.main-content,
.main-content p,
.main-content li,
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4,
.main-content h5,
.main-content span {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Mobile: remove margin do sidebar e ocupa 100% */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.25rem !important;
        padding-top: 80px !important;
        box-sizing: border-box !important;
    }
}

/* Smartphones pequenos (até 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 1rem !important;
        padding-top: 75px !important;
        font-size: 0.9rem !important;
    }

    .content-header h1 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
    }

    .main-content h2 {
        font-size: 1.2rem !important;
    }

    .main-content h3 {
        font-size: 1.1rem !important;
    }

    .feature-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .feature-card {
        padding: 1rem !important;
    }

    .platform-selector {
        padding: 1rem !important;
    }

    .instructions {
        padding: 1rem !important;
    }

    /* Evita que imagens ultrapassem a tela */
    img,
    .manual-img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }
}

/* Fix global: nenhum elemento ultrapassa a tela */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tabelas responsivas */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* ===================================
   FIX SCROLL HORIZONTAL NO HEADER
   =================================== */

/* Remove overflow do header e seus filhos */
.header,
.header .container-fluid,
.header .row {
    overflow: hidden !important;
    max-width: 100vw !important;
}

/* No mobile, limita o select de idioma */
@media (max-width: 768px) {
    #language-selector {
        max-width: 110px !important;
        font-size: 0.7rem !important;
        padding: 2px 20px 2px 5px !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* Garante que o lado direito do header não estoure */
    .header .col-auto {
        flex-shrink: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    /* Comprime os gaps do header */
    .header .gap-3 {
        gap: 0.3rem !important;
    }
}

/* ===================================
   REMOVER SCROLL HORIZONTAL DO HEADER
   ================================== */

/* Remove scroll horizontal do header */
.header {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Força que os elementos do header fiquem em uma linha sem vazar */
.header .container-fluid {
    overflow-x: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.header .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Lado esquerdo: cresce mas não estoura */
.header .col {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.header .col-auto {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

/* Força o select de idioma a caber SEM CORTAR */
#language-selector {
    width: auto !important;
    min-width: 85px !important;
    /* Aumentado */
    max-width: 100px !important;
    /* Aumentado */
    font-size: 0.7rem !important;
    padding: 2px 8px !important;
    /* Ajustado */
    white-space: nowrap !important;
    overflow: visible !important;
    /* Mudado de hidden para visible */
    text-overflow: clip !important;
    /* Mudado de ellipsis para clip */
}

/* Força o botão de tema */
#theme-toggle {
    padding: 2px 6px !important;
    font-size: 0.75rem !important;
}

/* Título com divisor */
/* ===================================
   HEADER TITLE - REGRA ÚNICA
   ================================== */
.header-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border-left: 2px solid var(--jfl-yellow);
    padding-left: 0.6rem;
    margin-left: 0.2rem;
    color: #fff;
    vertical-align: middle;
}

body.dark-mode .header-title {
    border-left: 2px solid var(--jfl-yellow);
    color: #fff;
}

/* No mobile, ajusta sem cortar */
@media (max-width: 580px) {
    .logo-active {
        display: none !important;
    }

    .app-icon {
        height: 30px !important;
        width: 30px !important;
    }

    .logo-jfl {
        font-size: 0.9rem !important;
    }


    /* Select de idioma: tamanho fixo, nunca some */
    #language-selector {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        font-size: 0.75rem !important;
        padding: 3px 6px !important;
        flex-shrink: 0 !important;
    }
}

/* Para telas muito pequenas */
@media (max-width: 420px) {
    .header .gap-3 {
        gap: 0.2rem !important;
    }

    #language-selector {
        min-width: 65px !important;
        font-size: 0.6rem !important;
        padding: 2px 3px !important;
    }

    .logo-jfl {
        font-size: 0.8rem !important;
    }

    .app-icon {
        height: 25px !important;
        width: 25px !important;
    }
}

/* ===================================
   CORREÇÃO FINAL - SELECT DE IDIOMA
   ================================== */

/* Remove qualquer limitação de largura do select */
#language-selector {
    min-width: 85px !important;
    width: auto !important;
    max-width: none !important;
    font-size: 0.7rem !important;
    padding: 2px 4px !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

body.dark-mode .destaque-intro {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%) !important;
    border: 1px solid var(--jfl-yellow) !important;
}

body.dark-mode .destaque-intro h3,
body.dark-mode .destaque-intro p {
    color: #f1f1f1 !important;
}

body.dark-mode .destaque-intro strong {
    color: var(--jfl-yellow) !important;
}

body.dark-mode .destaque-intro i {
    color: var(--jfl-yellow) !important;
}

/* Ajuste isolado — SOMENTE o card do Passo 5 */
#card-passo-5 {
    align-self: start !important;
    height: auto !important;
    justify-content: flex-start !important;
}

#card-passo-5 p {
    flex-grow: 0 !important;
}

#card-passo-5 img {
    margin-top: 0.5rem !important;
}
