/* ==========================================================================
   IGI SERVIÇOS DE INFORMÁTICA LTDA - DESIGN SYSTEM & ESTILOS GLOBAIS
   Desenvolvido para .NET 9 Blazor com Microsoft Fluent UI & Enterprise Tech Look
   ========================================================================== */

:root {
    --igi-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --igi-font-heading: 'Outfit', 'Inter', system-ui, sans-serif;

    /* Paleta Principal Corporativa Clean Slate & Deep Navy */
    --igi-navy-950: #080d1a;
    --igi-navy-900: #0d1527;
    --igi-navy-850: #121c33;
    --igi-navy-800: #1a2744;
    --igi-navy-700: #26385e;
    
    /* Segmento Serviços Elétricos (Âmbar Sofisticado) */
    --igi-amber-500: #f59e0b;
    --igi-amber-400: #fbbf24;
    --igi-amber-600: #d97706;
    --igi-amber-glow: rgba(245, 158, 11, 0.12);

    /* Segmento Tecnologia da Informação (Azul Corporativo / Ciano Clean) */
    --igi-blue-500: #2563eb;
    --igi-blue-600: #1d4ed8;
    --igi-cyan-400: #38bdf8;
    --igi-cyan-500: #0ea5e9;
    --igi-indigo-500: #6366f1;
    --igi-tech-glow: rgba(56, 189, 248, 0.12);

    /* Superfícies e Vidros Clean (Frosted Glass Suave com Bordas de 1px) */
    --igi-surface-card: rgba(13, 21, 39, 0.65);
    --igi-surface-card-border: rgba(255, 255, 255, 0.07);
    --igi-surface-card-hover: rgba(19, 31, 57, 0.85);
    --igi-glass-nav: rgba(8, 13, 26, 0.88);

    /* Tipografia e Contraste Neutro */
    --igi-text-primary: #ffffff;
    --igi-text-secondary: #94a3b8;
    --igi-text-muted: #64748b;
    
    /* WhatsApp */
    --igi-whatsapp-green: #25d366;
    --igi-whatsapp-hover: #1ebc59;
}

html {
    scroll-behavior: smooth;
    font-family: var(--igi-font-sans);
    color: var(--igi-text-primary);
    background-color: var(--igi-navy-950);
    scrollbar-color: #2563eb #060b17;
    scrollbar-width: thin;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--igi-navy-950) !important;
    color: var(--igi-text-secondary);
    font-family: var(--igi-font-sans);
    line-height: 1.6;
    min-height: 100vh !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* ==========================================================================
   CONFORMIDADE DE ACESSIBILIDADE WCAG 2.1 AA - ALTO CONTRASTE TEMA DARK
   ========================================================================== */

.text-secondary,
p.text-secondary {
    color: #cbd5e1 !important;
}

.text-muted,
small.text-muted,
span.text-muted,
p.text-muted,
th.text-muted {
    color: #94a3b8 !important;
}

.text-light {
    color: #f1f5f9 !important;
}

/* Barra de rolagem elegante, sempre visível e nativa para navegação fluida */
::-webkit-scrollbar {
    width: 12px;
}
::-webkit-scrollbar-track {
    background: #060b17;
}
::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 6px;
    border: 2px solid #060b17;
}
::-webkit-scrollbar-thumb:hover {
    background: #38bdf8;
}

.igi-app-wrapper {
    width: 100%;
    min-height: 100vh;
    overflow-x: clip;
}

/* Espaçamento compensatório do cabeçalho fixo no conteúdo principal */
#main-content {
    padding-top: 115px;
    padding-bottom: 40px;
    min-height: calc(100vh - 115px);
}

@media (max-width: 1199.98px) {
    #main-content {
        padding-top: 140px;
        min-height: calc(100vh - 140px);
    }
}

@media (max-width: 991.98px) {
    #main-content {
        padding-top: 145px;
        min-height: calc(100vh - 145px);
    }

    .navbar-collapse {
        background: rgba(6, 11, 23, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 16px;
        margin-top: 12px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    }
}

@media (max-width: 767.98px) {
    #main-content {
        padding-top: 155px;
        min-height: calc(100vh - 155px);
    }
}

/* Prevenção global de overflow horizontal por espaçamentos (gutters) do Bootstrap em telas menores */
@media (max-width: 991.98px) {
    .row.g-5, .row.gx-5 {
        --bs-gutter-x: 1.5rem !important;
    }
}
@media (max-width: 575.98px) {
    .row.g-5, .row.gx-5 {
        --bs-gutter-x: 1rem !important;
    }
}

.igi-page-wrapper {
    background-color: var(--igi-navy-950);
    min-height: calc(100vh - 180px);
    width: 100%;
}

/* Compensação do cabeçalho fixo na rolagem por âncora */
section[id] {
    scroll-margin-top: 155px;
}
@media (min-width: 1200px) {
    section[id] {
        scroll-margin-top: 120px;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--igi-font-heading);
    color: var(--igi-text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--igi-cyan-400);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: #ffffff;
}

/* ==========================================================================
   UTILITÁRIOS E CLASSES VISUAIS
   ========================================================================== */

.glass-nav {
    background: var(--igi-glass-nav);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--igi-surface-card-border);
}

.glass-nav .navbar-nav .nav-link {
    white-space: nowrap !important;
    font-size: 0.92rem;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}

@media (min-width: 992px) and (max-width: 1280px) {
    .glass-nav .navbar-nav .nav-link {
        font-size: 0.84rem !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    .brand-subtitle {
        display: none !important;
    }
}

.glass-card {
    background: var(--igi-surface-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--igi-surface-card-border);
    border-radius: 14px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -6px rgba(0, 0, 0, 0.45);
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-eletrica {
    background: rgba(245, 158, 11, 0.08);
    color: var(--igi-amber-400);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-ti {
    background: rgba(56, 189, 248, 0.08);
    color: var(--igi-cyan-400);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-crt {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-dot-amber {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--igi-amber-400);
    display: inline-block;
}

.badge-dot-cyan {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--igi-cyan-400);
    display: inline-block;
}

/* ==========================================================================
   CARDS DE ATENDIMENTO HERO & CONTATO (DESIGN CLEAN)
   ========================================================================== */

.card-atendimento-eletrica {
    background: rgba(18, 25, 43, 0.7);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
}

.card-atendimento-eletrica:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 12px 28px -4px rgba(245, 158, 11, 0.15);
}

.card-atendimento-ti {
    background: rgba(18, 25, 43, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
}

.card-atendimento-ti:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 12px 28px -4px rgba(56, 189, 248, 0.15);
}

.btn-cta-eletrica {
    background: #f59e0b;
    color: #0b1120 !important;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
    transition: all 0.2s ease;
}

.btn-cta-eletrica:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-cta-ti {
    background: #0284c7;
    color: #ffffff !important;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
}

.btn-cta-ti:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

/* ==========================================================================
   BOTÃO FLUTUANTE DE WHATSAPP COM SELETOR
   ========================================================================== */

.whatsapp-floating-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.whatsapp-floating-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--igi-whatsapp-green);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: pulse-green 2.5s infinite;
    pointer-events: auto;
}

.whatsapp-floating-btn:hover {
    background-color: var(--igi-whatsapp-hover);
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-popup {
    background: var(--igi-navy-900);
    border: 1px solid var(--igi-surface-card-border);
    border-radius: 16px;
    padding: 20px;
    width: 320px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    margin-bottom: 14px;
    animation: fadeInSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   PORTFÓLIO & LIGHTBOX
   ========================================================================== */

.portfolio-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 10;
    cursor: pointer;
}

.portfolio-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-img-wrapper:hover img {
    transform: scale(1.06);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 11, 23, 0.92) 0%, rgba(6, 11, 23, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-img-wrapper:hover .portfolio-overlay {
    opacity: 1;
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-content {
    max-width: 900px;
    width: 100%;
    background: var(--igi-navy-900);
    border: 1px solid var(--igi-surface-card-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   CLIENTES & PARCEIROS
   ========================================================================== */

.client-logo-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.client-logo-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.12);
}

.client-logo-card img {
    max-height: 55px;
    max-width: 130px;
    object-fit: contain;
    filter: grayscale(10%);
    transition: filter 0.25s ease;
}

.client-logo-card:hover img {
    filter: grayscale(0%);
}

/* ==========================================================================
   FORMULÁRIOS & CAMPOS FLUENT
   ========================================================================== */

.form-input-custom {
    background: rgba(11, 19, 43, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input-custom:focus {
    border-color: var(--igi-cyan-400) !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25) !important;
    outline: none;
}

/* Estilização para suporte ao Fluent UI components */
fluent-text-field::part(control),
fluent-text-area::part(control),
fluent-select::part(control) {
    background: rgba(11, 19, 43, 0.8) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
}

/* ==========================================================================
   RESPONSIVIDADE E AJUSTES DE TELA
   ========================================================================== */

@media (max-width: 768px) {
    .whatsapp-popup {
        width: 290px;
        right: 10px;
    }

    .whatsapp-floating-container {
        bottom: 20px;
        right: 20px;
    }

    .hero-title {
        font-size: 2.2rem !important;
    }
}

/* ==========================================================================
   BLAZOR ERROR UI (Oculto por padrão, ativado apenas se houver falha de circuito)
   ========================================================================== */

#blazor-error-ui {
    display: none;
    background: #fff3cd;
    color: #664d03;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    width: 100%;
    z-index: 100000;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    border-top: 2px solid #ffecb5;
}

#blazor-error-ui .reload {
    color: #0d6efd;
    font-weight: 600;
    margin: 0 8px;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.25rem;
    top: 0.75rem;
    font-size: 1.1rem;
}

/* ==========================================================================
   ESTILOS DE ALTO CONTRASTE PARA TABELAS E GRIDS
   ========================================================================== */

.table-custom-dark {
    --bs-table-bg: transparent;
    --bs-table-color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.12);
}

.table-custom-dark th {
    background: rgba(6, 11, 23, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.18);
    font-weight: 700;
}

.table-custom-dark td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 16px;
}