/* ============================================
   STYLES GÉNÉRAUX - ASOL
   ============================================ */

/* Variables de couleurs */
:root {
    --asol-bleu: #0052A5;
    --asol-bleu-hover: #cbddf0;
    --asol-rouge: #C42314;
    --asol-rouge-hover: #B8122F;
    --asol-bg: #f4f7f6;
    --asol-blanc: #ffffff;
    --asol-texte-sombre: #333333;
    --asol-texte-clair: #555555;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--asol-bg);
    color: var(--asol-texte-sombre);
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */

header {
    background-color: var(--asol-bleu);
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 50px;
}

.header-home-link {
    text-decoration: none;
    color: var(--asol-blanc);
    font-weight: bold;
    font-size: 1.1rem;
    transition: opacity 0.3s;
}

.header-home-link:hover {
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-user-badge {
    background-color: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    color: var(--asol-blanc);
}

.header-logout-link {
    text-decoration: none;
    color: var(--asol-blanc);
    background-color: var(--asol-rouge);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.header-logout-link:hover {
    background-color: var(--asol-rouge-hover);
}

/* ============================================
   PAGE DE CONNEXION
   ============================================ */

.login-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 16px 48px;
    box-sizing: border-box;
    margin: 0;
    background-color: var(--asol-bg);
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background-color: var(--asol-blanc);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo {
    height: 60px;
}

.login-title {
    margin-top: 10px;
    color: var(--asol-bleu);
    font-size: 1.8rem;
    font-weight: bold;
    border: none;
}

.login-alert {
    background: #ffebee;
    color: var(--asol-rouge);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #ef9a9a;
}

.login-form-group {
    margin-bottom: 15px;
}

.login-form-group:last-of-type {
    margin-bottom: 20px;
}

.login-label {
    font-weight: bold;
    color: var(--asol-texte-clair);
    display: block;
    margin-bottom: 5px;
}

.login-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: var(--asol-bleu);
    box-shadow: 0 0 0 2px rgba(0, 82, 165, 0.1);
}

.login-button {
    width: 100%;
    height: 45px;
    font-size: 1.1rem;
    background-color: var(--asol-bleu);
    color: var(--asol-blanc);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: Arial, sans-serif;
}

.login-button:hover {
    background-color: #003d7a;
}

.login-forgot {
    margin-top: 20px;
    text-align: center;
}

.login-forgot a {
    text-decoration: none;
    color: var(--asol-bleu);
    font-size: 0.9rem;
}

/* Pages paiements (merci, erreur) */
.paiement-message {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.paiement-message p {
    margin-bottom: 0.5rem;
}

.paiement-message p:last-child {
    margin-bottom: 0;
}

.paiement-success {
    color: var(--asol-texte-sombre);
}

.paiement-note {
    font-size: 0.9rem;
    color: var(--asol-texte-clair);
    margin-top: 0.75rem;
}

/* ============================================
   CONTENU PRINCIPAL
   ============================================ */

main {
    padding: 20px;
    max-width: 90%;
    margin: 0 auto;
}

/* ============================================
   LIENS GÉNÉRAUX
   ============================================ */

a {
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.8;
}

/* ============================================
   BOUTONS
   ============================================ */

.btn-primary {
    background-color: var(--asol-bleu);
    color: var(--asol-blanc);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: Arial, sans-serif;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #003d7a;
}

.btn-danger {
    background-color: var(--asol-rouge);
    color: var(--asol-blanc);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: Arial, sans-serif;
}

.btn-danger:hover {
    background-color: var(--asol-rouge-hover);
}

/* ============================================
   FORMULAIRES ET CARTES
   ============================================ */

.profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.profile-card {
    background-color: var(--asol-blanc);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.profile-title {
    color: var(--asol-bleu);
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.profile-alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid;
}

.profile-alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.profile-alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.profile-form-group {
    margin-bottom: 15px;
}

.profile-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.profile-form-row .profile-form-group {
    flex: 1;
    margin-bottom: 0;
}

.profile-label {
    font-weight: bold;
    color: var(--asol-texte-clair);
    display: block;
    margin-bottom: 5px;
}

.profile-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.profile-input:focus {
    outline: none;
    border-color: var(--asol-bleu);
    box-shadow: 0 0 0 2px rgba(0, 82, 165, 0.1);
}

.profile-divider {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 25px 0;
}

.profile-section-title {
    font-weight: bold;
    color: var(--asol-texte-clair);
    margin-bottom: 5px;
}

.profile-section-description {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 15px;
}

.profile-submit-button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 1rem;
}

.profile-back-link {
    text-align: center;
    display: block;
    color: var(--asol-bleu);
    text-decoration: none;
    margin-top: 20px;
}

.profile-back-link:hover {
    text-decoration: underline;
}

.profile-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.profile-info strong {
    color: var(--asol-bleu);
}

/* ============================================
   GESTION UTILISATEURS
   ============================================ */

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

.users-title {
    color: var(--asol-bleu);
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.users-card {
    background-color: var(--asol-blanc);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.users-card-title {
    color: var(--asol-bleu);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.users-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.users-form-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.users-form-input:focus {
    outline: none;
    border-color: var(--asol-bleu);
    box-shadow: 0 0 0 2px rgba(0, 82, 165, 0.1);
}

.users-form-select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    background-color: var(--asol-blanc);
    cursor: pointer;
}

.users-form-select:focus {
    outline: none;
    border-color: var(--asol-bleu);
    box-shadow: 0 0 0 2px rgba(0, 82, 165, 0.1);
}

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

.users-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--asol-blanc);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.users-table thead {
    background-color: var(--asol-bleu);
    color: var(--asol-blanc);
}

.users-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    font-size: 0.95rem;
}

.users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

/* Couleur de ligne selon le role (appliquée aux td pour fiabilité) */
.users-table tbody tr.users-row-role-superadmin td {
    background-color: rgba(196, 34, 20, 0.1);
}
.users-table tbody tr.users-row-role-superviseur td {
    background-color: rgba(34, 139, 34, 0.18);
}
.users-table tbody tr.users-row-role-admin td {
    background-color: rgba(0, 82, 165, 0.12);
}
.users-table tbody tr.users-row-role-user td {
    background-color: var(--asol-blanc);
}

.users-table tbody tr:hover td {
    background-color: #f0f4f8 !important;
}
.users-table tbody tr.users-row-role-superadmin:hover td {
    background-color: rgba(196, 34, 20, 0.15) !important;
}
.users-table tbody tr.users-row-role-superviseur:hover td {
    background-color: rgba(34, 139, 34, 0.25) !important;
}
.users-table tbody tr.users-row-role-admin:hover td {
    background-color: rgba(0, 82, 165, 0.18) !important;
}
.users-table tbody tr.users-row-role-user:hover td {
    background-color: #f0f4f8 !important;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.users-table input[type="text"],
.users-table input[type="password"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.users-table input[type="text"]:focus,
.users-table input[type="password"]:focus {
    outline: none;
    border-color: var(--asol-bleu);
    box-shadow: 0 0 0 2px rgba(0, 82, 165, 0.1);
}

.users-table input[type="text"]:read-only,
.users-table input[type="password"]:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.users-table select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    background-color: var(--asol-blanc);
    cursor: pointer;
}

.users-table select:focus {
    outline: none;
    border-color: var(--asol-bleu);
    box-shadow: 0 0 0 2px rgba(0, 82, 165, 0.1);
}

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

.users-table-username {
    color: var(--asol-bleu);
    font-weight: bold;
}

.users-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.users-btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s;
}

.users-btn-delete {
    background-color: var(--asol-rouge);
    color: var(--asol-blanc);
}

.users-btn-delete:hover {
    background-color: var(--asol-rouge-hover);
}

.users-import-button {
    text-decoration: none;
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--asol-bleu);
    color: var(--asol-blanc);
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
    font-family: Arial, sans-serif;
    border: none;
    cursor: pointer;
}

.users-import-button:hover {
    background-color: #003d7a;
}

/* ============================================
   ENCARTS ET CARTES D'ACCUEIL
   ============================================ */

.home-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.home-card {
    background-color: rgba(255, 255, 255, 0.72);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.home-card:hover {
    background-color: rgba(255, 255, 255, 0.62);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.home-card-title {
    color: var(--asol-bleu);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--asol-bleu);
    padding-bottom: 10px;
}

.home-card-link {
    display: inline-block;
    color: var(--asol-bleu);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border: 2px solid var(--asol-bleu);
    border-radius: 8px;
    transition: all 0.3s;
    
    background-color: var(--asol-bleu);
    color: var(--asol-blanc);
    font-weight: bold;
}

.home-card-link:hover {
    background-color: var(--asol-rouge);
    border: 2px solid var(--asol-rouge);
    color: var(--asol-blanc);
}

/* Statuts des demandes de devis (back-office) */
.statut-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.statut-a-traiter {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}
.statut-en-suspens {
    background: rgba(255, 235, 59, 0.15);
    color: #ffeb3b;
}
.statut-terminee {
    background: rgba(76, 175, 80, 0.18);
    color: #81c784;
}
.statut-a-modifier {
    background: rgba(244, 67, 54, 0.18);
    color: #ef5350;
}

.home-card-links-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.home-card-links-list li {
    margin-bottom: 8px;
}

.home-card-admin {
    background-color: #e3f2fd;
}

/* Table des devis : plus de largeur et colonnes lisibles */
.devis-table {
    width: 100%;
    table-layout: fixed;
}
.devis-table th,
.devis-table td {
    text-align: left;
    padding: 8px 10px;
    color: #ffffff;
}
.devis-table th:nth-child(1),
.devis-table td:nth-child(1) {
    width: 24%;
}
.devis-table th:nth-child(2),
.devis-table td:nth-child(2) {
    width: 46%;
}
.devis-table th:nth-child(3),
.devis-table td:nth-child(3) {
    width: 18%;
}
.devis-table th:nth-child(4),
.devis-table td:nth-child(4) {
    width: 12%;
    text-align: center;
}

.devis-table a {
    color: #7eb8ff;
    text-decoration: none;
}

.devis-table a:hover {
    color: #a8d0ff;
}

/* Zone de détails d'une demande de devis */
.devis-details h2,
.devis-details h3,
.devis-details p,
.devis-details label,
.devis-details strong {
    color: #ffffff;
}

/* ============================================
   APP MULTIPLICATIONS
   ============================================ */

.mult-tables-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mult-tables-btn {
    padding: 6px 10px;
    font-size: 0.9rem;
}

.mult-tables-btn-selected {
    background-color: var(--asol-rouge);
    border-color: var(--asol-rouge);
}

.mult-types-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.mult-type-btn {
    padding: 6px 10px;
    font-size: 0.9rem;
}

.mult-type-btn-selected {
    background-color: var(--asol-rouge);
    border-color: var(--asol-rouge);
}

.mult-types-random {
    margin-top: 10px;
}

.mult-session-header {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.mult-question-container {
    margin-bottom: 15px;
}

.mult-question-text {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.mult-answer-input {
    font-size: 1.2rem;
    max-width: 200px;
    text-align: center;
}
