/* CONFIGURACIÓN GENERAL Y VARIABLES */
:root {
    /* PALETA EXTRAÍDA DEL LOGOTIPO OFICIAL (IMAGEN 4 - ALTO CONTRASTE) */
    --logo-red: #e31919;          /* Rojo vivo del engranaje */
    --logo-red-dark: #b51212;     /* Variación oscura para gradientes e interactividad */
    --logo-blue: #104382;         /* Azul institucional de las letras "IESTP" */
    --logo-blue-light: #e6eef7;   /* Azul suavizado para fondos secundarios */
    --logo-white: #ffffff;        /* Blanco fondo limpio para contraste puro */
    
    /* VARIANTES DE SOPORTE INTEGRAL */
    --red-bg-light: #fff0f0;      /* Rojo ultra-claro para tarjetas suaves */
    --blue-border: #a8c4e6;       /* Borde azulado basado en la colimetría */
    --dark-bg: #0b1a2e;           /* Fondo noche oscuro institucional */
    --light-bg: #fdfefe;          /* Fondo general extremadamente limpio (Blanco puro/Contraste alto) */
    
    /* SOMBRAS Y TIPOGRAFÍA */
    --card-shadow: 0 6px 20px rgba(16, 67, 130, 0.08); 
    --text-main: #1c2833;         /* Gris oscuro casi negro para lecturas nítidas */
    --text-muted: #566573;        /* Texto secundario */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* SECCIONES ANIMADAS AL HACER SCROLL */
.section {
    padding: 60px 0;
    border-bottom: 1px solid #eaeded;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.section.reveal {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--logo-blue);
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--logo-red);
    border-radius: 2px;
}

/* GRIDS FLEXIBLES */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

/* HERO SECTION */
.hero {
    position: relative;
    background: url('') no-repeat center center/cover;
    color: var(--logo-white);
    text-align: center;
    padding: 80px 20px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(16, 67, 130, 0.92), rgba(229, 227, 255, 0.85));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

/* Estilo del Contenedor del Logo */
.logo-container {
    margin-bottom: 15px;
}
.institution-logo {
    max-height: 110px;
    width: auto;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.3));
}

.badge {
    background-color: var(--logo-blue);
    color: var(--logo-white);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 1.9rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.hero h1 {
    font-size: 3.8rem;
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.hero h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: #f2f4f4;
}

.slogan {
    font-style: italic;
    font-size: 1.2rem;
    color: #eaeded;
    margin-bottom: 35px;
}

/* REPARACIÓN DEL BOTÓN PRIMARIO USANDO LA NUEVA PALETA */
.btn-primary {
    background-color: var(--logo-red);
    color: var(--logo-white);
    border: none;
    padding: 15px 32px;
    font-size: 1.05rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 20px rgba(223, 25, 25, 0.4);
}

.btn-primary:hover {
    background-color: var(--logo-red-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(223, 25, 25, 0.5);
}

.hero-info-bar {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.15);
    padding: 18px;
    border-radius: 50px;
    backdrop-filter: blur(8px);
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-info-bar i {
    color: var(--logo-white);
    margin-right: 6px;
}

/* OBJETIVOS */
.card {
    background: var(--logo-white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
    border: 1px solid #f2f4f4;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(16, 67, 130, 0.15);
}

.icon-box {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.6rem;
}
.icon-box.red { background: var(--red-bg-light); color: var(--logo-red); }
.icon-box.blue { background: var(--logo-blue-light); color: var(--logo-blue); }
.icon-box.dark-blue { background: #1c3d5a; color: var(--logo-white); }
.icon-box.red-accent { background: #fbeeeeb7; color: var(--logo-red-dark); }

.card h4 { margin-bottom: 10px; font-size: 1.2rem; color: var(--logo-blue); }
.card p { font-size: 0.95rem; color: var(--text-muted); }

/* PARTICIPACIÓN Y REQUISITOS */
.card-requisito-container {
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}
.tone-red { background-color: var(--red-bg-light); border: 1px solid #f6cfcf; }
.tone-blue { background-color: var(--logo-blue-light); border: 1px solid var(--blue-border); }

.card-requisito-container h4 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--logo-blue);
}

.elenco-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* REPARACIÓN DEL FONDO USANDO COLORES CORRECTOS */
.stat-box {
    flex: 1;
    background: var(--logo-blue);
    color: var(--logo-white);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: background-color 0.3s;
}

.tone-red .stat-box {
    background: var(--logo-red);
}

.stat-number { font-size: 2.2rem; font-weight: bold; display: block; }
.stat-label { font-size: 0.9rem; opacity: 0.9; }

.note-text { font-size: 0.95rem; color: var(--text-main); line-height: 1.6; }

.doc-list { list-style: none; }
.doc-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--logo-white);
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.02);
    transition: transform 0.2s ease;
}

.doc-list li:hover {
    transform: translateX(5px);
}

.check-icon { color: #27ae60; font-size: 1.1rem; }
.sub-detail { display: block; font-size: 0.85rem; color: var(--text-muted); }

/* CRONOGRAMA */
.timeline-container {
    max-width: 600px;
    margin: 0 auto 30px;
    position: relative;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px; top: 0; width: 3px; height: 100%;
    background: #d5dbdb;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    position: relative;
}

.timeline-number {
    width: 44px; height: 44px;
    background: var(--logo-blue);
    color: var(--logo-white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; z-index: 2;
    box-shadow: 0 3px 8px rgba(16, 67, 130, 0.3);
    transition: transform 0.3s ease;
}

.timeline-item:hover .timeline-number {
    transform: scale(1.15) rotate(360deg);
    background-color: var(--logo-red);
}

.timeline-content {
    background: var(--logo-white);
    padding: 18px 22px;
    border-radius: 8px;
    flex: 1;
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--logo-blue);
    transition: border-color 0.3s;
}

.timeline-item:hover .timeline-content {
    border-left-color: var(--logo-red);
}

.timeline-content strong { display: block; font-size: 1.1rem; color: var(--logo-blue); }
.timeline-content span { font-size: 0.9rem; color: var(--text-muted); }

/* BANNERS DE ALERTA */
.alert-banner {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    align-items: center;
}

.info-banner { background: var(--logo-blue-light); border: 1px solid var(--blue-border); color: var(--logo-blue); }
.info-banner i { font-size: 1.8rem; color: var(--logo-blue); }

.danger-banner { background: var(--red-bg-light); border: 1px solid #f5b7b7; color: var(--logo-red-dark); }
.danger-banner i { font-size: 1.8rem; color: var(--logo-red); }
.danger-banner ul { margin-left: 20px; margin-top: 10px; font-size: 0.95rem; }

.highlight-text { font-weight: bold; margin-top: 5px; color: var(--logo-red); }

/* CRITERIOS DE EVALUACIÓN */
.evaluation-container {
    background: var(--logo-white);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid #eaeded;
}

.evaluation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eaeded;
}

.evaluation-row:last-child { border-bottom: none; }
.eval-text strong { font-size: 1.1rem; color: var(--logo-blue); }
.eval-text p { font-size: 0.9rem; color: var(--text-muted); }
.eval-score { font-size: 1.6rem; font-weight: bold; color: var(--logo-red); }

/* PREMIACIÓN */
.podium {
    align-items: flex-end;
    margin-top: 40px;
}

.card-prize {
    padding: 35px 20px;
    border-radius: 12px;
    color: var(--logo-white);
}

.trophy-icon { font-size: 2.8rem; margin-bottom: 10px; display: inline-block; }
.rank-title { font-size: 2.2rem; font-weight: bold; display: block; }

.rank-1 { background: linear-gradient(135deg, #104382, #072142); order: 2; padding: 55px 20px; border: 2px solid #fff; }
.rank-2 { background: linear-gradient(135deg, #e31919, #9c0f0f); order: 1; }
.rank-3 { background: linear-gradient(135deg, #566573, #2c3e50); order: 3; }

.prize-detail { font-size: 0.95rem; margin-top: 10px; opacity: 0.95; font-weight: 500; }
.footer-note { text-align: center; font-size: 0.95rem; color: var(--text-muted); margin-top: 25px; }

/* FOOTER */
.main-footer {
    background-color: var(--dark-bg);
    color: #a6b9d0;
    text-align: center;
    padding: 50px 20px;
    font-size: 0.9rem;
    border-top: 4px solid var(--logo-red);
}

.footer-brand { color: var(--logo-white); font-size: 1.6rem; font-weight: bold; margin-bottom: 10px; letter-spacing: 1px; }
.designer { color: var(--logo-white); background-color: var(--logo-red); display: inline-block; padding: 3px 12px; border-radius: 4px; font-weight: bold; margin: 15px 0; letter-spacing: 1px; font-size: 0.75rem; }
.credits { font-size: 0.85rem; opacity: 0.7; line-height: 1.5; }

/* ANIMACIONES COMPLEMENTARIAS CSS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 1s ease-out forwards; }

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.animate-bounce-slow { animation: bounceSlow 4s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}
.animate-pulse { animation: pulse 2s infinite; }

@keyframes flash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.4; }
}
.animate-flash { animation: flash 3s infinite; }

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255,255,255,0.6)); }
    50% { filter: drop-shadow(0 0 15px rgba(255,255,255,1)); }
}
.dynamic-glow { animation: glow 2s infinite; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.6rem; }
    .hero h2 { font-size: 1.4rem; }
    .hero-info-bar { border-radius: 16px; gap: 15px; }
    .podium { align-items: stretch; gap: 15px; }
    .rank-1 { order: 1; padding: 35px 20px; }
    .rank-2 { order: 2; }
    .rank-3 { order: 3; }
}