/* ==========================================================================
   VARIABLES GLOBALES - PALETA DE COLORES
   ========================================================================== */
:root {
    --color-bg: #F5F7FA;          /* Fondo de página */
    --color-white: #FFFFFF;        /* Fondo de tarjetas y secciones */
    --color-black: #1A1A1A;        /* Texto principal (casi negro) */
    --color-gray: #4A4A4A;         /* Texto secundario */
    --color-gold: #E4AD23;         /* Énfasis dorado */
    --color-blue: #245CE4;         /* Énfasis azul */
    --color-border: #E8ECF0;       /* Bordes sutiles */
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 30px -10px rgba(0, 0, 0, 0.10);
    --radius: 12px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET Y BASE
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--color-black);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

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

/* Márgenes laterales más amplios en móvil */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ==========================================================================
   BOTÓN FLOTANTE WHATSAPP
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 1.8rem;
    right: 1.8rem;
    background: #25d366;
    color: white;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}
.whatsapp-float svg { width: 30px; height: 30px; }

/* ==========================================================================
   CABECERA Y NAVEGACIÓN
   ========================================================================== */
.site-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.4rem 0;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
}

.brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-blue);
    letter-spacing: -0.5px;
}

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

.nav-links a {
    font-weight: 500;
    color: var(--color-gray);
    transition: color var(--transition);
    font-size: 0.95rem;
}
.nav-links a:hover { color: var(--color-blue); }

.btn-nav {
    background: var(--color-gold);
    color: var(--color-white) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: background var(--transition);
}
.btn-nav:hover { background: #c9971e !important; }

.menu-toggle { display: none; }
.menu-icon {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}
.menu-icon span {
    width: 28px;
    height: 3px;
    background: var(--color-black);
    border-radius: 4px;
    transition: var(--transition);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 0 3rem;
    gap: 2rem;
    position: relative;
    min-height: 70vh;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-black);
    margin-bottom: 1.2rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--color-gray);
    margin-bottom: 2rem;
    max-width: 540px;
}

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

.hero-image {
    flex: 0 0 45%;
    max-width: 45%;
}

.img-placeholder {
    width: 100%;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
    background: #eef2f7; /* fallback */
    border: 1px solid var(--color-border);
}
.img-placeholder span {
    font-size: 3rem;
    margin-bottom: 0.3rem;
}
.img-placeholder p {
    margin: 0;
    opacity: 0.8;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background: var(--color-gold);
    color: var(--color-white);
}
.btn-primary:hover { background: #c9971e; transform: translateY(-2px); }

.btn-secondary {
    background: transparent;
    color: var(--color-blue);
    border: 2px solid var(--color-blue);
}
.btn-secondary:hover {
    background: var(--color-blue);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* ==========================================================================
   SECCIONES Y TARJETAS
   ========================================================================== */
.block-section { padding: 4rem 0; }

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-black);
    letter-spacing: -0.02em;
}
.section-title p {
    color: var(--color-gray);
    font-size: 1.1rem;
    margin-top: 0.3rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
}
.card h3 {
    color: var(--color-blue);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}
.card ul { margin-top: 0.6rem; padding-left: 1.2rem; }
.card ul li { list-style: disc; margin-bottom: 0.2rem; }

.cert-badge { font-size: 2.8rem; margin-bottom: 0.5rem; }

/* ==========================================================================
   TABS
   ========================================================================== */
.tab-controls {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    background: var(--color-border);
    border-radius: 50px;
    padding: 0.4rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.7rem 1.8rem;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color var(--transition);
    color: var(--color-gray);
    position: relative;
    z-index: 2;
}
.tab-btn.active {
    color: var(--color-white);
}

.tab-slider {
    position: absolute;
    height: calc(100% - 0.8rem);
    background: var(--color-blue);
    border-radius: 50px;
    transition: left 0.3s ease, width 0.3s ease;
    z-index: 1;
    top: 0.4rem;
    left: 0.4rem;
}

.tab-panel {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}
.tab-panel[hidden] { display: none; }

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-bg);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.level-header h3 { font-size: 1.6rem; color: var(--color-blue); }

.badge {
    background: var(--color-gold);
    color: var(--color-white);
    padding: 0.25rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tag-cloud {
    background: var(--color-bg);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--color-gray);
}

.highlight-box {
    background: #fef9e7;
    border-left: 5px solid var(--color-gold);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.8rem;
}

details {
    background: var(--color-bg);
    margin-bottom: 0.6rem;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    transition: background var(--transition);
}
details:hover { background: #e8ecf0; }
details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-blue);
}
details p { margin-top: 0.6rem; color: var(--color-gray); }

/* ==========================================================================
   CONTACTO / FORMULARIO
   ========================================================================== */
.grid-contact {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
}

.contact-form {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}
.contact-form h3 { margin-bottom: 1.5rem; color: var(--color-blue); }
.contact-form label { font-weight: 500; margin-top: 0.8rem; }
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border var(--transition);
    background: var(--color-bg);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-blue);
    background: var(--color-white);
    box-shadow: 0 0 0 3px rgba(36, 92, 228, 0.1);
}
.contact-form .btn-primary {
    margin-top: 1.2rem;
    width: 100%;
    text-align: center;
}
.form-message {
    margin-top: 0.8rem;
    padding: 0.6rem;
    border-radius: var(--radius);
    font-weight: 500;
    display: none;
}
.form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contact-info .card { height: 100%; }
.contact-info code {
    background: var(--color-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--color-blue);
    color: rgba(255,255,255,0.85);
    padding: 3rem 0 0;
    margin-top: 3rem;
}

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

.footer-brand h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-white);
}
.footer-brand p { margin-top: 0.3rem; }
.footer-small { font-size: 0.9rem; opacity: 0.7; }

.footer-links h4,
.footer-certs h4,
.footer-contact h4 {
    color: var(--color-white);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}
.footer-links ul li,
.footer-certs ul li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}
.footer-links a:hover { color: var(--color-gold); }
.footer-contact p { margin-bottom: 0.3rem; }

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    opacity: 0.7;
}
.footer-bottom a { color: var(--color-gold); }
.footer-bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVIDAD
   ========================================================================== */
@media (max-width: 992px) {
    .hero-image { flex: 0 0 40%; max-width: 40%; }
    .hero-content h1 { font-size: 2.2rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .menu-icon { display: flex; }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-white);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow);
        display: none;
    }
    .menu-toggle:checked ~ .nav-links { display: flex; }

    .hero-block {
        flex-direction: column;
        min-height: auto;
        padding: 2.5rem 0;
    }
    .hero-content { max-width: 100%; }
    .hero-content h1 { font-size: 1.8rem; }
    .hero-image { flex: 1 1 100%; max-width: 100%; margin-top: 1.5rem; }

    .grid-contact { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .tab-btn { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
    .tab-controls { border-radius: var(--radius); overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
    .tab-slider { display: none; } /* Ocultar slider en móvil */
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions a { text-align: center; }
    .section-title h2 { font-size: 1.6rem; }
}