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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Institucional */
.header-institucional {
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo-sep {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.logo-sreda {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Container principal */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.card-principal {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 700px;
    width: 100%;
}

h1 {
    color: #1e3c72;
    margin-bottom: 10px;
    text-align: center;
    font-size: 28px;
}

.subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Formulario */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    text-transform: uppercase;
}

input[type="text"]:focus {
    outline: none;
    border-color: #2a5298;
}

/* CAPTCHA */
.captcha-container {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.captcha-question {
    margin-bottom: 15px;
}

.captcha-question p {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

.captcha-display {
    background: white;
    border: 2px solid #2a5298;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 8px;
    color: #1e3c72;
    font-family: 'Courier New', monospace;
    user-select: none;
}

.captcha-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-top: 10px;
}

.refresh-captcha {
    background: #2a5298;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.3s;
}

.refresh-captcha:hover {
    background: #1e3c72;
}

/* Botón de búsqueda */
.btn-buscar {
    width: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-buscar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.4);
}

.btn-buscar:active {
    transform: translateY(0);
}

/* Mensajes de error */
.error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #2a5298;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5298;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Resultados */
.resultados {
    margin-top: 30px;
    display: none;
}

.resultados h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 22px;
}

.estadisticas {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.estadisticas strong {
    color: #1e3c72;
}

.diplomas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.diploma-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    background: white;
}

.diploma-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #2a5298;
}

.diploma-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 10px;
}

.diploma-icon {
    background: #f5f5f5;
    padding: 40px;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 10px;
}

.diploma-icon span {
    font-size: 48px;
}

.diploma-info {
    font-size: 12px;
    color: #666;
}

.diploma-info strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.diploma-info small {
    display: block;
    margin-top: 3px;
}

/* No resultados */
.no-resultados {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-resultados h3 {
    color: #1e3c72;
    margin-bottom: 10px;
}

/* Footer Institucional */
.footer-institucional {
    background: rgba(255, 255, 255, 0.95);
    color: #1e3c72;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-institucional p {
    margin: 5px 0;
    font-weight: 600;
}

.footer-small {
    font-size: 12px;
    color: #666;
    font-weight: 400 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .header-institucional {
        padding: 15px 0;
    }
    
    .logos-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo-sep {
        height: 60px;
    }
    
    .logo-sreda {
        height: 50px;
    }
    
    .card-principal {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .diplomas-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 10px;
    }
    
    .card-principal {
        padding: 25px 15px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .captcha-display {
        font-size: 24px;
        letter-spacing: 6px;
    }
}
