/* =========================================
           GLOBAL & VARIABLES (Design System)
           ========================================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: #E6E3D6;
    /* Warm Beige da Paleta */
    color: #1c1917;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Textura Noise Global Removida para Performance */

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #b89d70, #c4ad82, #b89d70);
    z-index: 9998;
    transform-origin: left;
    transform: scaleX(0);
    will-change: transform;
    box-shadow: 0 0 10px rgba(184, 157, 112, 0.5);
}

/* Tipografia de Títulos */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* =========================================
           GLASS EFFECT & GLOW
           ========================================= */
.glass-effect {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px 0 rgba(28, 25, 23, 0.05);
    transform: translateZ(0);
}

.glass-dark {
    background: rgba(28, 25, 23, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.25);
    transform: translateZ(0);
}

.glow-pulse {
    box-shadow: 0 0 10px rgba(184, 157, 112, 0.2);
}

/* =========================================
           BACKGROUND ELEMENTS
           ========================================= */
.bg-mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 0.6;
    pointer-events: none;
}

/* Otimização de Performance (Lazy Rendering) */

/* Reduzir repaints de animações de orb */
.ambient-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translateZ(0);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.3;
    transform: translateZ(0);
}

.blob-1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #EAE8DE 0%, rgba(234, 232, 222, 0) 50%);
    top: -10vw;
    left: -10vw;
}

.blob-2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #d2d0c2 0%, rgba(210, 208, 194, 0) 50%);
    bottom: -20vw;
    right: -10vw;
}

.blob-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(184, 157, 112, 0.1) 0%, rgba(184, 157, 112, 0) 50%);
    top: 20%;
    right: 15%;
}

/* =========================================
           BUTTONS & INTERACTIONS
           ========================================= */
.btn-premium {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-premium::after {
    display: none;
}

.btn-premium:hover::after {
    display: none;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(28, 25, 23, 0.2);
}

.btn-secondary {
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(28, 25, 23, 0.05);
    transform: translateY(-2px);
}

/* =========================================
           UTILITIES & HELPERS
           ========================================= */
.hw-accel,
.gs-parallax-img,
.gs-float-card,
.gs-float-card-alt,
.gs-float-slow {
    transform: translateZ(0);
}

.invisible-start {
    opacity: 1;
    visibility: visible;
}

.text-gradient {
    background: linear-gradient(135deg, #1c1917 0%, #57534e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mascara suave para a imagem principal */
.img-mask {
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* Hero Image — Mouse Tilt 3D Effect */
.gs-main-img-wrapper {
    will-change: transform;
    transform-style: preserve-3d;
    box-shadow:
        0 0 40px 10px rgba(230, 227, 214, 0.6),
        0 0 80px 20px rgba(230, 227, 214, 0.3),
        0 20px 60px -15px rgba(28, 25, 23, 0.15);
}

/* Bordas que se dissolvem suavemente no fundo — efeito infinito */
.hero-edge-fade {
    background:
        /* Topo — dissolve suavemente */
        linear-gradient(to bottom, rgba(230, 227, 214, 0.5) 0%, rgba(230, 227, 214, 0.15) 4%, transparent 10%),
        /* Base — fade sutil para profundidade */
        linear-gradient(to top, rgba(230, 227, 214, 0.6) 0%, rgba(230, 227, 214, 0.2) 5%, transparent 14%),
        /* Esquerda */
        linear-gradient(to right, rgba(230, 227, 214, 0.4) 0%, rgba(230, 227, 214, 0.1) 2%, transparent 7%),
        /* Direita */
        linear-gradient(to left, rgba(230, 227, 214, 0.4) 0%, rgba(230, 227, 214, 0.1) 2%, transparent 7%);
    border-radius: inherit;
}

.hero-mouse-glow {
    mix-blend-mode: soft-light;
}

/* =========================================
           TEAM CARDS — Selection & Animations
           ========================================= */
.team-card {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card__inner {
    border: 2px solid transparent;
}

/* Card NÃO selecionado */
.team-card:not(.is-selected) .team-card__inner {
    opacity: 0.85;
    border-color: rgba(28, 25, 23, 0.06);
}

.team-card:not(.is-selected):hover .team-card__inner {
    opacity: 1;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -8px rgba(28, 25, 23, 0.12);
}

.team-card:not(.is-selected) .team-card__badge,
.team-card:not(.is-selected) .team-card__star {
    opacity: 0;
    transform: scale(0.8);
}

/* Card SELECIONADO — cor primária laranja/dourada */
.team-card.is-selected {
    z-index: 10;
}

.team-card.is-selected .team-card__inner {
    opacity: 1;
    border-color: #b89d70;
    box-shadow: 0 20px 50px -12px rgba(184, 157, 112, 0.4), 0 8px 20px -4px rgba(184, 157, 112, 0.2);
    transform: translateY(-8px);
}

.team-card.is-selected .team-card__badge,
.team-card.is-selected .team-card__star {
    opacity: 1;
    transform: scale(1);
}

.team-card.is-selected .team-card__info {
    background: linear-gradient(135deg, #b89d70 0%, #c4ad82 100%);
    border-top: none;
}

.team-card.is-selected .team-card__info h4 {
    color: #fff;
}

.team-card.is-selected .team-card__info .team-card__role-text {
    color: rgba(255, 255, 255, 0.9);
}

.team-card.is-selected .team-card__info .team-card__crm {
    color: rgba(255, 255, 255, 0.65);
}

/* Shine effect on selected */
.team-card.is-selected .team-card__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    z-index: 30;
    transform: translateX(-100%);
    animation: shine-sweep 2s ease-in-out 0.3s;
    pointer-events: none;
}

@keyframes shine-sweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}



/* Título Corpo Clínico shimmer (REMOVIDO P/ PERFORMANCE) */
.shimmer-title {
    background: linear-gradient(135deg, #1c1917 0%, #b89d70 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================================
           EXAM CARDS (Efeito Lava)
           ========================================= */
.ds-card {
    border-radius: 1.5rem;
    overflow: hidden;
    background: #1c1917;
    color: #E6E3D6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.ds-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.ds-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.ds-card:hover .ds-card__image {
    transform: scale(1.03);
    opacity: 0.3;
}

.ds-card__content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to top, rgba(28, 25, 23, 0.95) 0%, rgba(28, 25, 23, 0.1) 60%, transparent 100%);
}

.ds-card__icon-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #D4F268;
    color: #1c1917;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    transform: rotate(0deg);
}

.ds-card:hover .ds-card__icon-btn {
    transform: rotate(45deg) scale(1.1);
    background: #C3E354;
    box-shadow: 0 0 15px rgba(212, 242, 104, 0.3);
}


/* =========================================
           SCROLLBAR GLOBAL (Static for Performance)
           ========================================= */
html {
    scrollbar-width: thin;
    scrollbar-color: #c4b99a #E6E3D6;
}

html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: #E6E3D6;
}

html::-webkit-scrollbar-thumb {
    background: #c4b99a;
    border-radius: 10px;
    border: 2px solid #E6E3D6;
}

html::-webkit-scrollbar-thumb:hover {
    background: #b89d70;
}

/* Scrollbar Dark Mode (Transição Removida - Renderização Otimizada) */
html.scrollbar-dark {
    scrollbar-color: #57534e #1c1917;
}

html.scrollbar-dark::-webkit-scrollbar-track {
    background: #1c1917;
}

html.scrollbar-dark::-webkit-scrollbar-thumb {
    background: #57534e;
    border-color: #1c1917;
}

html.scrollbar-dark::-webkit-scrollbar-thumb:hover {
    background: #b89d70;
}

/* =========================================
           SCROLLBAR MODAL
           ========================================= */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f5f5f4;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d6d3d1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a29e;
}

/* Transição suave claro → escuro (imperceptível) */
.section-fade-out {
    position: relative;
}

.section-fade-out::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: linear-gradient(to bottom, rgba(28, 25, 23, 0), rgba(28, 25, 23, 1));
    pointer-events: none;
    z-index: 20;
    transform: translateZ(0);
}

/* =========================================
           AMBIENT BACKGROUND (Static for Performance)
           ========================================= */
.ambient-orb--1,
.ambient-orb--2,
.ambient-orb--3,
.ambient-orb--pulse,
.ambient-grid-shift {
    /* Animações contínuas desativadas para garantir a fluidez da GPU na transição de blocos */
    will-change: auto;
}

/* =========================================
           MARQUEE ANIMATION (Convênios)
           ========================================= */
@keyframes marquee {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.animate-marquee {
    animation: marquee 40s linear infinite;
}

.marquee-container {
    display: flex;
    width: max-content;
}

/* Navbar Dark Mode (quando sobre seções escuras) */
#main-nav.nav-dark {
    background: linear-gradient(to right, rgba(28, 25, 23, 0.85), rgba(28, 25, 23, 0.65)) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.3) !important;
}

#main-nav.nav-dark .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

#main-nav.nav-dark .nav-link:hover {
    color: #b89d70 !important;
}

#main-nav.nav-dark .nav-logo {
    filter: brightness(10) !important;
}

#main-nav.nav-dark a:not(.btn-premium) iconify-icon {
    color: #b89d70 !important;
}

/* Section Divider — gradiente suave */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 157, 112, 0.3), transparent);
    border: none;
    margin: 0;
}

/* Micro-animações — Hover glow em ícones */
.icon-glow {
    transition: all 0.3s ease;
}

.icon-glow:hover {
    filter: brightness(1.2);
}

/* Gradient border hover para cards */
.card-hover-glow {
    position: relative;
    transition: all 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 15px rgba(184, 157, 112, 0.1);
}

/* Smooth reveal para texto */
@keyframes text-reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(4px);
    }

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

/* Link underline animação elegante */
.link-fancy {
    position: relative;
}

.link-fancy::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #b89d70;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-fancy:hover::after {
    width: 100%;
}

/* =========================================
           PERFORMANCE — Section Containment
           ========================================= */
.section-optimized {
    contain: layout style;
}

/* =========================================
           LIGHTHOUSE PERFORMANCE FIXES
           ========================================= */
@media (max-width: 768px) {

    .bg-mesh,
    .ambient-orb {
        display: none !important;
    }

    .glass-effect,
    .glass-dark {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .animate-marquee {
        animation: none !important;
    }

    .marquee-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .shimmer-title,
    .shimmer {
        animation: none !important;
        background-clip: text;
        -webkit-text-fill-color: #b89d70;
    }

    /* Hero Edge Fade — mais suave em mobile */
    .hero-edge-fade {
        background:
            linear-gradient(to bottom, rgba(230, 227, 214, 0.3) 0%, transparent 8%),
            linear-gradient(to top, rgba(230, 227, 214, 0.4) 0%, transparent 10%),
            linear-gradient(to right, rgba(230, 227, 214, 0.2) 0%, transparent 5%),
            linear-gradient(to left, rgba(230, 227, 214, 0.2) 0%, transparent 5%);
    }

    /* Wrapper suave em mobile — sombra mais leve */
    .gs-main-img-wrapper {
        box-shadow:
            0 0 20px 5px rgba(230, 227, 214, 0.4),
            0 10px 30px -10px rgba(28, 25, 23, 0.1) !important;
        border-radius: 2rem !important;
    }

    /* Team card info min-height menor em mobile */
    .team-card__info {
        min-height: 130px !important;
    }

    /* Floating cards mais compactos em mobile */
    .gs-float-card,
    .gs-float-card-alt {
        transform: scale(0.85) !important;
    }

    /* Tabs/badges em mobile: quebrar em multi-linha melhor */
    .gs-team-header .flex-wrap {
        gap: 0.375rem !important;
    }

    /* Section padding mais compacto */
    #about,
    #team {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Contato: grid empilhado com menos padding */
    .gs-contact-info {
        gap: 0.75rem !important;
    }

    /* PACS section padding */
    .gs-team-carousel-container {
        padding-left: 0;
        padding-right: 0;
    }
}

/* =========================================
           SMALL MOBILE (< 400px)
           ========================================= */
@media (max-width: 400px) {
    .gs-main-img-wrapper {
        border-radius: 1.5rem !important;
    }

    .team-card {
        width: 200px !important;
    }

    .team-card__info {
        min-height: 120px !important;
        padding: 1rem !important;
    }

    .team-card__info h4 {
        font-size: 0.875rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}