/* =============================================================================
   ESTILOS GENERALES
   ============================================================================= */

body {
    /* Background azul oscuro con gradiente */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.form-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    backdrop-filter: blur(10px);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   LOGO Y TÍTULO
   ============================================================================= */

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-img {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
    background: transparent;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.logo-img:hover {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.05);
}

.form-title {
    color: #333;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   FORMULARIO - ESTILOS GENERALES
   ============================================================================= */

.form-group {
    margin-bottom: 25px;
}

.form-label {
    color: #555;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    font-size: 16px;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
}

.form-control.is-valid {
    border-color: #28a745;
    background: #f8fff9;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background: #fff8f8;
}

.form-floating {
    position: relative;
}

.form-floating textarea {
    min-height: 100px;
    resize: vertical;
}

/* =============================================================================
   RADIO BUTTONS
   ============================================================================= */

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.radio-option:hover {
    background-color: #f0f8ff;
    border-color: #667eea;
    transform: translateY(-1px);
}

.radio-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.radio-option.selected {
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f8ff 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* =============================================================================
   BOTONES
   ============================================================================= */

.btn-register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 18px 30px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    width: 100%;
    margin-top: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-register:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-register:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-volver {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    width: 100%;
    text-align: center;
}

.btn-volver:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
    color: white;
}

/* =============================================================================
   INFORMACIÓN DEL ESTUDIANTE
   ============================================================================= */

.student-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
    border: 2px solid #c3e6c3;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.student-info h6 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
}

.student-info p {
    color: #155724;
    margin: 5px 0;
    font-size: 15px;
    font-weight: 500;
}

.student-info.student-not-found {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffeaa7;
}

.student-info.student-not-found h6 {
    color: #856404;
}

.student-info.student-not-found p {
    color: #856404;
}

/* =============================================================================
   LOADING Y ALERTAS
   ============================================================================= */

.loading {
    display: none;
    text-align: center;
    padding: 15px;
    color: #667eea;
    font-weight: 600;
}

.spinner-border-sm {
    width: 1.2rem;
    height: 1.2rem;
}

.alert {
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-weight: 500;
}

.invalid-feedback,
.valid-feedback {
    display: block;
    margin-top: 8px;
    font-size: 0.9em;
    font-weight: 500;
}

.text-muted {
    color: #6c757d !important;
    font-weight: 500;
}

/* =============================================================================
   PÁGINA DE ÉXITO (REGISTRADO.PHP)
   ============================================================================= */

.success-icon {
    font-size: 5rem;
    color: #28a745;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.success-title {
    color: #333;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.student-name {
    font-size: 28px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
}

.date-info {
    font-size: 20px;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.time-info {
    font-size: 24px;
    color: #667eea;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f8ff 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #667eea;
}

.additional-info {
    background: #fafafa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #333;
    font-weight: 500;
}

.email-status {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.email-success {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
    border: 2px solid #c3e6c3;
    color: #155724;
}

.email-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffeaa7;
    color: #856404;
}

/* =============================================================================
   BOTÓN MOSTRAR ATRASO (si existe)
   ============================================================================= */

.mostrar-atraso-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mostrar-atraso-container .alert {
    border-radius: 8px;
    border: 2px solid #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.mostrar-atraso-container .btn {
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    transition: all 0.2s ease;
}

.mostrar-atraso-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-mostrar-atraso {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-mostrar-atraso:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    color: white;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 576px) {
    .main-container {
        padding: 10px;
    }
    
    .form-card {
        padding: 25px 20px;
        margin: 5px;
        border-radius: 15px;
    }
    
    .form-title,
    .success-title {
        font-size: 24px;
    }
    
    .student-name {
        font-size: 22px;
    }
    
    .date-info {
        font-size: 18px;
    }
    
    .time-info {
        font-size: 20px;
    }
    
    .success-icon {
        font-size: 4rem;
    }
    
    .logo-img {
        max-width: 80px;
        max-height: 80px;
    }
    
    .mostrar-atraso-container .alert {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .btn-register,
    .btn-volver {
        padding: 15px 25px;
        font-size: 16px;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }
}