/* =================================================================== */
/* ======================= RESET GLOBAL ============================== */
/* =================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: clip; max-width: 100vw; }

img, video, svg, iframe, picture { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; word-wrap: break-word; }
.table-responsive { overflow-x: auto; }

/* =================================================================== */
/* ======================= ESTILIZAÇÃO  ============================== */
/* =================================================================== */
:root {
    --azul-claro: #1197BA;
    --azul-claro-2: #00BFFF;
    --azul-escuro: #0C1427;
    --azul-escuro-2: #1A2747;
    --azul-cinza: #212529;
    --cinza-claro: #adb5bd;
    --cinza-escuro: #495057;
    --cinza-text: #343A40;
    --branco: #ffffff;
    --branco-text: #e9ecef;
    --branco-bg: #f8f9fa;
    --preto: #000;
    --vermelho: #dc3545;

    /* Mobile dock tokens — single source of truth for dock + clearance */
    --dock-height: 88px;
    --dock-gap: 1rem;
    --dock-safe-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    --dock-clearance: calc(var(--dock-height) + var(--dock-safe-bottom) + var(--dock-gap));

    /* Fluid spacing scale — clamp-based, scales with viewport */
    --fluid-space-1: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --fluid-space-2: clamp(1rem, 0.7rem + 1.5vw, 1.5rem);
    --fluid-space-3: clamp(1.5rem, 1rem + 2.5vw, 3rem);
    --fluid-space-4: clamp(2rem, 1rem + 5vw, 5rem);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--branco-bg);
    color: var(--azul-cinza);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* =================================================================== */
/* ======================= TIPOGRAFIA FLUIDA ========================= */
/* =================================================================== */
h1 { font-size: clamp(1.75rem, 1rem + 3.5vw, 3rem); line-height: 1.2; }
h2 { font-size: clamp(1.5rem, 0.9rem + 2.8vw, 2.5rem); line-height: 1.25; }
h3 { font-size: clamp(1.25rem, 0.85rem + 2vw, 2rem); line-height: 1.3; }
h4 { font-size: clamp(1.15rem, 0.85rem + 1.4vw, 1.5rem); }
h5 { font-size: clamp(1rem, 0.85rem + 0.7vw, 1.25rem); }
body, p { font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem); line-height: 1.65; }
.lead { font-size: clamp(1rem, 0.9rem + 0.6vw, 1.2rem); }
.display-1 { font-size: clamp(2.5rem, 1rem + 6vw, 5rem); }

/* =================================================================== */
/* ======================= COMPONENTES =============================== */
/* =================================================================== */

/* --- BARRA DE NAVEGAÇÃO --- */
.navbar-custom {
    transition: background-color 0.4s ease-out;
    background-color: transparent;
    border-bottom: 0.5px solid var(--branco-text);
}

/* Navbar para páginas internas */
.navbar-dark-bg {
    background-color: var(--azul-escuro);
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    padding: 0.5rem 0;
}
.navbar-dark-bg .logo-dark { display: none; }

/* Cor dos links na navbar de páginas internas */
.navbar-dark-bg .nav-link {
    color: var(--branco-text);
}

/*NAVBAR LNKS */

.nav-link{
    margin: 0 0.5rem;
    transition: color 0.3s ease;
    font-weight: bold;
}

/* Estilo para o link ativo (aplicado em todos os casos) */
.nav-link.active {
    color: var(--azul-claro) !important; /* Azul claro para destaque */
    font-weight: bold; /* Opcional: negrito para maior destaque */
}

/* Cor dos links no estado transparente */
.navbar-custom .nav-link {
    color: var(--branco-text);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--azul-claro); /* Azul claro para destaque */
}

/* Customizando o ícone do menu 'hambúrguer' */
.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar-dark .navbar-solid .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/*Botão de contato*/
.btn-contato {
    background-color: var(--azul-claro);
    border-color: var(--azul-claro);
    color: var(--branco);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    font-weight: bold;
}
.btn-contato:active {
    transform: scale(0.97);
}
.btn-contato:hover {
    opacity: 0.9; /* Valor corrigido */
    color: var(--azul-escuro);
    background-color: var(--branco);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    font-weight: bold;
}

.btn-contato.active {
    opacity: 0.9; /* Valor corrigido */
    color: var(--azul-escuro);
    background-color: var(--branco);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    font-weight: bold;
}

/*Botão de logout*/
.btn-danger {
    padding: 0.75rem 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    font-weight: bold;
}

.nav-item .danger{
    color: var(--vermelho) !important;
    font-weight: bold;
}

/* =================================================================== */
/* HOME */
.navbar-solid {
    background-color: var(--branco);
    box-shadow: 0 2px 4px rgba(0,0,0,.04);
}

.home-navbar{
    border-bottom: none;
}

/* Cor dos links no estado sólido */
.navbar-solid .nav-link {
    color: var(--azul-escuro);
}

/* Controle de visibilidade dos logos */
.home-navbar .logo-dark { display: none;}
.home-navbar .logo-light { display: inline-block;}
.home-navbar.navbar-solid .logo-dark { display: inline-block;}
.home-navbar.navbar-solid .logo-light { display: none;}

/* =================================================================== */
/* NAVBAR PILL (scroll effect) */
#mainNavbar {
    transition: left 0.4s ease, right 0.4s ease, top 0.4s ease,
                border-radius 0.4s ease, background-color 0.4s ease-out,
                padding 0.4s ease, box-shadow 0.4s ease;
}

.navbar-pill {
    left: 15% !important;
    right: 15% !important;
    top: 0.75rem !important;
    border-radius: 50px !important;
    background-color: var(--azul-escuro) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
    border-bottom: none !important;
}

.navbar-pill .navbar-nav {
    margin-left: auto !important;
    margin-right: auto !important;
}

.navbar-pill .nav-link {
    color: var(--branco-text) !important;
}

.navbar-pill .nav-link:hover,
.navbar-pill .nav-link.active {
    color: var(--azul-claro) !important;
}

/* Light logo on dark pill */
.navbar-pill .logo-light { display: inline-block !important; }
.navbar-pill .logo-dark  { display: none !important; }

/* =================================================================== */
/* --- HEADER DE SOBRE E CONTATO --- */

/* --- Header da Página --- */
.fw-bold {
    font-weight: 700 !important;
}

/* Estilo do Cabeçalho da Página com Imagem de Fundo e Filtro */
/* background-image definido via <style> no base_public.html (requer {% static %}) */
.page-header {
    padding: clamp(6rem, 14vw, 10rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 8vw, 5rem);
    text-align: center;
    color: var(--branco-text);
    background-size: cover;
    background-position: center center;
    position: relative;
    z-index: 1;
}

/* Filtro escuro sobre a imagem de fundo */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(12, 20, 39, 0.85); /* Overlay escuro */
    z-index: -1;
}

.page-header h1 {
    font-size: clamp(2rem, 5.5vw, 3rem);
}
.page-header p {
    font-size: clamp(1rem, 2.4vw, 1.15rem);
    color: rgba(255, 255, 255, 0.7);
}

/* =================================================================== */
/* --- Botão Voltar ao Topo --- */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--azul-claro);
    color: white;
    text-align: center;
    line-height: 50px;
    font-size: 1.5rem;
    z-index: 1060; /* above mobile-dock (1050) so it stays clickable */
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
/* On mobile, lift above mobile-dock using the shared --dock-clearance token. */
@media (max-width: 991.98px) {
    #scrollTopBtn {
        bottom: calc(var(--dock-clearance) + 12px);
        right: 16px;
        width: 44px;
        height: 44px;
        line-height: 44px;
        font-size: 1.2rem;
    }
}
#scrollTopBtn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* --- Rodapé --- */
.footer-custom {
    background-color: var(--azul-escuro);
    color: var(--cinza-claro);
    margin-top: 6rem;
}

.footer-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--branco);
}

.footer-title {
    color: var(--branco);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--azul-claro);
    border-radius: 2px;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--branco);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--azul-claro-2);
    transform: translateX(5px);
}

.footer-contact a {
    color: var(--branco);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-contact a:hover {
    color: var(--azul-claro-2);
}

.text-primary-light {
    color: var(--azul-claro-2);
}

.text-muted-light {
    color: var(--branco);
}

.social-links {
    display: flex;
    gap: 0.8rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--branco-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.social-icon:hover {
    background-color: var(--azul-claro);
    color: var(--branco);
    transform: translateY(-3px);
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.footer-copyright, .footer-credits {
    color: var(--branco);
}

/* =================================================================== */
/* ======================= CONTAINER FLUIDO ========================== */
/* =================================================================== */
.container {
    padding-left: clamp(1rem, 3vw, 1.5rem);
    padding-right: clamp(1rem, 3vw, 1.5rem);
}

@media (min-width: 1440px) {
    .container { max-width: 1440px; }
}

/* RESPONSIVIDADE */

/* Para telas médias */
@media (max-width: 991.98px) {
    .navbar-nav {
        text-align: center; /* Centraliza links no menu hambúrguer */
    }
    .btn-contato {
        margin-top: 1rem; /* Espaço extra para botão no menu colapsado */
    }

    /* Desativa pill em mobile — hamburger não combina com pill */
    .navbar-pill {
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,.08) !important;
    }
}
/* Para telas pequenas: ajustes pontuais. Padding fluido vive nas regras base via clamp(). */
@media (max-width: 767.98px) {
    main .hero-section { padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 4vw, 1.5rem); }
}

/* Dock clearance: padding below <main> only while dock is visible (≤992px).
   Owns the gap between content and dock so footer can sit flush at page end. */
@media (max-width: 991.98px) {
    main#main-content { padding-bottom: var(--dock-clearance); }
}

/* Para telas extra pequenas */

/* =================================================================== */
/* ========================= ACESSIBILIDADE ========================== */
/* =================================================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--azul-claro);
    color: var(--branco);
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 0 0 0.5rem 0.5rem;
    z-index: 9999;
    transition: top 0.2s ease;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid var(--azul-claro-2);
    outline-offset: 2px;
}

*:focus-visible {
    outline: 2px solid var(--azul-claro);
    outline-offset: 3px;
    border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.logo-navbar {
    height: 65px;
}
.logo-footer {
    height: 50px;
}

/* =================================================================== */
/* =================== MOBILE BOTTOM DOCK ============================ */
/* =================================================================== */
.mobile-dock {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    /* Uses --dock-safe-bottom token: max(20px, env(safe-area-inset-bottom)).
       Anchors dock above iOS home indicator and outside notch-area. */
    bottom: var(--dock-safe-bottom);
    z-index: 1050;
    width: min(92vw, 440px);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.dock-container {
    /* Grid with auto-flow column + 1fr columns = perfectly equal item widths,
       guaranteed min 44px (WCAG 2.5.5 target size). */
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(44px, 1fr);
    align-items: center;
    background-color: rgba(33, 37, 41, 0.95); /* var(--azul-cinza) */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    padding: 0.5rem;
    gap: 0.15rem;
    min-height: var(--dock-height);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    .dock-container { background-color: rgba(33, 37, 41, 0.98); }
}

.dock-item {
    color: #a0aec0;
    padding: 0.4rem 0.35rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    text-align: center;
}

.dock-item i {
    font-size: clamp(1.05rem, 3.6vw, 1.25rem);
    line-height: 1;
}

.dock-label {
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dock-item:hover {
    color: var(--branco);
}

.dock-item.active {
    background-color: var(--azul-claro);
    color: var(--branco);
    border: 1px solid var(--azul-claro-2);
    box-shadow: 0 4px 12px rgba(17, 151, 186, 0.4);
}

.dock-item.danger {
    color: var(--vermelho);
}

/* iPhone SE / narrow Androids: compact dock to fit 6 items comfortably */
@media (max-width: 374.98px) {
    .mobile-dock { width: 96vw; }
    .dock-item { padding: 0.35rem 0.25rem; }
    .dock-item i { font-size: 1rem; }
    .dock-label { font-size: 0.58rem; }
}

/* =================================================================== */
/* =================== MICRO-INTERAÇÕES GLOBAIS ====================== */
/* =================================================================== */

/* GPU acceleration hint for GSAP-animated elements */
.feature-card,
.pillar-card,
.service-card,
.social-icon,
.btn-contato,
.btn-primary-custom,
.dock-item,
#scrollTopBtn {
    will-change: transform;
}

/* Pointer cursor for non-anchor interactive cards */
.feature-card,
.pillar-card,
.service-card {
    cursor: default;
}

/* Form input focus — glowing border */
.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px rgba(17, 151, 186, 0.18);
    outline: none;
}

/* Active dock item glow pulse — opacity on pseudo-element (GPU-composited, no repaint) */
.dock-item.active {
    position: relative;
    overflow: hidden;
}

.dock-item.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(17, 151, 186, 0.25);
    opacity: 0;
    animation: dock-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dock-pulse {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}

/* Shimmer skeleton loader — transform-based (GPU-composited, no repaint) */
.skeleton {
    background: #ebebeb;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.65) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(200%); }
}

/* Footer links — smooth underline */
.footer-links a {
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--azul-claro-2);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

/* =================================================================== */
/* ======================= SCROLL REVEAL ============================= */
/* =================================================================== */
/* Hidden ONLY when JS has declared support via .js-anim on <html>.
   If JS fails, .reveal rules don't apply → content stays visible.
   Easing: out-expo (Apple/Linear/Vercel feel) — strong start, gentle landing. */
.js-anim .reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.js-anim .reveal-left  { opacity: 0; transform: translateX(-50px); transition: opacity 0.95s cubic-bezier(0.16,1,0.3,1), transform 0.95s cubic-bezier(0.16,1,0.3,1); will-change: opacity, transform; }
.js-anim .reveal-right { opacity: 0; transform: translateX(50px);  transition: opacity 0.95s cubic-bezier(0.16,1,0.3,1), transform 0.95s cubic-bezier(0.16,1,0.3,1); will-change: opacity, transform; }
.js-anim .reveal-scale { opacity: 0; transform: scale(0.9);        transition: opacity 0.95s cubic-bezier(0.16,1,0.3,1), transform 0.95s cubic-bezier(0.16,1,0.3,1); will-change: opacity, transform; }

.js-anim .reveal.in-view,
.js-anim .reveal-left.in-view,
.js-anim .reveal-right.in-view,
.js-anim .reveal-scale.in-view {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js-anim .reveal,
    .js-anim .reveal-left,
    .js-anim .reveal-right,
    .js-anim .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
