/* === VARIÁVEIS CSS === */
:root {
    /* Cores Oficiais Instituto Bahia */
    --primary-color: #B51D15;
    --primary-hover: #9A1712;
    --primary-light: #D1251A;
    
    /* Azuis Complementares Elegantes */
    --secondary-color: #2C3E50;
    --accent-color: #34495E;
    --blue-elegant: #3B5998;
    --blue-light: #4A69BD;
    --blue-dark: #2F3A56;
    
    /* Neutros */
    --white: #ffffff;
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --dark-gray: #495057;
    --text-primary: #2C3E50;
    --text-secondary: #5A6C7D;
    
    /* Sombras Suaves */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-red: 0 4px 14px rgba(181, 29, 21, 0.25);
    
    /* Layout */
    --border-radius: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradientes Harmoniosos */
    --gradient-primary: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 50%, var(--blue-dark) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.9));
    --gradient-button: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

/* === RESET E CONFIGURAÇÕES BASE === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gradient-primary);
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: var(--dark-gray);
    overflow: hidden;
}

/* === LAYOUT PRINCIPAL === */
.main-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === CABEÇALHO === */
.header {
    padding: 1.5rem 0 1rem;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

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

.logo-header {
    height: clamp(60px, 10vh, 120px);
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
    animation: logoFloat 3s ease-in-out infinite;
}

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

.logo-header:hover {
    transform: scale(1.05);
}

/* === CONTEÚDO PRINCIPAL === */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem 0;
    min-height: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
    place-items: center;
}

/* === CARTÕES DE SERVIÇOS === */
.service-card {
    background: var(--gradient-card);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    transition: var(--transition);
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transition: var(--transition);
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(59, 89, 152, 0.3);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    transition: var(--transition);
    position: relative;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--secondary-color);
}

.service-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.service-description {
    color: var(--medium-gray);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
}

.service-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--gradient-button);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-red);
}

.service-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--blue-elegant) 100%);
    transition: var(--transition);
    z-index: -1;
}

.service-button:hover::before {
    left: 0;
}

.service-button:hover {
    border-color: var(--blue-elegant);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(181, 29, 21, 0.4);
}

.service-button i {
    transition: var(--transition);
}

.service-button:hover i {
    transform: translateX(3px);
}

/* === RODAPÉ === */
.footer {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 1.5rem 0;
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-text {
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-text:hover {
    color: var(--white);
}

/* === ANIMAÇÕES === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

/* === RESPONSIVIDADE === */

/* Tablets */
@media (max-width: 1024px) {
    .container {
        padding: 0 1rem;
    }
    
    .services-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    
    .main-wrapper {
        height: auto;
        min-height: 100vh;
    }
    
    .header {
        padding: 1rem 0 0.5rem;
    }
    
    .logo-header {
        height: clamp(50px, 8vh, 80px);
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    
    .service-icon {
        font-size: 3rem;
    }
    
    .service-title {
        font-size: 1.5rem;
    }
    
    .service-description {
        font-size: 0.95rem;
    }
    
    .service-button {
        padding: 0.9rem 1.8rem;
        font-size: 0.85rem;
    }
    
    .footer {
        padding: 1rem 0;
    }
    
    .footer-text {
        font-size: 0.85rem;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .service-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }
    
    .service-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .service-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .service-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .service-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
    }
}

/* === MODO ESCURO (opcional) === */
@media (prefers-color-scheme: dark) {
    .service-card {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .service-title {
        color: var(--white);
    }
    
    .service-description {
        color: rgba(255, 255, 255, 0.7);
    }
}

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

/* Focus visível para navegação por teclado */
.service-button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* === OTIMIZAÇÕES DE PERFORMANCE === */
.service-card {
    will-change: transform;
}

.service-icon {
    will-change: transform, color;
}

.logo-header {
    will-change: transform;
} 