/* =====================================================
   TAE ONLINE 2026 - ESTILOS CID
   Centro de Educación a Distancia (CED)
   ===================================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    color: #333333;
}

/* =====================================================
   FONDO ANIMADO - Oculto para estilo limpio
   ===================================================== */
.bg-animation {
    display: none;
}

.grid-bg {
    display: none;
}

.particles {
    display: none;
}

.particle {
    display: none;
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1e5a99;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    color: #1e5a99;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f5f7fa;
    border: 1px solid #1e5a99;
    border-radius: 25px;
    color: #1e5a99;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #1e5a99;
    color: #ffffff;
    transform: translateX(-5px);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-consulta {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #f5a623;
    border: 1px solid #e09000;
    border-radius: 25px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.btn-consulta:hover {
    background: #e09000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
}

@media (max-width: 600px) {
    .nav-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-consulta,
    .btn-back {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* =====================================================
   CONTENIDO PRINCIPAL
   ===================================================== */
.main-content {
    padding: 100px 20px 60px;
    min-height: 100vh;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   HEADER DEL FORMULARIO
   ===================================================== */
.form-header {
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #1e5a99 0%, #0d3a66 100%);
    border-bottom: none;
}

.form-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
    color: #ffffff;
}

.title-glow {
    color: #ffffff;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    text-shadow: none;
}

.title-year {
    font-size: 3rem;
    color: #f5a623;
    text-shadow: none;
}

.form-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    color: #ffffff;
}

.badge-icon {
    font-size: 1.2rem;
}

/* =====================================================
   SECCIONES DEL FORMULARIO
   ===================================================== */
.tae-form {
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #1e5a99;
}

.section-icon {
    font-size: 1.5rem;
}

/* =====================================================
   GRID Y CAMPOS
   ===================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333333;
    font-size: 0.95rem;
}

.required {
    color: #dc3545;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    color: #333333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: #999999;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e5a99;
    box-shadow: 0 0 0 3px rgba(30, 90, 153, 0.15);
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

.form-group input.error,
.form-group select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.error-message {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 6px;
    padding-left: 5px;
}

.form-group.has-error .error-message {
    display: block;
}

.date-helper {
    display: block;
    font-size: 0.85rem;
    color: #1e5a99;
    margin-top: 6px;
    padding-left: 5px;
}

/* =====================================================
   SELECT PERSONALIZADO
   ===================================================== */
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231e5a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

.form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.form-group select option {
    background: #ffffff;
    color: #333333;
    padding: 10px;
}

/* =====================================================
   INFO DE HORARIOS
   ===================================================== */
.schedule-info {
    background: #e8f4fc;
    border: 1px solid rgba(30, 90, 153, 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #333333;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item strong {
    color: #1e5a99;
}

.info-icon {
    font-size: 1.1rem;
}

/* =====================================================
   INDICADOR DE CARGA
   ===================================================== */
.horario-loading {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: #1e5a99;
    font-size: 0.9rem;
}

.horario-loading.active {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(30, 90, 153, 0.3);
    border-top-color: #1e5a99;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   CUPOS DISPONIBLES
   ===================================================== */
.cupos-container {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.cupos-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 15px;
}

.cupos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 500px) {
    .cupos-grid {
        grid-template-columns: 1fr;
    }
}

.cupo-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.cupo-card.disponible {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.cupo-card.limitado {
    border-color: #f5a623;
    background: rgba(245, 166, 35, 0.05);
}

.cupo-card.agotado {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
    opacity: 0.6;
}

.cupo-horario {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #1e5a99;
}

.cupo-cantidad {
    font-size: 1.5rem;
    font-weight: 700;
}

.cupo-card.disponible .cupo-cantidad {
    color: #28a745;
}

.cupo-card.limitado .cupo-cantidad {
    color: #f5a623;
}

.cupo-card.agotado .cupo-cantidad {
    color: #dc3545;
}

.cupo-label {
    font-size: 0.8rem;
    color: #666666;
    margin-top: 4px;
}

/* =====================================================
   BOTONES
   ===================================================== */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 500px) {
    .form-actions {
        flex-direction: column;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 180px;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-primary {
    background: #f5a623;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

.btn-primary:hover {
    background: #e09000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #ffffff;
    color: #1e5a99;
    border: 1px solid #1e5a99;
}

.btn-secondary:hover {
    background: #e8f4fc;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =====================================================
   MODALES
   ===================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
}

.modal-content.success .modal-icon {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 2px solid #28a745;
}

.modal-content.error .modal-icon {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 2px solid #dc3545;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333333;
}

.modal-content p {
    color: #666666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: left;
}

.modal-details p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #333333;
}

.modal-details p:last-child {
    margin-bottom: 0;
}

.modal-details strong {
    color: #1e5a99;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .form-header {
        padding: 30px 20px;
    }
    
    .form-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .title-year {
        font-size: 2.2rem;
    }
    
    .tae-form {
        padding: 25px 20px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
}