@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700&family=Figtree:wght@400;500;600&display=swap");

/* ====================================================
   Centro Médico GD — paleta extraída do logotipo
   ==================================================== */
:root {
    --navy: #00375f;
    --navy-deep: #00243f;
    --green: #44cc00;
    --green-ink: #2a8500;
    --mint: #f0f8ea;
    --paper: #ffffff;
    --text: #33475a;
    --line: #d6e5da;
    --radius: 18px;
    --plus: polygon(33% 0, 67% 0, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0 67%, 0 33%, 33% 33%);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    font-family: "Figtree", sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--paper);
}
h1, h2, h3, h4, h5, h6 {
    font-family: "Bricolage Grotesque", "Figtree", sans-serif;
    color: var(--navy);
    line-height: 1.15;
}
a { color: var(--green-ink); }
a:hover { color: var(--navy); text-decoration: none; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
img { max-width: 100%; }

/* ---------- Loader ---------- */
#loading {
    position: fixed; inset: 0; z-index: 99999;
    background: #fff;
}
#loading::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 56px; height: 56px; margin: -28px 0 0 -28px;
    background: linear-gradient(135deg, var(--navy) 50%, var(--green) 50%);
    clip-path: var(--plus);
    animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse { from { transform: scale(.8); } to { transform: scale(1.1); } }

/* ---------- Botões ---------- */
.btn { border-radius: 999px !important; font-weight: 600; padding: .75rem 1.75rem; transition: background-color .25s, color .25s, transform .25s; }
.btn-green, .btn-light, .btn-primary {
    background: var(--green); border-color: var(--green); color: var(--navy-deep);
}
.btn-green:hover, .btn-light:hover, .btn-primary:hover {
    background: var(--navy); border-color: var(--navy); color: #fff; transform: translateY(-2px);
}
.btn-outline-light-gd { border: 2px solid #fff; color: #fff; background: transparent; }
.btn-outline-light-gd:hover { background: #fff; color: var(--navy); }

/* ---------- Barra superior ---------- */
#header_menu_top { background: var(--navy-deep); color: #cfe0ee; font-size: 14px; padding: 8px 0; }
#header_menu_top p { margin: 0; }
#header_menu_top i { color: var(--green); }
#header_menu_top a { color: #fff; font-weight: 600; }
#header_menu_top a:hover { color: var(--green); }
.topbar-texts { font-size: 14px !important; }

/* ---------- Navegação ---------- */
.navbar-wrap { position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid var(--line); }
#navbar_top { background: #fff !important; padding: 8px 0; }
#navbar_top .navbar-brand img { height: 58px; width: auto; }
#header .nav-link {
    font-weight: 600; font-size: 16px; color: var(--navy) !important;
    padding: 8px 14px !important; border-radius: 999px; position: relative;
    transition: background-color .25s, color .25s;
}
#header .nav-link:hover { background: var(--mint); color: var(--green-ink) !important; }
.nav-cta { margin-left: 16px; }
.nav-cta .btn { padding: .55rem 1.4rem; }
.navbar-toggler { border: 2px solid var(--navy); }

/* ---------- Hero ---------- */
#hero { position: relative; background: var(--navy); }
.headerSlider .slide {
    background-size: cover; background-position: center; position: relative;
    min-height: 74vh; display: flex; align-items: center;
}
.headerSlider .slide::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(95deg, rgba(0,36,63,.94) 0%, rgba(0,55,95,.82) 45%, rgba(0,55,95,.25) 100%);
}
.headerSlider .container { position: relative; z-index: 2; padding-top: 70px; padding-bottom: 130px; }
.headerSlider h1 { color: #fff; font-weight: 700; font-size: clamp(36px, 5.5vw, 68px); max-width: 15ch; }
.headerSlider h4 { color: var(--green); font-family: "Figtree", sans-serif; font-weight: 600; font-size: 22px; margin-top: 18px; }
.headerSlider p { color: #dbe8f2; max-width: 52ch; font-size: 18px; }
/* sequência de entrada: única animação automática da página */
.owl-item.active .slide h1, .owl-item.active .slide h4, .owl-item.active .slide p, .owl-item.active .slide .btn {
    animation: rise .8s cubic-bezier(.2,.7,.2,1) both;
}
.owl-item.active .slide h4 { animation-delay: .12s; }
.owl-item.active .slide p { animation-delay: .24s; }
.owl-item.active .slide .btn { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.headerSlider .owl-nav { display: none; }
.headerSlider .owl-dots { position: absolute; left: 0; right: 0; bottom: 100px; text-align: center; }
.headerSlider .owl-dot span { display: block; width: 28px; height: 4px; margin: 0 4px; background: rgba(255,255,255,.4); border-radius: 4px; transition: background .3s, width .3s; }
.headerSlider .owl-dot.active span { background: var(--green); width: 48px; }

/* Faixa de contactos sobreposta ao hero */
.quick-strip { position: relative; z-index: 5; margin-top: -64px; }
.quick-strip .strip {
    background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
    box-shadow: 0 20px 40px -24px rgba(0,36,63,.45);
    display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: center;
}
.strip-item { padding: 22px 26px; display: flex; gap: 14px; align-items: center; border-right: 1px solid var(--line); }
.strip-item i {
    width: 44px; height: 44px; flex: none; display: grid; place-items: center;
    background: var(--navy); color: var(--green); font-size: 18px; border-radius: 50%;
}
.strip-item small { display: block; color: #6d8294; font-size: 13px; line-height: 1.2; }
.strip-item strong { color: var(--navy); font-weight: 600; font-size: 15px; word-break: break-word; }
.strip-action { padding: 22px 26px; }

/* ---------- Secções ---------- */
.section { padding: 96px 0; overflow: hidden; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2, .section-head h3 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; text-transform: none; }
.section-head p, .section-head h6 { font-size: 18px; color: var(--text); font-weight: 400; margin-top: 14px; }
.flashmessage { color: var(--green-ink); font-size: 20px; font-weight: 600; margin-bottom: 24px; }

/* ---------- Marcar consulta ---------- */
#why_choose_us { background: var(--mint); padding: 96px 0; }
#why_choose_us h6 { color: var(--green-ink); font-weight: 600; font-size: 17px; text-transform: none; margin-bottom: 10px; }
#why_choose_us h4 { font-size: clamp(30px, 4vw, 46px); font-weight: 700; margin-bottom: 18px; }
#why_choose_us p { font-size: 18px; margin-bottom: 28px; max-width: 54ch; }
.plus-frame {
    position: relative; max-width: 480px; margin: 0 auto;
}
.plus-frame::before {
    content: ""; position: absolute; inset: 0; background: var(--navy); clip-path: var(--plus); transform: translate(14px, 14px);
}
.plus-frame img {
    position: relative; width: 100%; aspect-ratio: 1; object-fit: cover; clip-path: var(--plus); background: #fff;
}

/* ---------- Destaques (grelha alternada) ---------- */
#featured { background: var(--navy); color: #fff; overflow: hidden; }
#featured .row { margin: 0; }
#featured .row > [class*="col-"] { padding: 0; }
#featured .feat-img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; display: block; }
#featured .feat-text { padding: 64px clamp(28px, 6vw, 88px); max-width: 640px; }
#featured h6 { color: var(--green); font-size: 16px; font-weight: 600; text-transform: none; font-family: "Figtree", sans-serif; }
#featured h3 { color: #fff; font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; margin: 8px 0 16px; }
#featured p { color: #cfe0ee; font-size: 17px; }
#featured .featured_bottom .feat-text { margin-left: 0; }

/* ---------- Serviços ---------- */
#featured_services h3 { font-size: 22px; font-weight: 700; text-transform: none; margin: 20px 0 8px; }
#featured_services p { font-size: 16px; margin: 0; }
.service-item { height: 100%; }
.service-item .thumb { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--mint); }
.service-item .thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.service-item .thumb::after {
    content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 64px;
    background: var(--green); clip-path: var(--plus); transform: translate(-14px, 14px);
}
.service-item .body { border-top: 3px solid var(--green); margin-top: 22px; padding-top: 4px; }

/* ---------- Médicos ---------- */
#doctor { background: var(--mint); }
.doctor-item { text-align: left; }
.doctor-item .portrait {
    width: 100%; max-width: 260px; aspect-ratio: 4/5; background: var(--navy);
    border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; margin-bottom: 20px;
    border-bottom: 6px solid var(--green);
}
.doctor-item .portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
#doctor h4 { font-size: 22px; font-weight: 700; text-transform: none; margin-bottom: 6px; }
#doctor p { font-size: 16px; margin: 0; max-width: 34ch; }

/* ---------- Galeria ---------- */
#gallery { background: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery-grid a { display: block; overflow: hidden; border-radius: var(--radius); position: relative; background: var(--navy); }
.gallery-grid a:nth-child(5n+1) { grid-row: span 2; }
.gallery-grid img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; transition: transform .5s, opacity .3s; }
.gallery-grid a:hover img { transform: scale(1.08); opacity: .85; }
.gallery-grid a::after {
    content: "+"; position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px;
    display: grid; place-items: center; background: var(--green); color: var(--navy-deep);
    font-size: 26px; font-weight: 700; border-radius: 50%; opacity: 0; transform: scale(.6); transition: .3s;
}
.gallery-grid a:hover::after { opacity: 1; transform: none; }

/* ---------- Testemunhos ---------- */
#portfolio { background: var(--navy); padding: 96px 0; overflow: hidden; }
#portfolio .section-head h2 { color: #fff; }
.portfolio-testimonials { position: relative; }
.portfolio-testimonials .owl-dots { text-align: center; margin-top: 10px; }
.portfolio-testimonials .owl-dots span { display: block; width: 10px; height: 10px; margin: 0 5px; border-radius: 50%; background: transparent; border: 2px solid var(--green); }
.portfolio-testimonials .owl-dots .active span { background: var(--green); }
.portfolio-testimonials .owl-nav { display: none; }
.portfolio-testimonials .card {
    background: #fff; border: 0; border-radius: var(--radius); margin: 8px 10px; padding: 8px 14px;
    border-top: 5px solid var(--green); text-align: left; height: calc(100% - 16px);
}
.portfolio-testimonials .card .card-img-top {
    width: 72px; height: 72px; object-fit: cover; border-radius: 50%; margin: 20px 0 0 20px; border: 3px solid var(--mint);
}
.portfolio-testimonials .card h5 { color: var(--navy); font-size: 19px; font-weight: 700; margin: 0; }
.portfolio-testimonials .card h5 span { font-family: "Figtree", sans-serif; font-size: 14px; font-weight: 500; color: #6d8294; }
.portfolio-testimonials .card p { font-size: 16px; color: var(--text); padding-bottom: 12px; }
.portfolio-testimonials .owl-item { display: flex; }
.portfolio-testimonials .owl-item > div { width: 100%; }

/* ---------- Rodapé ---------- */
#footer { background: var(--navy-deep); color: #b9cde0; border-top: 6px solid var(--green); padding: 72px 0 0; }
#footer h6 { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
#footer p, #footer address, .footer-description { font-size: 15px !important; font-family: "Figtree", sans-serif !important; margin: 0; }
#footer address strong { font-weight: 500; display: block; margin-bottom: 8px; color: #dbe8f2; }
#footer .footer-logo { background: #fff; border-radius: var(--radius); padding: 14px 18px; max-width: 200px; }
.social-icon { display: flex; gap: 10px; }
.social-icon a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; transition: background-color .25s, color .25s; }
.social-icon a:hover { background: var(--green); color: var(--navy-deep); }
.footer-bottom { margin-top: 56px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; }

/* ---------- Modal de marcação ---------- */
#exampleModal .modal-content { border: 0; border-radius: var(--radius); overflow: hidden; background: #fff; color: var(--text); }
#exampleModal .modal-header { background: var(--navy) !important; color: #fff; border: 0; padding: 20px 28px; }
#exampleModal .modal-title { color: #fff; font-weight: 700; }
#exampleModal .close { color: #fff; opacity: 1; text-shadow: none; }
#exampleModal .modal-body { padding: 24px 28px 28px; }
#exampleModal label { font-weight: 600; color: var(--navy); margin: 14px 0 6px; font-size: 15px; }
#exampleModal .form-control { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; height: auto; }
#exampleModal .form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(68,204,0,.25); }
#exampleModal .pos_client_id .col-md-12, #exampleModal .pos_client_id .col-md-5, #exampleModal .pos_client_id .col-md-9 { padding: 0; max-width: 100%; flex: 0 0 100%; float: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ====================================================
   Serviços interativos
   ==================================================== */
.service-item {
    position: relative; cursor: pointer; padding: 14px; border-radius: calc(var(--radius) + 6px);
    background: #fff; border: 1px solid transparent; outline-offset: 4px;
    transition: transform .35s, box-shadow .35s, background-color .35s, border-color .35s, opacity .6s;
}
.service-item.reveal { opacity: 0; transform: translateY(26px); }
.service-item.reveal.in { opacity: 1; transform: none; }
.service-item .thumb img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.service-item .thumb::after { transition: transform .45s cubic-bezier(.3,1.4,.5,1), background-color .3s; }
.service-item .body { position: relative; border-top: 0; margin-top: 18px; padding-top: 14px; }
.service-item .body::before {
    content: ""; position: absolute; top: 0; left: 0; width: 56px; height: 3px; background: var(--green);
    transition: width .45s cubic-bezier(.2,.7,.2,1);
}
.service-item h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; transition: color .3s; }
.service-item .chev { font-size: 22px; color: var(--green-ink); transition: transform .35s, color .3s; }
.service-item p {
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .3s;
}

/* passar o rato / foco */
.service-item:hover, .service-item:focus-visible {
    transform: translateY(-8px); border-color: var(--line);
    box-shadow: 0 26px 40px -26px rgba(0, 36, 63, .5);
}
.service-item.reveal.in:hover { transform: translateY(-8px); }
.service-item:hover .thumb img { transform: scale(1.08); }
.service-item:hover .thumb::after { transform: translate(-14px, 14px) rotate(90deg) scale(1.15); }
.service-item:hover .body::before { width: 100%; }

/* clique: cartão aberto */
.service-item.is-open { background: var(--navy); border-color: var(--navy); box-shadow: 0 30px 46px -26px rgba(0, 36, 63, .7); }
.service-item.is-open h3 { color: #fff; }
.service-item.is-open p { color: #cfe0ee; -webkit-line-clamp: unset; line-clamp: unset; }
.service-item.is-open .chev { transform: rotate(180deg); color: var(--green); }
.service-item.is-open .body::before { width: 100%; }
.service-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s ease; }
.service-more > div { overflow: hidden; }
.service-item.is-open .service-more { grid-template-rows: 1fr; }
.service-cta {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 9px 20px; border-radius: 999px;
    background: var(--green); color: var(--navy-deep); font-weight: 600; transition: background-color .25s, color .25s, gap .25s;
}
.service-cta:hover { background: #fff; color: var(--navy); gap: 14px; }

/* médicos: cartão com resposta ao rato */
.doctor-item .portrait { transition: border-radius .5s, transform .4s; }
.doctor-item .portrait img { transition: transform .6s; }
.doctor-item:hover .portrait { border-radius: 40px 40px var(--radius) var(--radius); transform: translateY(-4px); }
.doctor-item:hover .portrait img { transform: scale(1.06); }