/* ==========================================================================
   Clínica Axis — Design System (site público)
   Paleta derivada da marca real (#BEABA4 taupe / #3C3C3B charcoal).
   Mesma convenção de tokens do admin (assets/styles/admin.css).
   ========================================================================== */
:root {
    --color-primary: #beaba4;
    --color-primary-hover: #a88f86;
    --color-primary-light: #f3ece9;
    --color-on-primary: #2b2b2b;

    --color-secondary: #3c3c3b;
    --color-secondary-hover: #545452;
    --color-on-secondary: #ffffff;

    --color-accent: #beaba4;

    --color-background: #ffffff;
    --color-surface: #ffffff;
    --color-surface-alt: #f7f5f4;

    --color-text: #2b2b2b;
    --color-text-muted: #6b6560;
    --color-border: #e4deda;

    --color-success: #2f9e63;
    --color-success-bg: #e8f6ee;
    --color-warning: #b8860b;
    --color-warning-bg: #fbf1de;
    --color-error: #c0392b;
    --color-error-bg: #fbe8e6;

    --font-display: 'Lexend', system-ui, -apple-system, sans-serif;
    --font-body: 'Source Sans 3', system-ui, -apple-system, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(43, 43, 43, .07);
    --shadow-md: 0 8px 24px rgba(43, 43, 43, .10);
    --shadow-lg: 0 20px 48px rgba(43, 43, 43, .14);

    --container-w: 1180px;
    --header-h: 76px;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-background);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .6em;
    color: var(--color-secondary);
    letter-spacing: -.01em;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p {
    margin: 0 0 1em;
}

.icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0;
}

:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 3px;
    border-radius: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: clamp(3rem, 2rem + 4vw, 6.5rem) 0;
}

.section-alt {
    background: var(--color-surface-alt);
}

.section-dark {
    background: var(--color-secondary);
    color: #fff;
}

.section-dark h2, .section-dark h3, .section-dark p {
    color: #fff;
}

.section-head {
    max-width: 640px;
    margin: 0 0 3rem;
}

.section-head.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-primary-hover);
    background: var(--color-primary-light);
    padding: .3rem .85rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.grid {
    display: grid;
    gap: 1.75rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.grid-contato {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
}

@media (max-width: 860px) {
    .grid-contato {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .85rem 1.6rem;
    min-height: 48px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .96rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .08s ease, box-shadow .18s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--color-secondary);
    color: var(--color-on-secondary);
    box-shadow: var(--shadow-sm);
}

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

.btn-accent {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

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

.btn-outline {
    background: transparent;
    color: var(--color-secondary);
    border-color: var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-secondary);
    background: var(--color-surface-alt);
}

.btn-ghost {
    background: transparent;
    color: inherit;
    padding: .5rem .25rem;
}

.btn-ghost:hover {
    color: var(--color-primary-hover);
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-h);
    display: flex;
    align-items: center;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-secondary);
}

.brand .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav ul {
    display: flex;
    gap: 1.9rem;
}

.main-nav a {
    font-weight: 600;
    font-size: .94rem;
    color: var(--color-text);
    padding: .4rem 0;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary-hover);
    border-color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-secondary);
}

.mobile-nav {
    display: none;
}

@media (max-width: 900px) {
    .main-nav > ul,
    .header-actions .btn {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .mobile-nav {
        display: block;
        position: fixed;
        inset: var(--header-h) 0 0 0;
        background: var(--color-background);
        z-index: 200;
        padding: 1.5rem;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease, transform .2s ease;
        overflow-y: auto;
    }

    .mobile-nav.is-open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .mobile-nav ul {
        display: flex;
        flex-direction: column;
        gap: .25rem;
    }

    .mobile-nav ul a {
        display: block;
        padding: 1rem .25rem;
        font-family: var(--font-display);
        font-weight: 600;
        font-size: 1.15rem;
        border-bottom: 1px solid var(--color-border);
        color: var(--color-secondary);
    }

    .mobile-nav .btn {
        margin-top: 1.5rem;
    }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    padding: clamp(3.5rem, 2.5rem + 5vw, 7rem) 0 clamp(3rem, 2rem + 3vw, 5rem);
    background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-background) 72%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 3rem;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .04em;
    color: var(--color-primary-hover);
    margin-bottom: 1.25rem;
}

.hero h1 {
    margin-bottom: 1.1rem;
}

.hero-lede {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 46ch;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-media {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4 / 5;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-media.contain {
    background: var(--color-surface-alt);
    padding: 2.5rem;
}

.hero-media.contain img {
    object-fit: contain;
}

/* Hero slideshow — crossfade between team photos, CSS-only */
.hero-slideshow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: heroSlideFade 16s infinite;
}

.hero-slideshow img:nth-child(1) { animation-delay: 0s; }
.hero-slideshow img:nth-child(2) { animation-delay: 4s; }
.hero-slideshow img:nth-child(3) { animation-delay: 8s; }
.hero-slideshow img:nth-child(4) { animation-delay: 12s; }

@keyframes heroSlideFade {
    0% { opacity: 0; }
    6% { opacity: 1; }
    25% { opacity: 1; }
    31% { opacity: 0; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slideshow img {
        animation: none;
        opacity: 0;
    }

    .hero-slideshow img:first-child {
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-media {
        aspect-ratio: 16 / 10;
        order: -1;
    }
}

/* ==========================================================================
   Lead form (Solicitar Ligação) — compact inline card
   ========================================================================== */
.lead-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    margin-top: -3.5rem;
    position: relative;
    z-index: 2;
}

.lead-card h3 {
    margin-bottom: .3rem;
}

.lead-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: end;
    margin-top: 1.25rem;
}

.lead-form .btn {
    grid-column: span 1;
}

@media (max-width: 900px) {
    .lead-card {
        margin-top: 2rem;
    }

    .lead-form {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Trust strip
   ========================================================================== */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: space-between;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .85rem;
    flex: 1 1 200px;
}

.trust-item .icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trust-item strong {
    display: block;
    font-family: var(--font-display);
    font-size: .98rem;
    color: var(--color-secondary);
}

.trust-item span {
    font-size: .86rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
}

a.card {
    display: block;
    color: inherit;
}

a.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

button.card {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--color-border);
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

button.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-body h3 {
    margin-bottom: .5rem;
}

/* Service card */
.service-card {
    padding: 2rem 1.75rem;
    text-align: left;
}

.service-card .icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.service-card .icon-wrap .icon {
    width: 26px;
    height: 26px;
}

.service-card p {
    color: var(--color-text-muted);
    font-size: .94rem;
    margin: 0;
}

/* Team card */
.team-card {
    text-align: center;
}

.team-card img {
    aspect-ratio: 1;
    object-fit: cover;
}

.team-card .card-body {
    text-align: left;
}

.team-card .name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-secondary);
    margin-bottom: .15rem;
}

.team-card .role {
    font-size: .87rem;
    color: var(--color-primary-hover);
    font-weight: 600;
    margin-bottom: .9rem;
}

.team-card ul {
    margin: 0 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.team-card li {
    font-size: .85rem;
    color: var(--color-text-muted);
    padding-left: 1.1rem;
    position: relative;
}

.team-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-primary);
}

.team-card .links {
    display: flex;
    gap: .6rem;
}

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
    background: var(--color-secondary);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: clamp(2rem, 1.5rem + 2vw, 3.5rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cta-band h2, .cta-band p {
    color: #fff;
    margin: 0;
}

.cta-band p {
    color: rgba(255, 255, 255, .78);
    margin-top: .5rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .86rem;
    margin-bottom: .4rem;
    color: var(--color-secondary);
}

.form-group label.required::after {
    content: ' *';
    color: var(--color-error);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .8rem .95rem;
    min-height: 48px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-group textarea {
    min-height: 130px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.form-group .form-error {
    color: var(--color-error);
    font-size: .82rem;
    margin-top: .4rem;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: 1.5rem;
    font-size: .94rem;
}

.alert-success {
    background: var(--color-success-bg);
    color: #1c6b41;
    border-color: #cdeadb;
}

.alert-danger,
.alert-error {
    background: var(--color-error-bg);
    color: #a53125;
    border-color: #f2c2bd;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--color-secondary);
    color: rgba(255, 255, 255, .72);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.footer-brand .brand {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-grid h4 {
    color: #fff;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 1.1rem;
}

.footer-grid ul {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.footer-grid a {
    transition: color .15s ease;
}

.footer-grid a:hover {
    color: #fff;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    font-size: .92rem;
}

.footer-social {
    display: flex;
    gap: .75rem;
    margin-top: 1.25rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}

.footer-social a:hover {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.footer-bottom {
    padding-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    font-size: .84rem;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Map
   ========================================================================== */
.map-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    height: 420px;
}

/* ==========================================================================
   Reveal on scroll (respects prefers-reduced-motion via JS gate)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   Responsive base
   ========================================================================== */
@media (max-width: 560px) {
    .container {
        padding: 0 1.15rem;
    }

    .btn {
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .cta-band {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .cta-band .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(20, 18, 17, .92);
    padding: 2rem;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-image {
    max-width: min(90vw, 1100px);
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, .24);
}

.lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-prev .icon {
    transform: scaleX(-1);
}

.lightbox-next {
    right: 1.5rem;
}

@media (max-width: 640px) {
    .lightbox {
        padding: 1rem;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 42px;
        height: 42px;
    }

    .lightbox-close {
        top: .75rem;
        right: .75rem;
    }

    .lightbox-prev {
        left: .5rem;
    }

    .lightbox-next {
        right: .5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        transition: none;
    }
}
