/* styles.css - Charte graphique globale */

/* Import de la police Lato */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

/* Variables CSS pour les couleurs de la charte */
:root {
    --color-primary: #00698f;      /* Pantone 7706 - Bleu principal */
    --color-secondary: #fbba00;    /* Pantone 1235 - Jaune/Or */
    --color-dark: #1d1d1b;         /* Noir principal */
    --color-secondary-light: #f5f7fa;
    --color-white: #ffffff;
    --color-border: #e0e0e0;
    --color-success: #28a745;
    --color-error: #dc3545;
    --color-info: #17a2b8;
    
    /* Variations des couleurs principales */
    --color-primary-light: #e6f2f7;
    --color-primary-dark: #004d6a;
    --color-secondary-light: #fff5d9;
    --color-secondary-dark: #c99400;
}

/* ============================================
   RESET ET BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background: var(--color-primary-light);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-dark);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    /* display: flex; */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============================================
   NAVBAR / HEADER
   ============================================ */
.navbar,
.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    padding: 20px 40px;
    text-align: center;
}

.navbar h1,
.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.content {
    padding: 40px;
}

.btn-deconnexion {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--color-white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
}

.btn-deconnexion:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.container {
    width: 100%;
    max-width: 80%;
}

.auth-container {
    max-width: 480px;
    margin: 60px auto;
    padding: 0 20px;
}

/* ============================================
   MESSAGES / ALERTES
   ============================================ */
.message,
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: none;
    font-weight: 600;
    border-left: 4px solid;
}

.message.success,
.alert.success {
    display: block;
    background: #d4edda;
    border-color: var(--color-success);
    color: #155724;
}

.message.error,
.alert.error {
    display: block;
    background: #f8d7da;
    border-color: var(--color-error);
    color: #721c24;
}

.message.info,
.alert.info {
    display: block;
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.message.warning,
.alert.warning {
    display: block;
    background: var(--color-secondary-light);
    border-color: var(--color-secondary);
    color: #856404;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   TAB CONTENT & FORM SECTIONS
   ============================================ */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.form-section {
    display: none !important;
}

.form-section.active {
    display: block !important;
    animation: fadeIn 0.3s ease-in;
}

/* ============================================
   ROLE OPTIONS
   ============================================ */
.role-option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.role-option:hover {
    border-color: var(--color-primary);
    background: #f9f9f9;
}

.role-option input[type="radio"] {
    margin-top: 5px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.role-option-text strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.role-option-text p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.signup-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.signup-link a:hover {
    text-decoration: underline;
}

.form-links {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-links p {
    margin: 10px 0;
    font-size: 14px;
}

.link-secondary {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.link-secondary:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================
   CONFIRMATION
   ============================================ */
.confirmation {
    text-align: center;
    padding: 40px 0;
}

.confirmation-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.confirmation h2 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-size: 24px;
}

.confirmation p {
    color: #666;
    line-height: 1.6;
    margin: 10px 0;
}

/* ============================================
   CARDS / BOXES
   ============================================ */
.card,
.box,
.auth-box {
    background: var(--color-white);
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 2px 12px rgba(29, 29, 27, 0.08);
    margin-bottom: 30px;
    border: 1px solid rgba(0, 105, 143, 0.1);
}

.card h2,
.box h2,
.auth-box h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-secondary);
    padding-bottom: 12px;
    text-align: center;
}

.auth-box {
    text-align: center;
}

.auth-box .logo {
    font-size: 64px;
    margin-bottom: 20px;
}

.auth-box h1 {
    color: var(--color-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-box p {
    color: #666;
    margin-bottom: 30px;
}

/* ============================================
   INFO BOX / HIGHLIGHT
   ============================================ */
.info-etablissement,
.highlight-box,
.info-box {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #ffffff 100%);
    border-left: 5px solid var(--color-primary);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 35px;
    box-shadow: 0 2px 8px rgba(0, 105, 143, 0.1);
}

.info-etablissement p,
.highlight-box p,
.info-box p {
    margin: 10px 0;
    font-size: 15px;
    color: var(--color-dark);
}

.info-etablissement strong,
.highlight-box strong,
.info-box strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-group,
.input-group {
    margin-bottom: 26px;
}

.form-group label,
.input-group label {
    display: block;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 10px;
    font-size: 15px;
}

.form-group input,
.form-group textarea,
.form-group select,
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    color: var(--color-dark);
    background: var(--color-white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 105, 143, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.field-hint,
.input-hint {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}

/* États désactivés */
input:disabled,
textarea:disabled,
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   CHECKBOX & RADIO
   ============================================ */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"],
.radio-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.checkbox-group label,
.radio-group label {
    margin: 0;
    font-weight: 400;
    cursor: pointer;
    font-size: 15px;
}

/* ============================================
   INDICATEUR D'ÉTAPES
   ============================================ */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background-color: #ddd;
    z-index: 0;
}

.step.active:not(:last-child)::after {
    background-color: var(--color-primary);
}

.step-number {
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    color: #999;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.step.active .step-number {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 0 0 8px rgba(0, 105, 143, 0.1);
}

.step p {
    font-size: 12px;
    color: #999;
}

.step.active p {
    color: var(--color-primary);
    font-weight: 600;
}

/* ============================================
   GRILLES
   ============================================ */
.row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.row-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ============================================
   TITRES DE SECTION
   ============================================ */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 30px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-secondary);
}

/* ============================================
   UPLOAD DE FICHIERS
   ============================================ */
.upload-zone {
    border: 3px dashed var(--color-primary);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #ffffff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-zone:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-dark);
    transform: scale(1.01);
}

.upload-zone.drag-over {
    background: var(--color-secondary-light);
    border-color: var(--color-secondary);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(251, 186, 0, 0.2);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 15px;
}

.upload-text {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.upload-hint {
    color: #666;
    font-size: 14px;
}

/* ============================================
   LISTE DES DOCUMENTS
   ============================================ */
.documents-list {
    margin-top: 25px;
}

.document-item {
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.document-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(0, 105, 143, 0.15);
    transform: translateY(-2px);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.document-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: 10px;
    border: 2px solid var(--color-primary);
}

.document-details {
    flex: 1;
}

.document-name {
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 4px;
    font-size: 15px;
}

.document-meta {
    font-size: 13px;
    color: #666;
}

.document-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-icon:hover {
    transform: scale(1.15);
}

.btn-download {
    color: var(--color-primary);
}

.btn-download:hover {
    background: var(--color-primary-light);
}

.btn-delete {
    color: var(--color-error);
}

.btn-delete:hover {
    background: #ffe8ea;
}

/* ============================================
   BARRE DE PROGRESSION
   ============================================ */
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--color-border);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* ============================================
   BOUTONS
   ============================================ */
.buttons,
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    justify-content: flex-end;
}

.buttons.center,
.button-group.center {
    justify-content: center;
}

.btn,
button[type="submit"],
button[type="button"] {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.btn-primary,
button[type="submit"] {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 105, 143, 0.3);
    width: 100%;
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 105, 143, 0.4);
}

.btn-primary:active,
button[type="submit"]:active {
    transform: translateY(-1px);
}

.btn-primary:disabled,
button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-dark);
}

.btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--color-secondary);
    color: var(--color-dark);
}

.btn-warning:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-full,
button.full-width {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}

.btn-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================
   LIENS
   ============================================ */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    /*color: var(--color-primary-dark);*/
    text-decoration: none;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
    font-size: 14px;
}

/* ============================================
   TABLEAUX
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 14px;
    text-align: left;
    font-weight: 700;
    border-bottom: 3px solid var(--color-secondary);
}

table td {
    padding: 2px 14px;
    border-bottom: 1px solid var(--color-border);
}

table tr:hover {
    background: var(--color-primary-light);
}

table tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES / LABELS
   ============================================ */
.badge,
.label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.badge-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-success {
    background: #d4edda;
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-secondary-light);
    color: var(--color-secondary-dark);
}

.badge-danger {
    background: #f8d7da;
    color: var(--color-error);
}

/* ============================================
   INDICATEURS
   ============================================ */
.required {
    color: var(--color-error);
    font-weight: 700;
}

/* ============================================
   SÉPARATEURS
   ============================================ */
.divider {
    height: 1px;
    background: var(--color-border);
    margin: 30px 0;
}

.divider-text {
    text-align: center;
    position: relative;
    margin: 30px 0;
}

.divider-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--color-border);
}

.divider-text::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--color-border);
}

.divider-text span {
    background: var(--color-white);
    padding: 0 15px;
    color: #666;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .navbar,
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .navbar h1,
    .header h1 {
        font-size: 22px;
    }

    .container,
    .auth-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .card,
    .box,
    .auth-box {
        padding: 25px 20px;
    }

    .row-2col,
    .row-3col {
        grid-template-columns: 1fr;
    }

    .buttons,
    .button-group {
        flex-direction: column;
    }

    .btn,
    button[type="submit"],
    button[type="button"] {
        width: 100%;
    }

    .document-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .document-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .upload-zone {
        padding: 30px 20px;
    }

    table {
        font-size: 14px;
    }

    table th,
    table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .navbar h1,
    .header h1 {
        font-size: 20px;
    }

    .card h2,
    .box h2,
    .auth-box h2 {
        font-size: 20px;
    }

    .section-title {
        font-size: 16px;
    }

    .step-indicator {
        flex-wrap: wrap;
    }

    .step:not(:last-child)::after {
        display: none;
    }
}

/* ============================================
   UTILITAIRES
   ============================================ */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 40px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.p-5 { padding: 40px; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.fw-light { font-weight: 300; }
.fw-normal { font-weight: 400; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }


/* ============================================
   CHECKBOX FIX - Alignement correct
   ============================================ */

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s;
    margin-bottom: 0;
}

.checkbox-option:hover {
    background-color: #f5f5f5;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;  /* IMPORTANT : retire les marges par défaut */
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;  /* Empêche la checkbox de se rétrécir */
}

.checkbox-option span {
    flex: 1;
    font-size: 14px;
    color: #333;
    margin: 0;
}

/************************************************** UPLOAD ***********************/
  .upload-zone {
            border: 3px dashed var(--color-primary);
            border-radius: 12px;
            padding: 40px;
            text-align: center;
            background: linear-gradient(135deg, var(--color-primary-light) 0%, #ffffff 100%);
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .upload-zone:hover {
            background: var(--color-primary-light);
            border-color: var(--color-primary-dark);
        }
        .upload-zone.drag-over {
            background: var(--color-secondary-light);
            border-color: var(--color-secondary);
            border-style: solid;
            transform: scale(1.02);
        }
        .upload-icon { font-size: 56px; margin-bottom: 15px; }
        .upload-text { color: var(--color-primary); font-weight: 700; font-size: 16px; margin-bottom: 8px; }
        .upload-hint { color: #666; font-size: 14px; }
        .documents-list { margin-top: 25px; }
        .document-item {
            background: var(--color-white);
            border: 2px solid var(--color-border);
            border-radius: 10px;
            padding: 18px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .document-info {
            display: flex;
            align-items: center;
            gap: 15px;
            flex: 1;
        }
        .document-icon {
            font-size: 28px;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--color-primary-light);
            border-radius: 10px;
        }
        .document-name { font-weight: 700; color: var(--color-dark); }
        .document-meta { font-size: 13px; color: #666; }
        .progress-bar {
            width: 100%;
            height: 10px;
            background: var(--color-border);
            border-radius: 5px;
            overflow: hidden;
            margin-top: 15px;
            display: none;
        }
        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
            transition: width 0.3s ease;
            width: 0%;
        }