/**
 * CSS Customizado - XCERT Certificadora
 *
 * Estilos complementares ao Tailwind CSS para animações,
 * ajustes finos e customizações específicas.
 */

/* =====================================================
   GOOGLE FONTS
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =====================================================
   RESET E BASE
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   ANIMAÇÕES CUSTOMIZADAS
   ===================================================== */

/* Pulse lento para botão WhatsApp */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in para elementos */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slide in from left */
@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slide-in-left 0.6s ease-out forwards;
}

/* Slide in from right */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slide-in-right 0.6s ease-out forwards;
}

/* Scale in */
@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scale-in 0.4s ease-out forwards;
}

/* =====================================================
   HEADER STICKY
   ===================================================== */
#site-header {
    transition: all 0.3s ease-in-out;
}

#site-header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* =====================================================
   FOCUS STATES (Acessibilidade)
   ===================================================== */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #1E88E5;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #1E88E5;
    outline-offset: 2px;
}

/* =====================================================
   SMOOTH SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #1E88E5;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1565C0;
}

/* =====================================================
   SELEÇÃO DE TEXTO
   ===================================================== */
::selection {
    background-color: #1E88E5;
    color: white;
}

::-moz-selection {
    background-color: #1E88E5;
    color: white;
}

/* =====================================================
   LAZY LOADING DE IMAGENS
   ===================================================== */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* =====================================================
   BOTÕES E CTAs
   ===================================================== */
.btn-primary {
    background-color: #1E88E5;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(30, 136, 229, 0.3);
}

.btn-primary:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(30, 136, 229, 0.4);
}

.btn-secondary {
    background-color: #00C853;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 200, 83, 0.3);
}

.btn-secondary:hover {
    background-color: #00A243;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(0, 200, 83, 0.4);
}

/* =====================================================
   CARDS E SHADOWS
   ===================================================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =====================================================
   GRADIENTES
   ===================================================== */
.gradient-blue {
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #00C853 0%, #00A243 100%);
}

.gradient-dark {
    background: linear-gradient(135deg, #1A237E 0%, #0D47A1 100%);
}

/* =====================================================
   FORMULÁRIOS
   ===================================================== */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    border-color: #1E88E5;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

/* Estado de erro */
.input-error {
    border-color: #f44336 !important;
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1) !important;
}

/* =====================================================
   ALERTAS E MENSAGENS
   ===================================================== */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    animation: fade-in 0.3s ease-out;
}

.alert-success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid #4CAF50;
}

.alert-error {
    background-color: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #F44336;
}

.alert-info {
    background-color: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid #2196F3;
}

.alert-warning {
    background-color: #FFF3E0;
    color: #E65100;
    border-left: 4px solid #FF9800;
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.spinner {
    border: 3px solid rgba(30, 136, 229, 0.2);
    border-top-color: #1E88E5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   Z-INDEX LAYERS
   ===================================================== */
/* Garante ordem correta de sobreposição */
#site-header {
    z-index: 1000;
}

#mobile-menu {
    z-index: 999;
}

#whatsapp-float {
    z-index: 998;
}

.modal-overlay {
    z-index: 1001;
}

.modal-content {
    z-index: 1002;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    #site-header,
    footer,
    #whatsapp-float,
    #mobile-menu-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* =====================================================
   RESPONSIVIDADE CUSTOMIZADA
   ===================================================== */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* =====================================================
   ACCESSIBILITY - Skip Link
   ===================================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1E88E5;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}
