:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --primary: #0f4c81;
    --on-primary: #ffffff;
    --cyan-med: #0284c7;
    --red-med: #dc2626;
    --blue-med: #1d4ed8;
    --text: #0f172a;
    --text-dim: #475569;
    --glass: rgba(15, 23, 42, 0.08);
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 85% 25%, rgba(220, 38, 38, 0.06) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='180' viewBox='0 0 640 180'%3E%3Cpath d='M0 95 H135 L162 95 L180 44 L202 142 L226 16 L248 152 L268 76 L286 95 H455 L474 95 L492 52 L512 132 L532 32 L552 138 L570 82 L588 95 H640' fill='none' stroke='%230284c7' stroke-opacity='0.20' stroke-width='2.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat, repeat-y;
    background-position: top center, top right, center top;
    background-size: 100% 600px, 100% 600px, 640px 220px;
    padding-bottom: 120px;
    overflow-x: hidden;
}

* { margin: 0; padding: 0; box-sizing: border-box; max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* HEADER */
.main-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass);
    position: sticky;
    top: 0;
    background: rgba(244, 247, 251, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
}
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.logo {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass);
    position: relative;
}
.logo-img { height: 50px; width: auto; object-fit: contain; }
.status-dot-header {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: var(--red-med);
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}
.btn-agendar-nav {
    background: var(--red-med);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* HERO */
.hero { padding: 4rem 0 2rem; text-align: center; }
.badge-clinica {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
}
.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan-med);
    animation: pulse 2s infinite;
}
h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2.2rem; line-height: 1.1; font-weight: 800; margin-bottom: 1.5rem; }
.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--cyan-med));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle { color: var(--text-dim); font-size: 1.1rem; max-width: 620px; margin: 0 auto 3rem; }

/* BOTÓN DEGRADADO */
.btn-hero-gradient {
    position: relative;
    padding: 3px;
    background: linear-gradient(90deg, var(--cyan-med), var(--blue-med), var(--red-med));
    border-radius: 1.2rem;
    border: none;
    cursor: pointer;
}
.btn-content {
    background: var(--primary);
    color: var(--on-primary);
    padding: 1.2rem 2.5rem;
    border-radius: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.btn-link-clean { text-decoration: none !important; display: inline-block; }

.scroll-indicator {
    margin-top: 4rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.mouse { width: 22px; height: 35px; border: 2px solid var(--text-dim); border-radius: 20px; position: relative; }
.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

/* SECCIONES */
.section-padding { padding: 4rem 0; scroll-margin-top: 80px; }
.tag-section { color: var(--primary); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.15em; margin-bottom: 1rem; }
.title-section { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2rem; margin-bottom: 3rem; text-align: center; }

/* ABORDAJE */
.grid-areas { display: grid; gap: 1.5rem; }
.card-abordaje {
    background: var(--surface);
    border-radius: 1rem;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--glass);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    transition: all 0.35s ease;
}
.card-abordaje:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.10);
}
.card-abordaje::before { content: ''; width: 6px; flex-shrink: 0; }
.border-cyan::before { background: var(--cyan-med); }
.border-red::before { background: var(--red-med); }
.border-blue::before { background: var(--blue-med); }
.card-info { padding: 1.5rem; }
.card-info p { color: var(--text-dim); line-height: 1.5; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.8rem; }
.mini-tag { font-size: 0.62rem; font-weight: 800; padding: 0.3rem 0.6rem; border-radius: 0.4rem; white-space: nowrap; }
.tag-cyan { color: #0369a1; background: rgba(2, 132, 199, 0.08); border: 1px solid rgba(2, 132, 199, 0.25); }
.tag-red { color: #b91c1c; background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.25); }
.tag-blue { color: #1e40af; background: rgba(29, 78, 216, 0.08); border: 1px solid rgba(29, 78, 216, 0.25); }

/* TRAYECTORIA */
.trayectoria-container { display: grid; gap: 2rem; text-align: center; }
.photo-frame {
    width: 100%;
    max-width: 400px;
    height: 400px;
    border-radius: 2rem;
    overflow: hidden;
    border: 2px solid var(--glass);
    background: var(--surface);
    margin: 0 auto;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.cred-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--glass);
    padding: 1.2rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    text-align: left;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.cred-item p { color: var(--text-dim); font-size: 0.92rem; margin-top: 0.2rem; }
.cred-icon {
    width: 45px;
    height: 45px;
    background: rgba(15, 76, 129, 0.10);
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* FAQ */
.faq-item {
    background: var(--surface);
    border: 1px solid var(--glass);
    border-radius: 1rem;
    margin-bottom: 1rem;
    padding: 1.2rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.faq-item summary { list-style: none; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; }
.faq-item summary::after { content: '↓'; color: var(--primary); }
.faq-item[open] summary { margin-bottom: 0.75rem; }
.faq-item p { color: var(--text-dim); line-height: 1.5; font-size: 0.95rem; }
.lista-estudios { list-style: none; padding-top: 0.5rem; width: 100%; }
.lista-estudios li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--glass);
    gap: 10px;
}
.lista-estudios li span { flex: 1; font-size: 0.9rem; line-height: 1.2; color: var(--text-dim); }
.lista-estudios li strong { color: var(--primary); font-size: 0.9rem; white-space: nowrap; flex-shrink: 0; }

/* UBICACIÓN */
.location-grid { display: flex; flex-direction: column; gap: 1.5rem; text-align: center; }
.location-box {
    padding: 2rem;
    border-radius: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--glass);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.loc-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.loc-item p { color: var(--text-dim); line-height: 1.5; }
.map-wrapper {
    width: 100%;
    height: 260px;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--glass);
    background: var(--surface);
}
.map-wrapper iframe { width: 100%; height: 100%; border: 0; }

/* FOOTER */
.main-footer {
    padding: 5rem 0 180px;
    background: #e9eff6;
    border-top: 1px solid var(--glass);
    text-align: center;
}
.logo-capsule-footer {
    background: #ffffff;
    padding: 12px 24px;
    border-radius: 15px;
    border: 1px solid var(--glass);
    display: inline-block;
    margin-bottom: 1.5rem;
}
.footer-img { height: 80px; width: auto; }
.footer-slogan { color: var(--primary); font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.footer-legal { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 1.5rem; }
.social-link { color: var(--text); text-decoration: none; font-weight: 600; }
.footer-credits {
    margin-top: 2rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    border-top: 1px solid var(--glass);
    padding-top: 1.5rem;
}

/* ASISTENTE / CONTACTO DIRECTO */
.asistente-pill {
    position: fixed;
    bottom: 95px;
    right: 20px;
    background: #0f172a;
    border: 1px solid var(--cyan-med);
    padding: 0.65rem 1.15rem;
    border-radius: 4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2500;
    text-decoration: none !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}
.asistente-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--cyan-med);
    background: rgba(2, 132, 199, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #0f172a;
}
.asistente-text strong { font-size: 0.84rem; color: #ffffff; line-height: 1.25; }

/* TAB BAR */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--glass);
    z-index: 3000;
}
.tab-link {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.tab-link.active { color: var(--primary); font-weight: 600; }

/* LAPTOP VIEW */
@media (min-width: 1024px) {
    h1 { font-size: 4rem; }
    .grid-areas { grid-template-columns: repeat(3, 1fr); }
    .trayectoria-container { grid-template-columns: 1fr 1.5fr; align-items: center; gap: 4rem; text-align: left; }
    .trayectoria-photo { order: 1; }
    .trayectoria-text { order: 2; }
    .location-grid { flex-direction: row-reverse; text-align: left; }
    .loc-item { align-items: flex-start; }
    .map-wrapper { flex: 1.5; height: 400px; }
    .location-box { flex: 1; }
    .footer-content { text-align: center; }
}

@keyframes scroll { 0% { opacity: 1; top: 6px; } 100% { opacity: 0; top: 20px; } }
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.55); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(2, 132, 199, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

/* MODAL DE SOLICITUD */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 4000;
}
.modal-backdrop.activo { display: flex; }

.modal-card {
    width: 100%;
    max-width: 490px;
    background: var(--surface);
    color: var(--text);
    border-radius: 1.5rem;
    border: 1px solid var(--glass);
    padding: 1.75rem;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
    max-height: 92vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.9rem;
}
.modal-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--cyan-med);
    margin-bottom: 0.25rem;
}
.modal-header h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
}
.btn-cerrar-modal {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--glass);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    flex-shrink: 0;
}

.aviso-solicitud {
    background: rgba(2, 132, 199, 0.08);
    border-left: 4px solid var(--cyan-med);
    padding: 0.75rem 0.9rem;
    border-radius: 0.65rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 0.9rem;
}

.aviso-dia-error {
    display: none;
    background: rgba(220, 38, 38, 0.09);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: #991b1b;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 0.9rem;
}
.aviso-dia-error.visible { display: block; }

.form-agenda { display: flex; flex-direction: column; gap: 0.95rem; }
.fila-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.campo-grupo { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; }
.campo-grupo label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.campo-grupo input,
.campo-grupo select,
.campo-grupo textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
}
.campo-grupo input:focus,
.campo-grupo select:focus,
.campo-grupo textarea:focus {
    outline: 2px solid var(--cyan-med);
    border-color: var(--cyan-med);
}

.btn-confirmar-cita {
    margin-top: 0.25rem;
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: none;
    border-radius: 0.9rem;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-confirmar-cita:hover { opacity: 0.95; }

@media (max-width: 520px) {
    .fila-dos { grid-template-columns: 1fr; }
}