/* ============================================
   STYLE PRINCIPAL - FORMULAIRE PRÉINSCRIPTION
   SUPTECH - Année Universitaire
   ============================================ */

:root {
    /* Couleurs SUPTECH */
    --suptech-blue: #004080;
    --suptech-light-blue: #0066cc;
    --suptech-orange: #ff6600;
    --suptech-dark: #003366;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
}

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

body {
    font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding-top: 20px;
    padding-bottom: 50px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== EN-TÊTE ========== */
.header-section {
    background: linear-gradient(135deg, var(--suptech-blue) 0%, var(--suptech-light-blue) 100%);
    color: white;
    padding: 25px 0;
    border-radius: 10px 10px 0 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 64, 128, 0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.suptech-logo {
    height: 80px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.logo-placeholder {
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.annee-universitaire {
    font-size: 1.2rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.annee-universitaire i {
    font-size: 1.1rem;
}

/* ========== BARRE DE PROGRESSION ========== */
.progress-container {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.progress-bar-custom {
    height: 10px;
    border-radius: 5px;
    background-color: #e9ecef;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--suptech-blue), var(--suptech-light-blue));
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 0.85rem;
}

.step {
    text-align: center;
    flex: 1;
    position: relative;
    padding-top: 25px;
    color: #666;
    transition: color 0.3s ease;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: #e9ecef;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active::before {
    background: var(--suptech-blue);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}

.step.completed::before {
    background: var(--suptech-light-blue);
    content: '✓';
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.step-text {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
}

/* Ligne de connexion entre les étapes */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 62%;
    right: -38%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
    background: var(--suptech-light-blue);
}

/* ========== NAVIGATION RAPIDE ========== */
.nav-section {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.nav-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.nav-section li {
    margin: 0;
}

.nav-section a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border-radius: 50px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-section a:hover {
    background: #e9ecef;
    color: var(--suptech-blue);
    border-color: var(--suptech-blue);
    transform: translateY(-2px);
}

.nav-section a.active {
    background: var(--suptech-blue);
    color: white;
    border-color: var(--suptech-blue);
    box-shadow: 0 4px 8px rgba(0, 64, 128, 0.2);
}

.nav-section a i {
    font-size: 0.9rem;
}

/* ========== SECTIONS DU FORMULAIRE ========== */
.form-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--suptech-blue);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

.form-section:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    color: var(--suptech-blue);
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
}

.section-title i {
    color: var(--suptech-orange);
    font-size: 1.2rem;
}

.subsection-title {
    color: #555;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eaeaea;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.subsection-title i {
    color: var(--suptech-blue);
    font-size: 1rem;
}

/* ========== FORMULAIRES ========== */
.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

.form-label.required::after {
    content: " *";
    color: var(--error-color);
    font-weight: bold;
}

.form-control, .form-select {
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: all 0.3s;
    font-size: 1rem;
    line-height: 1.5;
}

.form-control:focus, .form-select:focus {
    border-color: var(--suptech-light-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
    outline: none;
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--error-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 5px;
}

.form-check {
    margin-bottom: 10px;
}

.form-check-input:checked {
    background-color: var(--suptech-blue);
    border-color: var(--suptech-blue);
}

.form-check-input:focus {
    border-color: var(--suptech-light-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
}

/* ========== BOUTONS ========== */
.btn-supertch {
    background-color: var(--suptech-blue);
    color: white;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-supertch:hover {
    background-color: var(--suptech-light-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-supertch:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    border: none;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: white;
}

/* ========== MESSAGES D'ALERTE ========== */
.alert-section {
    background: #fff3cd;
    border-left: 5px solid var(--warning-color);
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 0 5px 5px 0;
}

.alert-section h5 {
    color: #856404;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-section p {
    margin-bottom: 10px;
    color: #856404;
}

.alert-section p:last-child {
    margin-bottom: 0;
}

/* ========== SAUVEGARDE AUTOMATIQUE ========== */
.save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: none;
    z-index: 1000;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.5s ease;
}

.save-status.error {
    background: var(--error-color);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.save-status.show {
    display: flex;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== MESSAGES FLASH ========== */
.alert {
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid var(--error-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 5px solid var(--warning-color);
}

/* ========== GRID ET LAYOUT ========== */
.form-row {
    margin-bottom: 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.col-md-1, .col-md-2, .col-md-3, .col-md-4, 
.col-md-5, .col-md-6, .col-md-7, .col-md-8, 
.col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    padding-right: 10px;
    padding-left: 10px;
}

.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .form-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .header-section {
        padding: 20px 0;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .annee-universitaire {
        font-size: 1rem;
        justify-content: center;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .nav-section ul {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-section li {
        width: 100%;
        max-width: 300px;
    }
    
    .nav-section a {
        justify-content: center;
    }
    
    .col-md-6, .col-md-4, .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .progress-steps {
        font-size: 0.75rem;
    }
    
    .step-text {
        font-size: 0.7rem;
    }
    
    .save-status {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .btn-supertch, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .progress-container {
        padding: 15px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
}

/* ========== ANIMATIONS ET TRANSITIONS ========== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* ========== UTILITAIRES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.d-flex { display: flex; }
.d-none { display: none; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }

/* ========== LOADING ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--suptech-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ========== FORMULAIRE CONTINU ========== */
.form-section-continu {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--suptech-blue);
    transition: all 0.3s ease;
}

.form-section-continu:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

/* Navigation ancrée */
.nav-ancre {
    position: relative;
}

.nav-ancre a {
    text-decoration: none;
    color: var(--suptech-blue);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-ancre a:hover {
    background: rgba(0, 64, 128, 0.1);
    transform: translateX(5px);
}

.nav-ancre a.active {
    background: var(--suptech-blue);
    color: white;
}

/* Bouton de retour en haut */
.btn-retour-haut {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--suptech-blue);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 64, 128, 0.3);
    transition: all 0.3s;
    z-index: 1000;
    text-decoration: none;
}

.btn-retour-haut:hover {
    background: var(--suptech-light-blue);
    transform: translateY(-3px);
}

/* Indicateur de section active */
.section-indicator {
    position: absolute;
    right: 20px;
    top: 20px;
    background: var(--suptech-orange);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Style pour les champs groupés */
.field-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #dee2e6;
}

.field-group:hover {
    border-left-color: var(--suptech-light-blue);
}