@import url('atimo-tokens.css');

/* CSS Variáveis */
:root {
    /* Cor primaria canonica da marca Atimo Saude — sincronizada com /app
       /admin e templates de email. NAO alterar sem atualizar todos. */
    --bs-primary: #0046BE;
    --bs-primary-rgb: 0, 70, 190;
    --bs-primary-darker: #003494;
    --bs-primary-lighter: #1f3a8a;
    --bs-secondary: #6c757d;
    --bs-white: #ffffff;
    --bs-gray-100: #f8f9fa;
    --bs-gray-200: #e9ecef;
    --bs-gray-800: #343a40;
    --bs-success: #198754;
    --bs-success-darker: #04c468;
}

/* Estilos Gerais */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--bs-gray-800);
    overflow-x: hidden;
    position: relative;
}

section {
    position: relative;
    padding: 5rem 0;
}

.bg-atimo {
    background-color: var(--bs-primary) !important;
}

.text-atimo {
    color: var(--bs-primary) !important;
}

.btn-atimo {
    color: var(--bs-white);
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    transition: all 0.3s ease;
}

.btn-atimo:hover,
.btn-atimo:focus {
    color: var(--bs-white);
    background-color: var(--bs-primary-darker);
    border-color: var(--bs-primary-darker);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 41, 66, 0.3);
}

.btn-outline-atimo {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: transparent;
    transition: all 0.3s ease;
}

.btn-outline-atimo:hover,
.btn-outline-atimo:focus {
    color: var(--bs-white);
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 41, 66, 0.2);
}

/* Barra de Progresso */
.progress-bar {
    transition: width 0.3s ease;
}

/* Preloader */
.preloader {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader .spinner {
    width: 70px;
    text-align: center;
}

.preloader .spinner>div {
    width: 18px;
    height: 18px;
    background-color: var(--bs-primary);
    border-radius: 100%;
    display: inline-block;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.preloader .spinner .bounce1 {
    animation-delay: -0.32s;
}

.preloader .spinner .bounce2 {
    animation-delay: -0.16s;
}

@keyframes sk-bouncedelay {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

body.loaded .preloader {
    opacity: 0;
    visibility: hidden;
}

/* Navegação */
.navbar {
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    height: 60px;
    width: auto;
    /* Sobrescreve a regra global `img { height: auto }` (~linha 851) que
       ignora o atributo height="60" do HTML — atributo eh presentational
       hint, especificidade zero, qualquer CSS vence. Sem isso, logo
       1000x1000 expande e quebra o navbar. */
    transition: height 0.3s ease;
}

.navbar-nav .nav-link {
    color: var(--bs-gray-800);
    font-weight: 500;
    padding: 1rem 1.25rem;
    position: relative;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: var(--bs-primary);
}

.navbar-nav .nav-link i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--bs-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 8rem 0 6rem;
    color: white;
    /* image-set() escolhe WebP quando o navegador suporta; JPG como fallback
       (dobrou de 1.6 MB pra ~141 KB WebP / ~209 KB JPG). */
    background-image: url('/assets/images/image-hero.jpg');
    background-image: image-set(
        url('/assets/images/image-hero.webp') type('image/webp'),
        url('/assets/images/image-hero.jpg') type('image/jpeg')
    );
    background-image: -webkit-image-set(
        url('/assets/images/image-hero.webp') type('image/webp'),
        url('/assets/images/image-hero.jpg') type('image/jpeg')
    );
    background-size: cover;
    background-position: center;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 41, 66, 0.7);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 80%;
}

/* Features Section */
.feature-card {
    transition: all 0.3s ease;
    height: 100%;
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(26, 41, 66, 0.1);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: var(--bs-primary);
}

.feature-icon-small {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.bg-primary-soft {
    background-color: rgba(26, 41, 66, 0.1);
}

/* Pricing Section */
.pricing-card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pricing-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem !important;
}

.pricing-card .list-unstyled {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    border: 2px solid var(--bs-primary);
    transform: scale(1.05);
    position: relative;
    z-index: 1;
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-10px);
}

.pricing-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pricing-card .btn {
    margin-top: auto;
}

/* Benefits Section */
.benefits-card {
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.benefits-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.benefits-hover-content {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.benefits-card:hover .benefits-hover-content {
    opacity: 1;
    height: auto;
    padding-top: 1rem;
}

/* FAQ Section */
.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    margin: 0;
}

.accordion-button {
    padding: 1.25rem;
    font-weight: 600;
    border-radius: 0.5rem !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(26, 41, 66, 0.25);
}

.accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background-color: rgba(26, 41, 66, 0.05);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}

.accordion-body {
    padding: 1.25rem;
    background-color: white;
}

/* Timeline Style */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12px;
    width: 2px;
    background-color: rgba(0, 0, 0, 0.1);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 30px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    z-index: 1;
}

.security-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Contact Section */
.contact-info {
    position: relative;
    z-index: 2;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.contact-item i {
    font-size: 1.2rem;
    margin-right: 1rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.map-container {
    position: relative;
    overflow: hidden;
}

/* Payment methods */
.payment-methods {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-methods img {
    max-height: 30px;
    width: auto;
}

/* Footer */
footer {
    position: relative;
    z-index: 10;
    background-color: var(--bs-primary);
    color: white;
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.2);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Cookie Banner */
.cookie-consent {
    animation: slideUp 0.5s ease forwards;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Utilitários e Animações */
.bg-atimo {
    background-color: var(--bs-primary) !important;
}

.bg-atimo-light {
    background-color: rgba(26, 41, 66, 0.1) !important;
}

.text-atimo {
    color: var(--bs-primary) !important;
}

/* Botão "Comece Agora" */
.btn-comece-agora {
    background-color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-comece-agora:hover,
.btn-comece-agora:focus {
    background-color: var(--bs-success-darker) !important;
    border-color: var(--bs-success-darker) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 217, 117, 0.3) !important;
}

/* Animações AOS customizadas */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

/* Media Queries */
@media (max-width: 991.98px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar-collapse {
        background-color: white;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .hero {
        padding: 7rem 0 5rem;
        text-align: center;
    }

    .hero .lead {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    section {
        padding: 3rem 0;
    }

    .display-4 {
        font-size: calc(1.375rem + 1.5vw);
    }

    .display-5 {
        font-size: calc(1.3rem + 0.9vw);
    }

    .lead {
        font-size: 1rem;
    }

    .pricing-card.featured {
        transform: scale(1);
    }

    .pricing-card.featured:hover {
        transform: translateY(-10px);
    }
}

/* Estilos para cards */
.pricing-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pricing-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pricing-card .list-unstyled {
    flex-grow: 1;
    margin-bottom: auto;
}

/* Otimização menu mobile */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: white;
        padding: 1.25rem;
        border-radius: 10px;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        max-height: 80vh;
        overflow-y: auto;
        margin-top: 0.75rem;
    }

    .navbar-nav {
        padding: 0.75rem 0;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        border-radius: 6px;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background-color: rgba(13, 110, 253, 0.1);
    }
}

/* Botão "Comece Agora" */
.btn-comece-agora {
    background-color: #05d975 !important;
    border-color: #05d975 !important;
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-comece-agora:hover,
.btn-comece-agora:focus {
    background-color: #04c468 !important;
    border-color: #04c468 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 217, 117, 0.3) !important;
}

/* Link de acessibilidade */
.skip-link:focus {
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    padding: 10px;
    background-color: #042782;
    color: white;
}

/* Formulário CPF/CNPJ */
.cpf-cnpj-toggle {
    display: flex;
    margin-bottom: 0.5rem;
}

.cpf-cnpj-toggle label {
    margin-right: 1rem;
    cursor: pointer;
}

/* Preloader */
.preloader {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

body.loaded .preloader {
    opacity: 0;
    visibility: hidden;
}

/* Background do hero */
.hero {
    /* image-set() escolhe WebP quando o navegador suporta; JPG como fallback
       (dobrou de 1.6 MB pra ~141 KB WebP / ~209 KB JPG). */
    background-image: url('/assets/images/image-hero.jpg');
    background-image: image-set(
        url('/assets/images/image-hero.webp') type('image/webp'),
        url('/assets/images/image-hero.jpg') type('image/jpeg')
    );
    background-image: -webkit-image-set(
        url('/assets/images/image-hero.webp') type('image/webp'),
        url('/assets/images/image-hero.jpg') type('image/jpeg')
    );
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    color: white;
    padding: 6rem 0;
}

/* Overlay para contraste */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 41, 66, 0.7);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* Ajustes responsivos para o hero */
@media (max-width: 767.98px) {
    .hero {
        padding: 4rem 0;
        text-align: center;
        /* Evita fixed-backgrounds bugados no iOS */
        background-attachment: scroll;
    }

    .hero h1 {
        /* clamp() escala gradualmente entre 320px e 768px */
        font-size: clamp(1.5rem, 6vw, 2.25rem);
        line-height: 1.25;
        hyphens: auto;
        word-break: break-word;
    }

    .hero .lead {
        font-size: 1.05rem;
        max-width: 100%;
    }
}

/* Small phones — ajustes extras abaixo de 480px */
@media (max-width: 480px) {
    .hero {
        padding: 3rem 0 2.5rem;
        min-height: 480px;
    }

    section {
        padding: 2.5rem 0;
    }
}

/* Mínimo touch target em mobile: 48px (Material) / 44px (Apple).
   Aplicado a todos os botões e links com aparência de botão. */
@media (max-width: 767.98px) {
    .btn {
        min-height: 44px;
    }
    .btn-lg {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }
    /* Links da navbar em mobile colapsado também merecem altura confortável */
    .navbar-nav .nav-link {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    /* Blog cards: reduzir padding interno em telas muito pequenas */
    .card-body {
        padding: 1rem;
    }
    /* Cards deixam de se mexer em hover (touch não tem hover real) */
    .feature-card:hover,
    .card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
}

/* Headings com tipografia fluída e quebra de palavra segura */
@media (max-width: 767.98px) {
    h1, h2, h3, h4, .display-1, .display-2, .display-3, .display-4, .display-5 {
        hyphens: auto;
        word-break: break-word;
    }
    .display-4, .display-5 {
        font-size: clamp(1.5rem, 5.5vw, 2.25rem);
    }
}

/* Garante que nenhuma imagem cause scroll horizontal */
img {
    max-width: 100%;
    height: auto;
}

/* Otimização de recursos */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Timeline e elementos do FAQ */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12px;
    width: 2px;
    background-color: rgba(0, 0, 0, 0.1);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 30px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    z-index: 1;
}

/* Estilos para ferramentas de segurança */
.security-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 575.98px) {
    .security-features {
        grid-template-columns: 1fr;
    }
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Estilos para o mapa */
.map-container {
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    height: 300px;
}

/* Ajustes para telas pequenas */
@media (max-width: 575.98px) {
    .feature-card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .benefits-card {
        padding: 1.25rem !important;
    }

    .pricing-card {
        margin-bottom: 1.5rem;
    }

    .social-links {
        justify-content: center !important;
    }
}

/* ============================================================
   Programa Fundador — seção de comunidade (Sprint 8)
   Usada enquanto não há base instalada pra mostrar stats.
   ============================================================ */
.founder-section {
    background: linear-gradient(180deg, #ffffff 0%, #F4F6F9 100%);
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
}

.founder-badge {
    background: rgba(0, 70, 190, 0.08);
    color: #0046BE;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 70, 190, 0.15);
}

.founder-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.founder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 70, 190, 0.12);
    border-color: rgba(0, 70, 190, 0.3);
}

.founder-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.founder-card-header i {
    font-size: 2rem;
    color: #0046BE;
    background: rgba(0, 70, 190, 0.08);
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.founder-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem 0;
    flex-grow: 1;
}

.founder-benefits li {
    display: flex;
    gap: 0.6rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1F2937;
}

.founder-benefits li i {
    color: #0046BE;
    font-size: 1rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .founder-card { padding: 1.5rem; }
    .founder-card-header { gap: 0.75rem; }
    .founder-card-header i { width: 44px; height: 44px; font-size: 1.5rem; }
}