/* ============================================
   Clinica Familiar Rio Grande — Styles
   Palette: Forest Green + Off-White
   Fonts: Playfair Display + DM Sans
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green-900: #0d3b1a;
    --green-800: #145a28;
    --green-700: #1a5f2a;
    --green-600: #227a36;
    --green-500: #2d9244;
    --green-400: #4caf62;
    --green-100: #d1f2d8;
    --green-50:  #eaf8ee;
    --cream:     #f7f5f0;
    --cream-light:#faf9f6;
    --white:     #ffffff;
    --black:     #0f1a12;
    --gray-900:  #1a2332;
    --gray-800:  #2d3748;
    --gray-700:  #4a5568;
    --gray-600:  #64748b;
    --gray-400:  #94a3b8;
    --gray-200:  #e2e8f0;
    --gray-100:  #f1f5f9;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm:  0 1px 3px rgba(13,59,26,0.08), 0 1px 2px rgba(13,59,26,0.06);
    --shadow-md:  0 4px 16px rgba(13,59,26,0.10), 0 2px 4px rgba(13,59,26,0.06);
    --shadow-lg:  0 12px 40px rgba(13,59,26,0.14), 0 4px 12px rgba(13,59,26,0.08);
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--cream-light);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: var(--green-700);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--green-500); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.938rem;
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--green-700);
    color: var(--white);
    border-color: var(--green-700);
}
.btn-primary:hover {
    background: var(--green-800);
    border-color: var(--green-800);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-white {
    background: var(--white);
    color: var(--green-800);
    border-color: var(--white);
}
.btn-white:hover {
    background: var(--green-50);
    border-color: var(--green-100);
    color: var(--green-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost-light {
    background: rgba(255,255,255,0.12);
    color: var(--white);
    border-color: rgba(255,255,255,0.35);
    backdrop-filter: blur(4px);
}
.btn-ghost-light:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.6);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-ghost-dark {
    background: transparent;
    color: var(--green-700);
    border-color: var(--green-700);
}
.btn-ghost-dark:hover {
    background: var(--green-700);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-sm { padding: 9px 18px; font-size: 0.875rem; }
.btn-lg { padding: 17px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250,249,246,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(26,95,42,0.08);
    transition: box-shadow var(--transition);
}
.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--green-900);
}
.logo:hover { color: var(--green-700); }

.logo-mark {
    width: 40px;
    height: 40px;
    background: var(--green-700);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.logo-main {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--green-900);
}
.logo-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--green-600);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Nav */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}
.nav-menu a {
    padding: 8px 16px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.938rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-menu a:hover {
    color: var(--green-700);
    background: var(--green-50);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    position: relative;
}
.hamburger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hamburger::before,
.hamburger::after,
.hamburger span {
    display: block;
    height: 2px;
    background: var(--green-800);
    border-radius: 2px;
    transition: all var(--transition);
}
.hamburger::before { content: ''; }
.hamburger::after { content: ''; }
.hamburger span { display: none; }

.nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--green-900);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(13,59,26,0.92) 0%,
        rgba(20,90,40,0.82) 50%,
        rgba(13,59,26,0.88) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 140px 24px 100px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 100px;
    padding: 8px 18px;
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-bottom: 32px;
    backdrop-filter: blur(8px);
}
.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--green-400);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.hero-headline {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.12;
    max-width: 780px;
    margin-bottom: 24px;
}
.hero-headline em {
    font-style: italic;
    color: var(--green-300, #7dcea0);
}

.hero-subheadline {
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    color: rgba(255,255,255,0.78);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 64px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}
.stat {
    padding: 0 28px;
}
.stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white);
}
.stat-label {
    font-size: 0.813rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.2);
}

.hero-scroll {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.45);
    font-size: 0.688rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    animation: scroll-anim 2s ease-in-out infinite;
}
@keyframes scroll-anim {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Section shared ---------- */
.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green-600);
    background: var(--green-50);
    border: 1px solid var(--green-100);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    font-weight: 700;
    color: var(--green-900);
    line-height: 1.18;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--gray-600);
    max-width: 560px;
    line-height: 1.7;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}
.section-header .section-desc { margin: 0 auto; }

/* ---------- Services ---------- */
.services {
    padding: 100px 0;
    background: var(--cream-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 36px 28px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--green-700);
    transform: scaleX(0);
    transition: transform var(--transition);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-100);
}
.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 56px;
    height: 56px;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--green-700);
    transition: all var(--transition);
}
.service-card:hover .service-icon {
    background: var(--green-700);
    border-color: var(--green-700);
    color: var(--white);
}
.service-icon svg {
    width: 26px;
    height: 26px;
}

.service-card h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green-900);
    margin-bottom: 10px;
}

.service-card p {
    font-size: 0.938rem;
    color: var(--gray-600);
    line-height: 1.7;
}

/* ---------- About ---------- */
.about {
    padding: 100px 0;
    background: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-image-col {
    position: relative;
}
.about-img-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.about-img-main img {
    width: 100%;
    height: 480px;
    object-fit: cover;
}
.about-img-secondary {
    position: absolute;
    bottom: -32px;
    right: -24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--white);
}
.about-img-secondary img {
    width: 260px;
    height: 180px;
    object-fit: cover;
}

.about-content-col .section-tag { margin-bottom: 16px; }
.about-content-col .section-title { margin-bottom: 24px; }

.about-body {
    font-size: 1rem;
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin: 32px 0;
    list-style: none;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.938rem;
    font-weight: 500;
    color: var(--gray-800);
}
.feature-check {
    width: 22px;
    height: 22px;
    background: var(--green-100);
    color: var(--green-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------- Insurance Band ---------- */
.insurance-band {
    padding: 80px 0;
    background: var(--green-900);
}

.insurance-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.section-tag-light {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green-400);
    margin-bottom: 16px;
}

.section-title-light {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 12px;
}

.insurance-desc {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.65);
    max-width: 480px;
    line-height: 1.7;
}

/* ---------- Contact ---------- */
.contact {
    padding: 100px 0;
    background: var(--cream);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact-desc {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 40px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-detail {
    display: flex;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--green-700);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}
.contact-icon svg {
    width: 22px;
    height: 22px;
}

.contact-detail strong {
    display: block;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--green-700);
    margin-bottom: 4px;
    font-weight: 600;
}
.contact-detail p {
    font-size: 0.938rem;
    color: var(--gray-700);
    line-height: 1.6;
}
.contact-detail a {
    color: var(--gray-700);
}
.contact-detail a:hover {
    color: var(--green-700);
    text-decoration: underline;
}

/* Form */
.contact-form-col {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-700);
    margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.938rem;
    color: var(--gray-800);
    background: var(--cream-light);
    transition: all var(--transition);
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green-600);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(45,146,68,0.12);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-privacy {
    font-size: 0.813rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 16px;
}

.form-success {
    text-align: center;
    padding: 48px 24px;
}
.success-icon {
    width: 64px;
    height: 64px;
    background: var(--green-50);
    border: 2px solid var(--green-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--green-700);
}
.success-icon svg {
    width: 32px;
    height: 32px;
}
.form-success h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--green-900);
    margin-bottom: 8px;
}
.form-success p {
    color: var(--gray-600);
    font-size: 0.938rem;
}

/* ---------- Map ---------- */
.map-section {
    border-top: 4px solid var(--green-700);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--green-900);
    color: rgba(255,255,255,0.7);
    padding: 72px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 48px;
    padding-bottom: 56px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-footer .logo-mark {
    background: var(--green-600);
}
.logo-footer .logo-main { color: var(--white); }
.logo-footer .logo-sub { color: var(--green-400); }

.footer-brand p {
    margin-top: 16px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.55);
    max-width: 280px;
}

.footer-links,
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.footer-links strong,
.footer-contact strong {
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--white);
    font-weight: 600;
}

.footer-links ul,
.footer-contact ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a,
.footer-contact a {
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    transition: color var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-links a:hover,
.footer-contact a:hover {
    color: var(--green-400);
    text-decoration: none;
}
.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.55);
}
.footer-contact svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 0;
    font-size: 0.813rem;
    color: rgba(255,255,255,0.35);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-grid {
        gap: 48px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .nav-menu {
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        background: rgba(250,249,246,0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 24px 24px;
        gap: 4px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }
    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .nav-menu a {
        padding: 12px 16px;
        font-size: 1rem;
    }
    .nav-menu li:last-child {
        margin-top: 8px;
    }
    .nav-menu li:last-child a {
        text-align: center;
    }

    .hero-content {
        padding: 120px 24px 80px;
    }
    .hero-headline {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }
    .hero-stats {
        gap: 0;
    }
    .stat {
        padding: 0 16px;
    }
    .stat-divider {
        height: 28px;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-img-secondary {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 16px;
        border-width: 3px;
    }
    .about-img-main img {
        height: 320px;
    }
    .about-features {
        grid-template-columns: 1fr;
    }

    .insurance-inner {
        flex-direction: column;
        text-align: center;
        align-items: flex-start;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .contact-form-col {
        padding: 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .hero-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .stat-divider {
        width: 40px;
        height: 1px;
    }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .badge-dot { animation: none; }
    .scroll-line { animation: none; }
}
