:root {
    --navy: #0a1628;
    --navy-mid: #111d35;
    --navy-light: #192a4a;
    --cyan: #29ABE2;
    --cyan-dark: #1e8fbe;
    --cyan-glow: rgba(41, 171, 226, 0.15);
    --white: #ffffff;
    --offwhite: #f0f4f8;
    --gray-50: #f8fafc;
    --gray-100: #eef2f7;
    --gray-200: #dce3ed;
    --gray-400: #94a3b8;
    --gray-600: #64748b;
    --text: #1a2535;
    --text-light: #475569;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 8px rgba(10, 22, 40, 0.06);
    --shadow-md: 0 8px 30px rgba(10, 22, 40, 0.08);
    --shadow-lg: 0 20px 50px rgba(10, 22, 40, 0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--offwhite);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAVBAR */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: var(--transition);
}
.navbar.scrolled {
    background: rgba(10, 22, 40, 0.95);
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
}
.nav-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(20px, 4vw, 50px);
    height: 72px;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.logo-img { height: 46px; width: auto; }
.nav-links {
    display: flex; align-items: center; gap: 8px; list-style: none;
}
.nav-links a {
    color: rgba(255,255,255,0.75); text-decoration: none;
    font-size: 0.9rem; font-weight: 500; padding: 8px 16px;
    border-radius: 8px; transition: var(--transition);
}
.nav-links a:hover { color: white; background: rgba(255,255,255,0.08); }
.nav-cta {
    background: var(--cyan) !important; color: white !important;
    border-radius: 8px !important; font-weight: 600 !important;
}
.nav-cta:hover { background: var(--cyan-dark) !important; transform: translateY(-1px); }

.menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
}
.menu-toggle span {
    width: 24px; height: 2px; background: white; border-radius: 2px;
    transition: var(--transition);
}

/* HERO */
.hero {
    position: relative; min-height: 100vh;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
    padding: 120px clamp(20px, 5vw, 60px) 60px;
    overflow: hidden;
}
.hero-bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(41, 171, 226, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(41, 171, 226, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero::before {
    content: ''; position: absolute; top: -200px; right: -200px;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(41,171,226,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content {
    position: relative; z-index: 2; max-width: 800px;
    animation: heroFadeIn 1s ease-out;
}
.hero-badge {
    display: inline-block; padding: 8px 20px;
    background: rgba(41,171,226,0.12); border: 1px solid rgba(41,171,226,0.25);
    border-radius: 50px; font-size: 0.85rem; font-weight: 500;
    color: var(--cyan); letter-spacing: 0.5px;
    margin-bottom: 28px;
}
.hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.05; letter-spacing: 2px;
    margin-bottom: 20px;
}
.highlight {
    color: var(--cyan);
    text-shadow: 0 0 40px rgba(41,171,226,0.25);
}
.hero-sub {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: rgba(255,255,255,0.65); max-width: 560px;
    margin: 0 auto 36px; line-height: 1.7;
}
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
    display: flex; align-items: center; justify-content: center; gap: 30px;
    margin-top: 60px; padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: 'Bebas Neue'; font-size: 2rem; color: var(--cyan); }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.1); }

.hero-scroll {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.35); font-size: 0.75rem; letter-spacing: 1px;
    text-transform: uppercase;
}
.scroll-line {
    width: 1px; height: 40px; background: linear-gradient(to bottom, var(--cyan), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 32px; border-radius: 10px;
    font-size: 0.95rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer;
    transition: var(--transition); font-family: 'DM Sans', sans-serif;
}
.btn-primary {
    background: var(--cyan); color: white;
    box-shadow: 0 4px 15px rgba(41,171,226,0.3);
}
.btn-primary:hover {
    background: var(--cyan-dark);
    box-shadow: 0 6px 25px rgba(41,171,226,0.4);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent; color: white;
    border: 1px solid rgba(255,255,255,0.25);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.4);
}

/* SECTIONS COMMON */
.section-header {
    text-align: center; padding: 0 20px; margin-bottom: 50px;
}
.subtitle {
    display: inline-block; font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; color: var(--cyan);
    margin-bottom: 12px;
}
.subtitle-light { color: rgba(41,171,226,0.8); }
.section-header h2, .nosotros-text h2, .contacto-info h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 1px; color: var(--text);
}

/* CURSOS */
.cursos-section {
    padding: 100px clamp(20px, 5vw, 60px);
    max-width: 1400px; margin: 0 auto;
}
.filter-container {
    display: flex; gap: 8px; justify-content: center; margin-top: 24px;
}
.filter-btn {
    padding: 10px 24px; border-radius: 50px;
    border: 1px solid var(--gray-200); background: white;
    font-family: 'DM Sans'; font-size: 0.85rem; font-weight: 600;
    color: var(--text-light); cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-btn.active {
    background: var(--cyan); color: white; border-color: var(--cyan);
    box-shadow: 0 4px 12px rgba(41,171,226,0.25);
}

.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.curso-card {
    background: white; border-radius: var(--radius-lg);
    padding: 28px; display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    position: relative; overflow: hidden;
    min-height: 280px;
}
.curso-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: linear-gradient(90deg, var(--cyan), var(--cyan-dark));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.curso-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.curso-badge {
    align-self: flex-start; padding: 5px 14px; border-radius: 6px;
    font-size: 0.73rem; font-weight: 700; margin-bottom: 16px;
    letter-spacing: 0.3px;
}
.badge-online { background: #e0f7fa; color: #00838f; }
.badge-presencial { background: #fff3e0; color: #e65100; }

.curso-body {
    display: flex; flex-direction: column; flex: 1;
}
.curso-body h3 {
    font-size: 1rem; font-weight: 600;
    line-height: 1.45; margin-bottom: 14px;
    color: var(--text);
}
.curso-meta {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 16px;
}
.curso-meta span {
    font-size: 0.83rem; color: var(--text-light);
    display: flex; align-items: center; gap: 6px;
}
.meta-icon { font-size: 0.9rem; width: 20px; text-align: center; }

.price-tag {
    font-size: 1.15rem; font-weight: 700; color: var(--cyan);
    margin-bottom: 18px;
}

.btn-card {
    display: block; text-align: center; padding: 12px 20px;
    border: 2px solid var(--cyan); color: var(--cyan);
    border-radius: 10px; font-weight: 600; font-size: 0.9rem;
    text-decoration: none; margin-top: auto;
    transition: var(--transition);
}
.btn-card:hover {
    background: var(--cyan); color: white;
    box-shadow: 0 4px 15px rgba(41,171,226,0.3);
}

/* NOSOTROS */
.nosotros-section {
    padding: 100px clamp(20px, 5vw, 60px);
    background: white;
}
.nosotros-inner {
    max-width: 1280px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
    align-items: center;
}
.nosotros-text h2 { margin-bottom: 20px; }
.nosotros-text > p {
    color: var(--text-light); line-height: 1.8;
    margin-bottom: 32px; font-size: 0.95rem;
}
.nosotros-features { display: flex; flex-direction: column; gap: 20px; }
.feature {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 16px; background: var(--gray-50);
    border-radius: var(--radius); border: 1px solid var(--gray-100);
}
.feature-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.feature strong { display: block; margin-bottom: 2px; font-size: 0.95rem; }
.feature p { font-size: 0.85rem; color: var(--text-light); margin: 0; }

.nosotros-visual {
    display: flex; flex-direction: column; gap: 20px;
    position: relative;
}
.visual-card {
    padding: 30px; border-radius: var(--radius-lg);
    color: white; position: relative; overflow: hidden;
}
.visual-card::before {
    content: ''; position: absolute; inset: 0;
    opacity: 0.08;
    background-image:
        linear-gradient(45deg, white 25%, transparent 25%),
        linear-gradient(-45deg, white 25%, transparent 25%);
    background-size: 20px 20px;
}
.vc1 { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%); }
.vc2 { background: linear-gradient(135deg, var(--cyan-dark) 0%, var(--cyan) 100%); }
.vc3 { background: linear-gradient(135deg, #1a3a5c 0%, var(--navy-mid) 100%); }
.vc-number {
    display: block; font-family: 'Bebas Neue'; font-size: 2.8rem;
    line-height: 1; position: relative;
}
.vc-text {
    display: block; font-size: 0.9rem; opacity: 0.8;
    margin-top: 4px; position: relative;
}

/* CONTACTO */
.contacto-section {
    padding: 100px clamp(20px, 5vw, 60px);
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
}
.contacto-inner {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px;
    align-items: start;
}
.contacto-info h2 { color: white; margin-bottom: 16px; }
.contacto-info > p { color: rgba(255,255,255,0.6); line-height: 1.7; margin-bottom: 36px; }
.contacto-datos { display: flex; flex-direction: column; gap: 16px; }
.dato {
    display: flex; align-items: center; gap: 14px;
    font-size: 0.95rem; color: rgba(255,255,255,0.8);
}
.dato-icon {
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    background: rgba(41,171,226,0.12); border-radius: 10px; font-size: 1.1rem;
}

.contacto-form {
    display: flex; flex-direction: column; gap: 14px;
    background: white; padding: 36px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.contacto-form input,
.contacto-form select,
.contacto-form textarea {
    padding: 14px 16px; border: 1px solid var(--gray-200);
    border-radius: 10px; font-family: 'DM Sans'; font-size: 0.9rem;
    color: var(--text); background: var(--gray-50);
    transition: var(--transition); width: 100%;
}
.contacto-form input:focus,
.contacto-form select:focus,
.contacto-form textarea:focus {
    outline: none; border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-glow);
    background: white;
}
.contacto-form textarea { resize: vertical; min-height: 100px; }
.btn-submit { width: 100%; padding: 16px; font-size: 1rem; border-radius: 10px; }
.form-feedback {
    text-align: center; font-size: 0.9rem; font-weight: 500;
    padding: 0; transition: var(--transition);
}
.form-feedback.success { color: #16a34a; padding: 8px 0; }
.form-feedback.error { color: #dc2626; padding: 8px 0; }

/* FOOTER */
.footer {
    background: var(--navy);
    border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 60px clamp(20px, 5vw, 60px) 40px;
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
}
.footer-logo { height: 50px; margin-bottom: 16px; }
.footer-brand p { color: rgba(255,255,255,0.45); font-size: 0.9rem; max-width: 300px; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links h4 {
    color: white; font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 1.5px; margin-bottom: 6px;
}
.footer-links a {
    color: rgba(255,255,255,0.45); text-decoration: none;
    font-size: 0.9rem; transition: var(--transition);
}
.footer-links a:hover { color: var(--cyan); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center; padding: 24px;
    color: rgba(255,255,255,0.3); font-size: 0.8rem;
}

/* EXTRA POLISH */
.cursos-grid {
    align-items: start; /* evita que cards vacías se estiren */
}
.curso-meta {
    flex: 1;
}
.curso-meta span:empty { display: none; }

/* Fix hero en Safari */
@supports (-webkit-touch-callout: none) {
    .hero { min-height: -webkit-fill-available; }
}

/* Scrollbar sutil */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

/* ANIMATIONS */
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.visible {
    opacity: 1; transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .nosotros-inner { grid-template-columns: 1fr; }
    .contacto-inner { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed; top: 72px; left: 0; right: 0;
        background: rgba(10,22,40,0.97);
        backdrop-filter: blur(20px);
        flex-direction: column; padding: 20px;
        gap: 4px;
        transform: translateY(-120%);
        transition: transform 0.35s ease;
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a { padding: 14px 20px; width: 100%; border-radius: 10px; }
    .menu-toggle { display: flex; }

    .hero { min-height: 100svh; padding-top: 100px; }
    .hero h1 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
    .hero-stats { gap: 20px; flex-wrap: wrap; }

    .cursos-grid { grid-template-columns: 1fr; }
    .filter-container { flex-wrap: wrap; }

    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .footer-brand p { max-width: 100%; }
    .footer-logo { margin: 0 auto 16px; display: block; }
}

@media (max-width: 480px) {
    .hero-btns { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 280px; }
}

/* BUSCADOR DE CURSOS */
.search-container {
    margin: 20px auto 0;
    max-width: 480px;
    position: relative;
}
.search-container input[type="search"] {
    width: 100%;
    padding: 12px 20px;
    border: 1.5px solid var(--gray-200);
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    background: white;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.search-container input[type="search"]:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.12);
}
.search-container input[type="search"]::placeholder {
    color: var(--gray-400);
}
/* Ocultar botón nativo de limpiar en webkit */
.search-container input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

@media (max-width: 768px) {
    .search-container { max-width: 100%; }
}

/* WHATSAPP FLOTANTE */
.whatsapp-float {
    position: fixed; bottom: 28px; right: 28px; z-index: 999;
    width: 58px; height: 58px; border-radius: 50%;
    background: #25D366;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    transition: var(--transition);
    text-decoration: none;
}
.whatsapp-float:hover {
    background: #1ebe5d;
    transform: translateY(-3px) scale(1.07);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
}
.whatsapp-float svg { width: 30px; height: 30px; fill: white; }
.whatsapp-tooltip {
    position: absolute; right: 70px;
    background: var(--navy); color: white;
    font-size: 0.8rem; font-weight: 500;
    padding: 7px 14px; border-radius: 8px;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.whatsapp-tooltip::after {
    content: ''; position: absolute; top: 50%; right: -6px;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--navy); border-right: none;
}
.whatsapp-float:hover .whatsapp-tooltip { opacity: 1; }
@media (max-width: 480px) {
    .whatsapp-float { bottom: 18px; right: 18px; width: 52px; height: 52px; }
    .whatsapp-tooltip { display: none; }
}
