/* Programador Web · CFP 401 · Diseño refinado (mobile first) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
    --verde: #22c55e;
    --verde-claro: #ecfdf5;
    --verde-medio: #86efac;
    --verde-oscuro: #15803d;
    --azul: #3b82f6;
    --azul-claro: #eff6ff;
    --azul-oscuro: #1d4ed8;
    --rojo: #f43f5e;
    --rojo-claro: #fff1f2;
    --violeta: #8b5cf6;
    --violeta-claro: #f5f3ff;
    --fondo: #f0fdf4;
    --fondo-2: #eff6ff;
    --blanco: #ffffff;
    --texto: #0f172a;
    --texto-suave: #64748b;
    --borde: rgba(148, 163, 184, 0.35);
    --sombra-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --sombra: 0 8px 30px rgba(15, 23, 42, 0.08);
    --sombra-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
    --radio: 20px;
    --radio-sm: 14px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--fondo);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 197, 94, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 90% 10%, rgba(59, 130, 246, 0.14) 0%, transparent 50%),
        linear-gradient(180deg, var(--fondo) 0%, #fafafa 40%, var(--fondo-2) 100%);
    background-attachment: fixed;
    color: var(--texto);
    min-height: 100dvh;
    line-height: 1.6;
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, #14532d 0%, #15803d 30%, #166534 50%, #1e40af 100%);
    padding: 2rem 1.25rem 3.25rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
    pointer-events: none;
}

.hero-blob-1 {
    width: 200px;
    height: 200px;
    background: #4ade80;
    top: -60px;
    right: -40px;
}

.hero-blob-2 {
    width: 160px;
    height: 160px;
    background: #60a5fa;
    bottom: 20px;
    left: -50px;
}

.hero-blob-3 {
    width: 100px;
    height: 100px;
    background: #fbbf24;
    top: 40%;
    right: 10%;
    opacity: 0.25;
}

.hero-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    line-height: 0;
    pointer-events: none;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 32px;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.hero-logo-wrap {
    position: relative;
    padding: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, rgba(255,255,255,0.6));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    background: var(--blanco);
    border-radius: 50%;
    padding: 0.45rem;
    display: block;
}

.hero-institucion {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.45;
    max-width: 290px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.hero h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.18;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: clamp(0.95rem, 3.5vw, 1.08rem);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.hero-prof {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.9rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

.hero-prof strong {
    color: #fff;
    font-weight: 700;
}

/* ── Layout ── */
.contenido {
    padding: 0 1.15rem 2.5rem;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
    max-width: 480px;
    margin: 0 auto;
}

.contenido-interno {
    padding-top: 1.25rem;
}

.card {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.35rem;
    margin-top: -0.5rem;
    box-shadow: var(--sombra);
    animation: subir 0.5s ease-out both;
}

.card + .card,
.bloque-seccion .card {
    margin-top: 0;
}

.card p {
    color: var(--texto-suave);
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
}

.card p:last-child { margin-bottom: 0; }

.texto-ayuda {
    color: var(--texto-suave);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.bloque-seccion {
    margin-top: 1.75rem;
    animation: subir 0.5s ease-out both;
}

.bloque-seccion:nth-child(2) { animation-delay: 0.08s; }
.bloque-seccion:nth-child(3) { animation-delay: 0.16s; }

.seccion-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--verde-oscuro);
    margin-bottom: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--verde-claro);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.seccion-label::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--verde);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

/* ── Botones ── */
.acciones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.btn-accion {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 1rem 1.1rem;
    border-radius: var(--radio-sm);
    text-decoration: none;
    color: var(--texto);
    min-height: 72px;
    border: 1.5px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.btn-accion::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0.6;
}

.btn-accion:active:not(.btn-proximamente) {
    transform: scale(0.97);
}

.btn-accion-icono {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-accion-texto {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.btn-accion-texto strong {
    display: block;
    font-size: 0.93rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}

.btn-accion-texto span {
    font-size: 0.77rem;
    opacity: 0.85;
    line-height: 1.35;
}

.btn-accion-flecha {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.btn-menti {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #ddd6fe;
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.15);
}

.btn-menti .btn-accion-icono {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    color: #fff;
}

.btn-menti .btn-accion-texto strong { color: #5b21b6; }
.btn-menti .btn-accion-texto span { color: #7c3aed; }

.btn-pdf {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: #fecdd3;
    box-shadow: 0 6px 24px rgba(244, 63, 94, 0.12);
}

.btn-pdf .btn-accion-icono {
    background: linear-gradient(135deg, #fb7185, #f43f5e);
    color: #fff;
}

.btn-pdf .btn-accion-texto strong { color: #be123c; }
.btn-pdf .btn-accion-texto span { color: #e11d48; }

.btn-proximamente {
    background: #f8fafc;
    border-color: var(--borde);
    box-shadow: none;
    cursor: default;
    opacity: 0.8;
}

.btn-proximamente::after { display: none; }

.acciones-sin-margen { margin-top: 0; }

/* ── Clases anteriores ── */
.clase-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio-sm);
    padding: 1.05rem 1.1rem;
    text-decoration: none;
    color: inherit;
    min-height: 76px;
    box-shadow: var(--sombra-sm);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.clase-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--verde), var(--azul));
    border-radius: 4px 0 0 4px;
}

.clase-item:active {
    transform: scale(0.98);
    box-shadow: var(--sombra);
}

.clase-num {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--verde-claro), var(--azul-claro));
    color: var(--verde-oscuro);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 800;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.clase-info { flex: 1; min-width: 0; }

.clase-info h2 {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}

.clase-info p {
    font-size: 0.78rem;
    color: var(--texto-suave);
}

.clase-flecha {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--verde-claro);
    color: var(--verde-oscuro);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

/* ── Topbar ── */
.topbar {
    background: linear-gradient(135deg, #14532d, #1e40af);
    color: white;
    padding: 0.7rem 1rem;
    padding-top: calc(0.7rem + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(20, 83, 45, 0.3);
}

.topbar-back {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar-back:active {
    background: rgba(255, 255, 255, 0.22);
}

.topbar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 0.15rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.topbar-info { flex: 1; min-width: 0; }

.topbar-info span {
    display: block;
    font-size: 0.65rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.topbar-info strong {
    font-size: 0.9rem;
    font-weight: 700;
}

/* ── Tarjetas ejemplo ── */
.tarjetas {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.tarjeta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio-sm);
    padding: 1.05rem;
    text-decoration: none;
    color: inherit;
    min-height: 72px;
    box-shadow: var(--sombra-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tarjeta:active {
    transform: scale(0.98);
    box-shadow: var(--sombra);
}

.tarjeta-icono {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
}

.tarjeta:nth-child(1) .tarjeta-icono {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
}

.tarjeta:nth-child(2) .tarjeta-icono {
    background: linear-gradient(135deg, var(--azul-claro), #dbeafe);
    color: var(--azul);
}

.tarjeta:nth-child(3) .tarjeta-icono {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
    color: #ca8a04;
}

.tarjeta-texto { flex: 1; min-width: 0; }

.tarjeta-texto h3 {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 0.12rem;
}

.tarjeta-texto p {
    font-size: 0.76rem;
    color: var(--texto-suave);
    line-height: 1.4;
}

.tarjeta-flecha {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--texto-suave);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.objetivo {
    background: linear-gradient(135deg, var(--verde-claro), #f0fdf4);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: var(--radio-sm);
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}

.objetivo-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--verde-oscuro);
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.objetivo p {
    color: #166534 !important;
    font-size: 0.86rem !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.35rem;
    justify-content: center;
}

.tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}

.tag-html { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.tag-css  { background: var(--azul-claro); color: var(--azul-oscuro); border-color: #bfdbfe; }
.tag-js   { background: #fefce8; color: #a16207; border-color: #fde68a; }

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem 1.25rem;
    color: var(--texto-suave);
    font-size: 0.74rem;
    line-height: 1.65;
    background: var(--blanco);
    margin-top: 2rem;
    border-top: 1px solid var(--borde);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--verde), var(--azul));
    border-radius: 0 0 4px 4px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.footer-brand span {
    font-size: 0.67rem;
    color: #94a3b8;
    max-width: 300px;
    line-height: 1.45;
}

footer strong {
    color: var(--texto);
    font-weight: 700;
}

@keyframes subir {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 480px) {
    .contenido { padding-left: 1.5rem; padding-right: 1.5rem; }
    .hero { padding-bottom: 3.5rem; }
}
