/* ============================================
   Mi Salud Clínica Familiar — Stylesheet
   ============================================ */

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: #1a2e2a;
    background: #FDF8F0;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

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

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; line-height: 1.2; color: #0f2924; }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 50px; font-size: .938rem;
    font-weight: 600; border: 2px solid transparent; cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1); text-align: center;
}
.btn:focus-visible { outline: 3px solid #059669; outline-offset: 2px; }

.btn-primary {
    background: #059669; color: #fff; border-color: #059669;
    box-shadow: 0 4px 14px rgba(5,150,105,.3);
}
.btn-primary:hover {
    background: #047857; border-color: #047857;
    box-shadow: 0 6px 20px rgba(5,150,105,.4); transform: translateY(-2px);
}

.btn-ghost {
    background: rgba(255,255,255,.15); color: #059669; border-color: #059669;
    backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: #059669; color: #fff; transform: translateY(-2px); }

.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---------- SECTION HELPERS ---------- */
.section-tag {
    display: inline-block; font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em; color: #059669;
    background: rgba(5,150,105,.08); padding: 6px 16px; border-radius: 50px;
    margin-bottom: 16px;
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 16px;
}
.section-desc { font-size: 1.05rem; color: #4a6359; max-width: 600px; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .section-desc { margin: 0 auto; }

/* ---------- HEADER ---------- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(253,248,240,.85); backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(5,150,105,.08);
    transition: box-shadow .3s ease;
}
.site-header.scrolled { box-shadow: 0 2px 20px rgba(5,150,105,.1); }

.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 32px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-text { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.2rem; color: #0f2924; }

.nav-links { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.nav-links a:not(.btn) { font-size: .9rem; font-weight: 500; color: #2d4a3e; transition: color .2s; }
.nav-links a:not(.btn):hover { color: #059669; }

/* ---------- MOBILE TOGGLE ---------- */
.mobile-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px; margin-left: auto;
}
.mobile-toggle span {
    display: block; width: 24px; height: 2px; background: #0f2924;
    border-radius: 2px; transition: all .3s ease;
}
.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- MOBILE NAV ---------- */
.mobile-nav {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(253,248,240,.97); backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.mobile-nav-link {
    font-size: 1.35rem; font-weight: 600; color: #0f2924;
    font-family: 'Playfair Display', serif; transition: color .2s;
}
.mobile-nav-link:hover { color: #059669; }
.mobile-nav-cta { margin-top: 8px; }

/* ---------- HERO ---------- */
.hero {
    position: relative; min-height: 100vh; display: flex;
    align-items: center; justify-content: center; text-align: center;
    padding: 120px 24px 80px; overflow: hidden;
}
.hero-gradient {
    position: absolute; inset: 0; z-index: 0;
    background: linear-gradient(
        160deg,
        #FDF8F0 0%,
        #E8F5E9 25%,
        #C8E6C9 50%,
        #A5D6A7 70%,
        #81C784 85%,
        #059669 100%
    );
}
.hero-pattern {
    position: absolute; inset: 0; z-index: 1; opacity: .06;
    background-image: radial-gradient(circle at 25% 25%, #059669 1px, transparent 1px),
                      radial-gradient(circle at 75% 75%, #059669 1px, transparent 1px);
    background-size: 48px 48px, 32px 32px;
}
.hero-content { position: relative; z-index: 2; max-width: 780px; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.7); backdrop-filter: blur(8px);
    border: 1px solid rgba(5,150,105,.2); border-radius: 50px;
    padding: 8px 20px; font-size: .85rem; font-weight: 600;
    color: #059669; margin-bottom: 32px;
    animation: fadeDown .8s ease both;
}
.hero-badge svg { flex-shrink: 0; }

.hero-headline {
    font-size: clamp(2.25rem, 6vw, 4rem);
    font-weight: 700; color: #0f2924;
    margin-bottom: 24px; line-height: 1.1;
    animation: fadeDown .8s .1s ease both;
}
.accent-italic {
    font-style: italic; font-weight: 400;
    background: linear-gradient(135deg, #059669, #34d399);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem); color: #2d4a3e;
    max-width: 580px; margin: 0 auto 40px; line-height: 1.7;
    animation: fadeDown .8s .2s ease both;
}
.hero-actions {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 56px; animation: fadeDown .8s .3s ease both;
}
.hero-stats {
    display: flex; justify-content: center; gap: 0;
    animation: fadeDown .8s .4s ease both;
}
.stat {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 0 32px;
}
.stat-num { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: #0f2924; }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #4a6359; font-weight: 600; }
.stat-divider { width: 1px; height: 40px; background: rgba(5,150,105,.2); align-self: center; }

/* ---------- SERVICES ---------- */
.services { padding: 100px 0; background: #FDF8F0; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.service-card {
    background: #fff; border-radius: 20px; padding: 40px 32px;
    border: 1px solid rgba(5,150,105,.08);
    transition: all .35s cubic-bezier(.4,0,.2,1);
    position: relative; overflow: hidden;
}
.service-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #059669, #34d399);
    transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(5,150,105,.1); border-color: rgba(5,150,105,.15); }
.service-card:hover::before { transform: scaleX(1); }

.service-icon {
    width: 60px; height: 60px; border-radius: 16px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    display: flex; align-items: center; justify-content: center;
    color: #059669; margin-bottom: 24px;
    transition: transform .3s ease;
}
.service-card:hover .service-icon { transform: scale(1.1) rotate(-5deg); }

.service-card h3 { font-size: 1.25rem; margin-bottom: 12px; color: #0f2924; }
.service-card p { font-size: .95rem; color: #4a6359; line-height: 1.7; }

/* ---------- ABOUT ---------- */
.about { padding: 100px 0; background: linear-gradient(180deg, #F4F7F0 0%, #FDF8F0 100%); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }

.about-images { position: relative; }
.about-img-main {
    border-radius: 24px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(5,150,105,.15);
}
.about-img-main img { width: 100%; height: 100%; object-fit: cover; }
.about-img-float {
    position: absolute; bottom: -40px; right: -40px;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 16px 40px rgba(5,150,105,.2);
    border: 6px solid #FDF8F0;
}
.about-img-float img { width: 100%; height: 100%; object-fit: cover; }
.about-accent {
    position: absolute; top: -20px; right: 40px; z-index: -1;
    opacity: .3; animation: spin 20s linear infinite;
}
.about-content { max-width: 520px; }
.about-body { font-size: 1.05rem; color: #4a6359; margin-bottom: 20px; line-height: 1.8; }
.about-body em { color: #059669; font-style: italic; }

.about-list { list-style: none; display: grid; gap: 14px; margin-top: 32px; }
.about-list li {
    display: flex; align-items: center; gap: 14px;
    font-size: 1rem; font-weight: 500; color: #0f2924;
}
.about-list svg { flex-shrink: 0; }

/* ---------- INSURANCE ---------- */
.insurance { padding: 100px 0; background: #FDF8F0; }
.insurance-inner {
    background: linear-gradient(135deg, #059669, #047857, #065F46);
    border-radius: 32px; padding: 72px 64px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
    align-items: center; overflow: hidden; position: relative;
}
.insurance-inner::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 60%);
}
.insurance-text { position: relative; z-index: 1; }
.insurance-text .section-tag { background: rgba(255,255,255,.15); color: #a7f3d0; }
.insurance-text .section-title { color: #fff; margin-bottom: 20px; }
.insurance-text p { color: #d1fae5; font-size: 1.05rem; margin-bottom: 32px; line-height: 1.7; }
.insurance-text .btn-primary { background: #fff; color: #059669; border-color: #fff; }
.insurance-text .btn-primary:hover { background: #f0fdf4; transform: translateY(-2px); }

.insurance-cards { position: relative; z-index: 1; display: grid; gap: 16px; }
.ins-card {
    display: flex; align-items: center; gap: 16px;
    background: rgba(255,255,255,.1); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15); border-radius: 16px;
    padding: 20px 24px; color: #fff; font-weight: 600; font-size: 1rem;
    transition: all .3s ease;
}
.ins-card:hover { background: rgba(255,255,255,.18); transform: translateX(6px); }
.ins-card svg { flex-shrink: 0; }

/* ---------- CONTACT ---------- */
.contact { padding: 100px 0; background: linear-gradient(180deg, #FDF8F0 0%, #E8F5E9 100%); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

.contact-intro { font-size: 1.05rem; color: #4a6359; margin-bottom: 40px; line-height: 1.7; }
.contact-details { display: grid; gap: 24px; margin-bottom: 32px; }
.contact-row { display: flex; gap: 16px; align-items: flex-start; }
.contact-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    background: rgba(5,150,105,.08); display: flex;
    align-items: center; justify-content: center;
}
.contact-row strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #059669; margin-bottom: 4px; }
.contact-row span, .contact-row a { font-size: .95rem; color: #2d4a3e; }
.contact-row a:hover { color: #059669; text-decoration: underline; }

.contact-map { border-radius: 20px; overflow: hidden; box-shadow: 0 8px 30px rgba(5,150,105,.1); }

/* ---------- FORM ---------- */
.contact-form-wrap {
    background: #fff; border-radius: 24px; padding: 48px;
    box-shadow: 0 16px 50px rgba(5,150,105,.08);
    border: 1px solid rgba(5,150,105,.08);
}
.form-title { font-size: 1.5rem; margin-bottom: 32px; color: #0f2924; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: .85rem; font-weight: 600;
    color: #2d4a3e; margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 14px 18px; border-radius: 12px;
    border: 1.5px solid #d1fae5; background: #f0fdf4;
    font-family: 'Inter', sans-serif; font-size: .95rem; color: #0f2924;
    transition: all .2s ease; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #059669; background: #fff;
    box-shadow: 0 0 0 4px rgba(5,150,105,.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #94a3b8; }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
}
.form-privacy { font-size: .8rem; color: #94a3b8; text-align: center; margin-top: 16px; }

/* Success state */
.form-success { text-align: center; padding: 40px 20px; }
.success-icon { margin: 0 auto 20px; width: 80px; height: 80px; border-radius: 50%; background: #E8F5E9; display: flex; align-items: center; justify-content: center; }
.form-success h4 { font-size: 1.5rem; margin-bottom: 12px; color: #0f2924; }
.form-success p { color: #4a6359; margin-bottom: 24px; }

/* ---------- FOOTER ---------- */
.footer { background: #0f2924; color: #a7f3d0; padding: 72px 0 0; }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 48px;
    padding-bottom: 56px; border-bottom: 1px solid rgba(167,243,208,.1);
}
.footer-brand p { margin-top: 16px; font-size: .9rem; line-height: 1.7; color: #6ee7b7; opacity: .7; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #34d399; margin-bottom: 4px; }
.footer-links a, .footer-links span { font-size: .9rem; color: #a7f3d0; opacity: .7; transition: opacity .2s; }
.footer-links a:hover { opacity: 1; color: #fff; text-decoration: none; }
.footer-bottom { padding: 24px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .85rem; opacity: .5; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Scroll-triggered reveal */
.reveal { opacity: 0; transform: translateY(32px); transition: all .7s cubic-bezier(.4,0,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .about-grid { gap: 48px; }
    .insurance-inner { padding: 48px 40px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-toggle { display: flex; }

    .hero { padding: 100px 20px 60px; min-height: auto; padding-top: 120px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-stats { gap: 16px; }
    .stat { padding: 0 16px; }

    .services { padding: 64px 0; }
    .services-grid { grid-template-columns: 1fr; }

    .about { padding: 64px 0; }
    .about-grid { grid-template-columns: 1fr; gap: 56px; }
    .about-img-float { right: -16px; bottom: -24px; }

    .insurance { padding: 64px 0; }
    .insurance-inner { grid-template-columns: 1fr; padding: 40px 28px; gap: 40px; border-radius: 24px; }

    .contact { padding: 64px 0; }
    .contact-grid { grid-template-columns: 1fr; gap: 48px; }
    .contact-form-wrap { padding: 32px 24px; }
    .form-row { grid-template-columns: 1fr; }

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

@media (max-width: 480px) {
    .hero-headline { font-size: 2rem; }
    .hero-badge { font-size: .78rem; }
    .section-title { font-size: 1.6rem; }
    .service-card { padding: 28px 24px; }
}
