/* ============================================================
   SMP CVITAPIA — v3 "Bento moderno"
   Paleta:
     --fondo:    #F5F7FB  (blanco azulado, mucho aire)
     --tinta:    #101D33  (azul muy oscuro para textos)
     --azul:     #2B4C7E  (azul corporativo)
     --azul-viv: #3D6FB8  (azul vivo para degradados)
     --amarillo: #FFC107  (amarillo corporativo)
     --blanco:   #FFFFFF
   Tipografías:
     Titulares: Sora
     Texto:     Plus Jakarta Sans
   ============================================================ */

:root {
    --fondo: #f5f7fb;
    --tinta: #101d33;
    --azul: #2b4c7e;
    --azul-viv: #3d6fb8;
    --amarillo: #ffc107;
    --blanco: #ffffff;
    --gris-texto: #4d5b73;
    --radio: 24px;
    --sombra: 0 8px 30px rgba(16, 29, 51, 0.08);
    --sombra-alta: 0 18px 44px rgba(16, 29, 51, 0.14);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    background-color: var(--fondo);
    color: var(--tinta);
}

/* ============================================================
   TIPOGRAFÍA Y CHIPS
   ============================================================ */
.titulo-hero {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--tinta);
}

.palabra-marcada {
    position: relative;
    white-space: nowrap;
}
.palabra-marcada::after {
    content: "";
    position: absolute;
    left: -2%;
    bottom: 0.05em;
    width: 104%;
    height: 0.38em;
    background: var(--amarillo);
    border-radius: 6px;
    z-index: -1;
}

.titulo-seccion {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    letter-spacing: -0.015em;
    color: var(--tinta);
}
.titulo-blanco {
    color: var(--blanco);
}

.sub-hero {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--gris-texto);
    max-width: 520px;
}

.chip-suave {
    background: rgba(43, 76, 126, 0.08);
    color: var(--azul);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 999px;
}
.chip-clara {
    background: rgba(255, 255, 255, 0.14);
    color: var(--blanco);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 999px;
}
.chip-mini {
    background: var(--fondo);
    color: var(--azul);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: 999px;
}

/* ============================================================
   BOTONES
   ============================================================ */
.boton-primario {
    display: inline-block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--tinta);
    background: var(--amarillo);
    border: none;
    border-radius: 999px;
    padding: 13px 30px;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 6px 18px rgba(255, 193, 7, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.boton-primario:hover {
    color: var(--tinta);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 193, 7, 0.5);
}

.boton-suave {
    display: inline-block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--azul);
    background: var(--blanco);
    border: 1.5px solid #d8e0ec;
    border-radius: 999px;
    padding: 13px 30px;
    text-decoration: none;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}
.boton-suave:hover {
    color: var(--azul);
    border-color: var(--azul);
    transform: translateY(-2px);
}

/* ============================================================
   NAVBAR FLOTANTE (pastilla con blur)
   ============================================================ */
.nav-flotante {
    padding-top: 14px;
    padding-bottom: 8px;
    background: transparent;
}
.nav-pastilla {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 29, 51, 0.06);
    border-radius: 999px;
    box-shadow: var(--sombra);
}

.logo-nav {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.marca {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--tinta);
}
.marca-color {
    color: var(--azul);
}

.nav-flotante .nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gris-texto) !important;
    transition: color 0.2s ease;
}
.nav-flotante .nav-link:hover {
    color: var(--azul) !important;
}

.boton-nav {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--blanco);
    background: var(--azul);
    border-radius: 999px;
    padding: 9px 20px;
    text-decoration: none;
    transition: background 0.2s ease;
}
.boton-nav:hover {
    background: var(--azul-viv);
    color: var(--blanco);
}

.icono-menu {
    color: var(--azul);
}

/* En móvil, la pastilla se convierte en tarjeta redondeada al desplegar */
@media (max-width: 991px) {
    .nav-pastilla {
        border-radius: 24px;
        flex-wrap: wrap;
    }
    .boton-nav {
        display: inline-block;
        margin-top: 8px;
        align-self: flex-start;
    }
}

/* ============================================================
   HERO + BENTO GRID (elemento firma)
   ============================================================ */
.bento {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-auto-rows: 150px;
    gap: 16px;
}

.bento-celda {
    border-radius: var(--radio);
    padding: 22px;
    box-shadow: var(--sombra);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bento-celda:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-alta);
}

.celda-foto {
    background-size: cover;
    background-position: center;
    padding: 0;
}
.foto-hogar {
    background-image: url('https://images.unsplash.com/photo-1621905251189-08b45d6a269e?auto=format&fit=crop&q=80&w=800');
}
.foto-colegio {
    background-image: url('https://images.unsplash.com/photo-1580582932707-520aed937b7b?auto=format&fit=crop&q=80&w=800');
}
.foto-publico {
    background-image: url('https://images.unsplash.com/photo-1581094288338-2314dddb7ece?auto=format&fit=crop&q=80&w=800');
}

/* La primera foto ocupa dos filas para dar ritmo al grid */
.bento .celda-foto.foto-hogar {
    grid-row: span 2;
}

.celda-amarilla {
    background: var(--amarillo);
    color: var(--tinta);
}
.celda-azul {
    background: linear-gradient(135deg, var(--azul), var(--azul-viv));
    color: var(--blanco);
}

.bento-cifra {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1;
}
.bento-texto {
    font-weight: 600;
    font-size: 0.88rem;
    margin-top: 6px;
}
.bento-telefono {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--blanco);
    text-decoration: none;
}
.bento-telefono:hover {
    color: var(--amarillo);
}

/* La celda del colegio queda debajo de las dos pequeñas */
.bento .foto-colegio {
    grid-column: 2;
}

@media (max-width: 575px) {
    .bento {
        grid-auto-rows: 130px;
        gap: 12px;
    }
}

/* ============================================================
   TARJETAS DE SERVICIOS
   ============================================================ */
.tarjeta {
    background: var(--blanco);
    border-radius: var(--radio);
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.tarjeta:hover {
    transform: translateY(-8px);
    box-shadow: var(--sombra-alta);
}

.tarjeta-foto {
    height: 170px;
    background-size: cover;
    background-position: center;
}

.tarjeta-cuerpo {
    padding: 24px;
    position: relative;
    flex: 1;
}

.tarjeta-icono {
    position: absolute;
    top: -28px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--sombra);
}
.icono-amarillo {
    background: var(--amarillo);
    color: var(--tinta);
}
.icono-azul {
    background: var(--azul);
    color: var(--blanco);
}
.icono-oscuro {
    background: var(--tinta);
    color: var(--amarillo);
}

.tarjeta-titulo {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    margin-top: 26px;
    margin-bottom: 10px;
    color: var(--tinta);
}
.tarjeta-texto {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--gris-texto);
}

/* ============================================================
   PANEL "CÓMO TRABAJAMOS"
   ============================================================ */
.panel-proceso {
    background: linear-gradient(140deg, var(--tinta) 0%, var(--azul) 100%);
    border-radius: calc(var(--radio) + 8px);
    box-shadow: var(--sombra-alta);
}

.paso-burbuja {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--amarillo);
    color: var(--tinta);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.paso-titulo {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--blanco);
    margin-bottom: 8px;
}
.paso-texto {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0;
}

/* ============================================================
   PANEL DE CONTACTO
   ============================================================ */
.panel-contacto {
    border-radius: calc(var(--radio) + 8px);
    box-shadow: var(--sombra-alta);
    background: var(--blanco);
}

.lado-info {
    background: linear-gradient(160deg, var(--azul) 0%, var(--tinta) 100%);
}

.texto-claro {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.dato-contacto {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    color: var(--blanco);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
a.dato-contacto:hover {
    color: var(--amarillo);
}
.dato-icono {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--amarillo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Formulario */
.etiqueta {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--tinta);
}

.campo {
    border-radius: 14px;
    border: 1.5px solid #dde4ee;
    padding: 11px 16px;
    font-size: 0.97rem;
    background: var(--fondo);
}
.campo:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 0.22rem rgba(43, 76, 126, 0.15);
    background: var(--blanco);
}

.texto-legal {
    font-size: 0.82rem;
    color: var(--gris-texto);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    border-top: 1px solid #e2e8f2;
}
.texto-pie {
    font-size: 0.85rem;
    color: var(--gris-texto);
}
.texto-pie a {
    color: var(--azul);
    font-weight: 700;
    text-decoration: none;
}
.texto-pie a:hover {
    text-decoration: underline;
}

/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */
.whatsapp-flotante {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.whatsapp-flotante:hover {
    transform: scale(1.12);
}

/* ============================================================
   CHATBOT
   ============================================================ */
#chatbot {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1500;
}
.chatbot-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--azul);
    color: var(--blanco);
    border: none;
    font-size: 1.4rem;
    box-shadow: 0 6px 20px rgba(16, 29, 51, 0.3);
    transition: transform .3s, background .3s;
}
.chatbot-toggle:hover {
    transform: scale(1.08);
    background: var(--azul-viv);
}
.chatbot-window {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 330px;
    max-width: 85vw;
    height: 430px;
    background: var(--blanco);
    border-radius: var(--radio);
    overflow: hidden;
    box-shadow: var(--sombra-alta);
    display: flex;
    flex-direction: column;
}
.chatbot-window.d-none {
    display: none !important;
}
.chatbot-header {
    background: linear-gradient(135deg, var(--azul), var(--azul-viv));
    color: var(--blanco);
    padding: 14px 18px;
}
.chatbot-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: var(--fondo);
    display: flex;
    flex-direction: column;
}
.chatbot-msg {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 82%;
    font-size: .9rem;
    line-height: 1.5;
}
.chatbot-msg.bot {
    background: var(--blanco);
    color: var(--tinta);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(16, 29, 51, 0.06);
}
.chatbot-msg.user {
    background: var(--amarillo);
    color: var(--tinta);
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}
.chatbot-input {
    border-top: 1px solid #e6ebf3;
    padding: 8px;
    gap: 6px;
}
.chatbot-input .form-control {
    border-radius: 999px;
    border: 1.5px solid #dde4ee;
    padding-left: 16px;
}
.btn-chat-enviar {
    background: var(--azul);
    color: var(--blanco);
    border: none;
    border-radius: 999px;
    width: 42px;
    min-width: 42px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-chat-enviar:hover {
    background: var(--azul-viv);
}

/* ============================================================
   BANNER DE COOKIES
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    width: min(1100px, calc(100% - 32px));
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra-alta);
    z-index: 2000;
    transform: translate(-50%, 140%);
    transition: transform 0.45s ease;
}
.cookie-banner.visible {
    transform: translate(-50%, 0);
}
.texto-cookies {
    color: var(--gris-texto);
    font-size: 0.9rem;
}
.texto-cookies i {
    color: var(--amarillo);
}
.btn-cookie {
    font-size: 0.9rem;
    padding: 9px 22px;
    box-shadow: none;
}

/* ============================================================
   ANIMACIÓN DE APARICIÓN AL HACER SCROLL
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .logo-nav {
        height: 38px;
    }
    .tarjeta-foto {
        height: 150px;
    }
    .lado-info {
        border-radius: 0;
    }
}
