:root {
    --deep-grid: #ffffff;
    --volt-yellow: #ffce00;
    --cobalt-blue: #013c78;
    --alabaster: #111827;
}

/* Animacoes */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 206, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(255, 206, 0, 0.3);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animate-fade-in-up-delay {
    opacity: 0;
    animation: fade-in-up 0.8s ease-out 0.2s forwards;
}

.animate-fade-in-up-delay-2 {
    opacity: 0;
    animation: fade-in-up 0.8s ease-out 0.4s forwards;
}

.whatsapp-pulse {
    animation: pulse-glow 2s infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--cobalt-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--volt-yellow);
}

/* Selecao de texto */
::selection {
    background: var(--cobalt-blue);
    color: #ffffff;
}

/* Form estilos */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827;
    -webkit-box-shadow: 0 0 0px 1000px #f1f5f9 inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Estilos do mapa */
iframe {
    border-radius: 1rem;
}

/* Transicoes suaves */
a, button {
    transition: all 0.3s ease;
}

/* FAQ estilos */
.faq-item.active {
    border-color: rgba(1, 60, 120, 0.5);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hover glow */
.hover-glow:hover {
    box-shadow: 0 0 30px rgba(1, 60, 120, 0.15);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--cobalt-blue) 0%, var(--volt-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Linha decorativa */
.section-line {
    width: 60px;
    height: 4px;
    background: var(--cobalt-blue);
    border-radius: 2px;
}

/* Responsividade aprimorada */
@media (max-width: 640px) {
    .animate-fade-in-up,
    .animate-fade-in-up-delay,
    .animate-fade-in-up-delay-2 {
        animation-duration: 0.6s;
    }
}

/* Reducao de movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visivel */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cobalt-blue);
    outline-offset: 2px;
}

/* Placeholder color */
::placeholder {
    color: #9ca3af;
}

/* Select seta */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23013c78'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5rem;
    padding-right: 3rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Mobile menu */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu:not(.hidden) {
    animation: fade-in-up 0.3s ease-out forwards;
}

/* Hero Slider */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}
.hero-slide.active {
    opacity: 1;
}

/* Hero Content per slide */
.hero-text-transition {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.hero-text-transition.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}
.hero-text-transition.fade-in {
    opacity: 0;
    transform: translateY(10px);
}

/* Hero dots */
.hero-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}
.hero-dot.active {
    background: #ffce00 !important;
    transform: scale(1.3);
}
.hero-dot:hover {
    transform: scale(1.15);
}

/* Servico Cards com imagem */
#servicos .group {
    border: 1px solid rgba(255, 206, 0, 0.2);
    transition: all 0.4s ease;
}
#servicos .group:hover {
    border-color: rgba(255, 206, 0, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(1, 60, 120, 0.2);
}

/* Obras Carrossel */
.projetos-track {
    will-change: transform;
}
.projetos-slide {
    width: 100%;
}
@media (min-width: 640px) {
    .projetos-slide {
        width: 50%;
    }
}
@media (min-width: 1024px) {
    .projetos-slide {
        width: 33.3333%;
    }
}
.projetos-dot.active {
    background: #013c78;
    transform: scale(1.3);
}
.projetos-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}
.projetos-dot:hover {
    transform: scale(1.15);
}

/* Lightbox */
#projetos-lightbox {
    transition: opacity 0.3s ease;
}

/* Loading state para formulario */
button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Toast/Alert messages */
.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ===== Scroll Effects ===== */

/* Scroll progress bar */
#scroll-progress {
    pointer-events: none;
}

/* Back to top */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateY(-2px) !important;
}

/* Enhanced reveal — varied entrance animations */
.reveal-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-fade-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-fade-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Delays for stagger */
.delay-0   { transition-delay: 0ms; }
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Parallax section background */
.section-parallax {
    position: relative;
    overflow: hidden;
}

.section-parallax::before {
    content: '';
    position: absolute;
    inset: -20% 0;
    background: inherit;
    will-change: transform;
    pointer-events: none;
}

/* Active nav link */
.nav-link-active {
    color: var(--volt-yellow) !important;
}

/* Navbar link base color (azul da marca) e hover (amarelo) */
.nav-link {
    position: relative;
    color: var(--cobalt-blue);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--volt-yellow);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--volt-yellow);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link-active::after {
    width: 100%;
}

/* Section divider effect */
.section-divider {
    position: relative;
}

.section-divider::after {
    display: none;
}

/* Reveal children stagger — base wrapper class */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-children > *.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animated gradient border for sections */
.gradient-border-top {
    position: relative;
}

.gradient-border-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(1, 60, 120, 0.3), transparent);
}

/* Smooth section entrance — each section fades in on scroll */
section {
    will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-fade-up,
    .reveal-fade-left,
    .reveal-fade-right,
    .reveal-scale,
    .stagger-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    #back-to-top {
        transition: none;
    }
}

/* ===== Mobile Responsividade Extra ===== */
@media (max-width: 639px) {
    /* Navbar */
    #navbar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero - reduzir altura minima */
    .min-h-screen {
        min-height: 100svh;
    }
    
    /* Obras carousel - setas sempre visiveis no mobile */
    #projetos-prev,
    #projetos-next {
        opacity: 1 !important;
        width: 2.25rem;
        height: 2.25rem;
    }
    
    /* Lightbox - imagens menores no mobile */
    #lightbox-img {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    /* Iframe do mapa */
    iframe {
        height: 280px !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    /* Tablet adjustments */
    iframe {
        height: 400px !important;
    }
    
    /* Obras carousel - setas visiveis no tablet */
    #projetos-prev,
    #projetos-next {
        opacity: 1 !important;
    }
}

/* Touch support - swipe no carrossel */
.projetos-track {
    touch-action: pan-y;
}

/* Safe area para dispositivos com notch */
@supports (padding: env(safe-area-inset-bottom)) {
    .whatsapp-pulse {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
    #back-to-top {
        bottom: calc(6rem + env(safe-area-inset-bottom));
    }
}