/* ============================================
   RESET E VARIÁVEIS GLOBAIS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Primárias */
    --primary-color: #007BFF;
    --primary-dark: #0056b3;
    --secondary-color: #FFC107;
    --secondary-dark: #e0a800;

    /* Cores de Fundo */
    --bg-main: #F8F9FA;
    --bg-alt: #E9ECEF;
    --bg-dark: #212529;

    /* Cores de Texto */
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-light: #F8F9FA;

    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);

    /* Tipografia */
    --font-title: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transições */
    --transition: all 0.3s ease-in-out;
}

/* ============================================
   ESTILOS GLOBAIS
   ============================================ */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background-color: var(--bg-alt);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.site-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 0.5rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

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

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

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="1200" height="600" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--text-light);
    animation: slideInDown 0.8s ease-out;
}

.hero-title {
    font-family: var(--font-title);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.hero-btn {
    background-color: var(--secondary-color);
    color: var(--text-primary);
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
}

.hero-btn:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ============================================
   SEARCH SECTION
   ============================================ */

.search-section {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    font-size: 1rem;
    border: 2px solid var(--bg-alt);
    border-radius: 50px;
    background-color: var(--text-light);
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.25rem;
}

/* ============================================
   SERVICES SECTION
   ============================================ */

.services-section {
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* ============================================
   CARD STYLES
   ============================================ */

.service-card {
    background-color: var(--text-light);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    border-top: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

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

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

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    object-fit: contain;
    transition: var(--transition);
}

.service-card:hover .card-icon {
    transform: scale(1.1);
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.card-link:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* Cores alternadas dos cards */
.service-card:nth-child(1),
.service-card:nth-child(7) {
    border-top-color: #007BFF;
}

.service-card:nth-child(2),
.service-card:nth-child(8) {
    border-top-color: #28A745;
}

.service-card:nth-child(3),
.service-card:nth-child(9) {
    border-top-color: #FF6B6B;
}

.service-card:nth-child(4) {
    border-top-color: #00BCD4;
}

.service-card:nth-child(5) {
    border-top-color: #673AB7;
}

.service-card:nth-child(6) {
    border-top-color: #FF9800;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-text {
    color: var(--text-light);
    line-height: 1.8;
}

.footer-text a {
    color: var(--secondary-color);
    transition: var(--transition);
}

.footer-text a:hover {
    text-decoration: underline;
}

.footer-links ul {
    list-style: none;
}

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

.footer-links a {
    color: var(--text-light);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

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

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

.service-card:nth-child(n+4) {
    animation-delay: calc(0.1s * (var(--index) - 3));
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablet (768px) */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero {
        height: 350px;
    }

    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    .header-container {
        padding: 0 1rem;
    }

    .logo {
        height: 40px;
    }

    .site-title {
        font-size: 1.25rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero {
        height: 280px;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .footer-container {
        padding: 0 1rem;
    }
}

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

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

/* ============================================
   MODO ESCURO (Opcional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #1a1a1a;
        --bg-alt: #2d2d2d;
        --text-primary: #f0f0f0;
        --text-secondary: #b0b0b0;
    }

    .service-card {
        background-color: #2d2d2d;
        color: var(--text-light);
    }

    .search-input {
        background-color: #2d2d2d;
        color: var(--text-light);
        border-color: #444;
    }
}

/* ============================================
   MODO ALTO CONTRASTE (Acessibilidade)
   ============================================ */

body.high-contrast {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
}

body.high-contrast :root {
    --primary-color: #fff;
    --primary-dark: #fff;
    --bg-main: #000;
    --bg-alt: #000;
    --text-primary: #fff;
    --text-secondary: #fff;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
}

body.high-contrast .header {
    background-color: #000 !important;
    border-bottom: 2px solid #fff;
}

body.high-contrast .service-card,
body.high-contrast .search-input,
body.high-contrast .hero-btn,
body.high-contrast .card-link {
    background-color: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
    box-shadow: none !important;
}

body.high-contrast .nav-link,
body.high-contrast .site-title,
body.high-contrast .section-title,
body.high-contrast .hero-title,
body.high-contrast .hero-subtitle,
body.high-contrast .card-title {
    color: #fff !important;
}

body.high-contrast .nav-link::after {
    background-color: #fff !important;
}

body.high-contrast .hero {
    background: #000 !important;
    border-bottom: 2px solid #fff;
}

body.high-contrast .hero-overlay {
    display: none;
}

body.high-contrast .footer {
    background-color: #000 !important;
    border-top: 2px solid #fff;
}

body.high-contrast .card-icon {
    filter: brightness(2) contrast(2);
}

/* Accessibility Control styles */
.a11y-controls {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.a11y-btn {
    background: var(--bg-alt);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.a11y-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

body.high-contrast .a11y-btn {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
}

body.high-contrast .a11y-btn:hover {
    background: #fff;
    color: #000;
}

/* ============================================
   MODAL / POPUP
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    width: 95%;
    max-width: 650px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(40px) scale(0.92);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 2rem;
    color: #fff;
    text-align: center;
    position: relative;
    border: none;
}

.modal-header h3 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    margin: 0;
    color: #fff;
}

.modal-body {
    padding: 2.5rem;
    text-align: center;
}

.modal-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    object-fit: contain;
}


.modal-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

.modal-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #444;
}

.modal-text p { margin-bottom: 1rem; }


.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.modal-close:hover {
    background: #FF4D4D;
    transform: rotate(90deg);
}

body.high-contrast .modal-content {
    background: #000;
    border: 3px solid #fff;
}

body.high-contrast .modal-text {
    color: #fff;
}

body.high-contrast .modal-header {
    background: #000;
    border-bottom: 2px solid #fff;
}

body.high-contrast .modal-close {
    border: 2px solid #fff;
}

/* ============================================
   ACESSSIBILIDADE E BOTÕES FLUTUANTES
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
}

.a11y-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.a11y-btn {
    background: var(--bg-alt);
    color: var(--text-primary);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.a11y-btn:hover {
    background: var(--primary-color);
    color: white;
}

.a11y-btn i {
    width: 18px;
    height: 18px;
}

/* Ajuste no body para suporte a tamanho de fonte */
body {
    transition: font-size 0.2s ease;
}