/* =========================================================
   🌙 MODO ESCURO (TEMA PRINCIPAL / PADRÃO) - EJR TI
   Paleta baseada nas variáveis de design enviadas:
   - Background principal: Preto / Dark profundo (#000000 / #0a0e1a)
   - Cards e superfícies: #121826 / #162032 (com bordas #26272e)
   - Destaque Primário (Botões, detalhes): Azul Elétrico / Royal (#2b65ff)
   - Textos: Brancos (#ffffff) e Cinzas suaves (#d9d9d9, #94a3b8)
   
   * O Modo Escuro é o padrão inicial do site.
   * Se o usuário clicar no botão sol/lua, o site muda para Modo Claro.
   ========================================================= */

:root {
    --jr-dark-bg:       #0e1422;  /* Cor favorita unificada para eliminar cortes secos */
    --jr-dark-surface:  #0e1422;
    --jr-dark-card:     #141c2e;
    --jr-dark-border:   rgba(255, 255, 255, 0.08);
    --jr-dark-title:    #ffffff;
    --jr-dark-text:     #d9d9d9;
    --jr-dark-muted:    #94a3b8;
    --jr-primary-blue:  #2b65ff;
    --jr-primary-hover: #1e52e0;
}

/* Transição suave de cores ao alternar tema */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color .35s ease, color .35s ease, border-color .35s ease !important;
}

/* =========================================================
   ESTILOS DO MODO ESCURO (APLICADO QUANDO HTML TEM .dark)
   ========================================================= */
html.dark {
    color-scheme: dark;
    background-color: var(--jr-dark-bg);
}
html.dark body {
    background-color: var(--jr-dark-bg);
    color: var(--jr-dark-text);
}

/* ---------- Fundos de Seções (Fluidez Contínua) ---------- */
html.dark .bg-white       { background-color: var(--jr-dark-surface) !important; }
html.dark .bg-lightgray   { background-color: var(--jr-dark-bg) !important; }
html.dark .bg-gray-200    { background-color: rgba(255, 255, 255, 0.10) !important; }
html.dark .bg-darkbg      { background-color: #070b14 !important; }
html.dark .bg-\[\#e6f7fc\] { background-color: rgba(43, 101, 255, 0.12) !important; color: var(--jr-primary-blue) !important; }

/* Cards elevados que flutuam sobre o fundo #0e1422 com borda e sombra suave */
html.dark section.bg-white .bg-white,
html.dark section.bg-lightgray .bg-white,
html.dark body.bg-lightgray .bg-white {
    background-color: var(--jr-dark-card) !important;
    border-color: var(--jr-dark-border) !important;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.35) !important;
}

/* Degradês entre Hero e seções: 100% integrados à cor #0e1422 */
html.dark .from-white,
html.dark .from-lightgray {
    --tw-gradient-from: #0e1422 var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(14 20 34 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

/* ---------- HERO SECTION (Design Tech Moderno) ---------- */
html.dark .hero-bg {
    background-color: #030712;
    background-image:
        radial-gradient(ellipse 70% 80% at 80% 30%, rgba(43, 101, 255, 0.28) 0%, rgba(43, 101, 255, 0) 70%),
        linear-gradient(135deg, rgba(3, 7, 18, 0.98) 0%, rgba(8, 16, 36, 0.92) 50%, rgba(10, 24, 52, 0.85) 100%),
        url('/hero-bg.webp');
    background-size: auto, auto, cover;
    background-position: center, center, center right;
    background-repeat: no-repeat;
}
/* Destaque "alta performance" em degradê Royal Blue */
html.dark .hero-bg h1 .text-secondary {
    background: linear-gradient(90deg, #5b8cff 0%, #2b65ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
html.dark .hero-bg .text-gray-300 { color: #cbd5e1 !important; }

/* Botões com a cor Primária #2b65ff */
html.dark .bg-secondary,
html.dark .jr-dropbtn {
    background-color: var(--jr-primary-blue) !important;
    color: #ffffff !important;
}
html.dark .bg-secondary:hover,
html.dark .jr-dropbtn:hover {
    background-color: var(--jr-primary-hover) !important;
}
html.dark .shadow-cyan-500\/30,
html.dark .shadow-cyan-500\/20 {
    box-shadow: 0 10px 25px -5px rgba(43, 101, 255, 0.45) !important;
}

/* ---------- SEÇÕES DE CHAMADA (CTA Pré-Rodapé) ---------- */
html.dark section.bg-\[\#0b3b60\],
html.dark section.bg-primary {
    position: relative;
    background-color: #060b17 !important;
    background-image:
        radial-gradient(ellipse 65% 90% at 50% 0%, rgba(43, 101, 255, 0.25) 0%, rgba(43, 101, 255, 0) 70%),
        linear-gradient(180deg, #0d172e 0%, #060b17 100%) !important;
    border-top: 1px solid rgba(43, 101, 255, 0.35) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
html.dark section.bg-\[\#0b3b60\] .text-blue-100 { color: #cbd5e1 !important; }

/* Menu mobile no dark */
html.dark #mobile-menu {
    background-color: #0a1122 !important;
    border-color: rgba(255,255,255,.08) !important;
}
html.dark #mobile-menu .border-gray-700 { border-color: rgba(255,255,255,.08) !important; }

/* Ícones temáticos */
html.dark .bg-primary.rounded-xl {
    background-color: rgba(43, 101, 255, 0.15) !important;
    color: #5b8cff !important;
    box-shadow: inset 0 0 0 1px rgba(43, 101, 255, 0.35);
}

/* ---------- Tipografia & Textos ---------- */
html.dark .text-primary  { color: var(--jr-dark-title) !important; }
html.dark .text-secondary { color: #5b8cff !important; }
html.dark .text-gray-800 { color: #f1f5f9 !important; }
html.dark .text-gray-700 { color: #e2e8f0 !important; }
html.dark .text-gray-600 { color: #cbd5e1 !important; }
html.dark .text-gray-500 { color: var(--jr-dark-muted) !important; }
html.dark .text-blue-900,
html.dark .text-blue-800 { color: #93b4ff !important; }
html.dark .text-blue-600,
html.dark .text-blue-500 { color: #5b8cff !important; }

/* ---------- Bordas ---------- */
html.dark .border-gray-100,
html.dark .border-gray-200 { border-color: var(--jr-dark-border) !important; }
html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--jr-dark-border) !important; }
html.dark .border-primary { border-color: #5b8cff !important; color: #ffffff !important; }
html.dark .hover\:bg-primary:hover {
    background-color: var(--jr-primary-blue) !important;
    border-color: var(--jr-primary-blue) !important;
    color: #ffffff !important;
}

/* Sombra nos cards com hover */
html.dark .card-hover:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
    border-color: rgba(43, 101, 255, 0.35) !important;
}

/* ---------- Formulários (Página Contate-nos) ---------- */
html.dark input:not([type="file"]),
html.dark textarea,
html.dark select {
    background-color: #080d1a !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #64748b !important; }
html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
    border-color: var(--jr-primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(43, 101, 255, 0.25) !important;
}

/* ---------- Parceiros (Logos e Seção) ----------
   Mantém transparência das fotos sem fundo.
   Para fotos com fundo sólido escuro/branco ou detalhes em cinza, 
   o mix-blend-mode e brilho equilibrado revelam todos os detalhes, traços e sombras */
html.dark #secao-parceiros {
    background-color: var(--jr-dark-surface) !important;
}
html.dark #secao-parceiros #parceiros-titulo {
    color: #ffffff !important;
}
html.dark #secao-parceiros #parceiros-descricao {
    color: #94a3b8 !important;
}
html.dark #parceiros-container > div {
    background: transparent !important;
    padding: 0 !important;
}
html.dark #parceiros-container img {
    filter: brightness(1.2) contrast(1.1) opacity(0.85);
    mix-blend-mode: screen;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
html.dark #parceiros-container > div:hover img {
    filter: brightness(1.35) contrast(1.15) opacity(1);
    transform: scale(1.05);
}

/* ---------- Depoimentos (Seção e Card) ---------- */
html.dark #secao-depoimentos {
    background-color: var(--jr-dark-bg) !important;
}
html.dark #secao-depoimentos #depoimento-card {
    background-color: var(--jr-dark-card) !important;
    border-color: var(--jr-dark-border) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}
html.dark #secao-depoimentos #depoimentos-titulo {
    color: #ffffff !important;
}
html.dark #secao-depoimentos #depoimento-card p {
    color: #cbd5e1 !important;
}
html.dark #secao-depoimentos #depoimento-card .text-primary {
    color: #ffffff !important;
}
html.dark #depoimento-prev,
html.dark #depoimento-next {
    color: #94a3b8 !important;
}
html.dark #depoimento-prev:hover,
html.dark #depoimento-next:hover {
    color: #ffffff !important;
}

/* ---------- Dropdown "Baixar Suporte Remoto" ---------- */
html.dark .jr-dropdown-content {
    background-color: var(--jr-dark-card);
    border: 1px solid var(--jr-dark-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.7);
}
html.dark .jr-dropdown-content a { color: var(--jr-dark-text); }
html.dark .jr-dropdown-content a:hover {
    background: rgba(43, 101, 255, 0.18);
    color: #5b8cff;
}

/* ---------- Modal de Atendimento (Zammad) ---------- */
html.dark .ejrti-modal-body {
    background: var(--jr-dark-surface);
    box-shadow: 0 10px 40px rgba(0,0,0,.7);
    border: 1px solid var(--jr-dark-border);
}
html.dark .ejrti-modal-body h3 { color: var(--jr-dark-title); }
html.dark .ejrti-form-group label { color: var(--jr-dark-muted); }
html.dark .ejrti-dropzone {
    background: rgba(43, 101, 255, 0.07);
    border-color: rgba(255,255,255,.16);
}
html.dark .ejrti-dropzone:hover {
    background: rgba(43, 101, 255, 0.15);
    border-color: var(--jr-primary-blue);
}
html.dark .dz-text { color: var(--jr-dark-text); }
html.dark .dz-sub { color: var(--jr-dark-muted); }
html.dark .anexo-item {
    background: var(--jr-dark-card);
    border-color: var(--jr-dark-border);
}
html.dark .anexo-nome { color: var(--jr-dark-text); }

/* =========================================================
   🔘 BOTÃO DE ALTERNAR TEMA (sol / lua)
   ========================================================= */
.jr-theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    backdrop-filter: blur(6px);
    transition: background .3s, border-color .3s, transform .2s;
}
.jr-theme-toggle:hover {
    background: rgba(43, 101, 255, 0.35);
    border-color: var(--jr-primary-blue);
    transform: scale(1.06);
}
.jr-theme-toggle:focus-visible {
    outline: 2px solid var(--jr-primary-blue);
    outline-offset: 2px;
}

.jr-theme-toggle i {
    position: absolute;
    font-size: 20px;
    transition: transform .45s cubic-bezier(.68,-0.3,.32,1.3), opacity .3s;
}
/* No modo escuro (padrão): mostra o Sol dourado (convite para ligar o modo claro) */
html.dark .jr-theme-toggle .jr-icon-sun  { transform: translateY(0) rotate(0); opacity: 1; color: #ffd166; }
html.dark .jr-theme-toggle .jr-icon-moon { transform: translateY(-28px) rotate(-90deg); opacity: 0; }

/* No modo claro: mostra a Lua (convite para ligar o modo escuro) */
html:not(.dark) .jr-theme-toggle .jr-icon-sun  { transform: translateY(28px) rotate(90deg); opacity: 0; }
html:not(.dark) .jr-theme-toggle .jr-icon-moon { transform: translateY(0) rotate(0); opacity: 1; color: #ffffff; }
