/* ----------------------------- */
/* 🌍 Paramètres globaux */
/* ----------------------------- */
html {
    box-sizing: border-box;
    font-size: 16px;
    width: 100%;
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    width: 100%;
    line-height: 1.5;
}

/* ----------------------------- */
/* 🎯 Typographie fluide (modérée sur PC) */
/* ----------------------------- */
h1 {
    font-size: clamp(1.4rem, 1.2vw + 1rem, 2.2rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: #2a9d8f;
}

h2 {
    font-size: clamp(1.2rem, 1vw + 0.8rem, 1.7rem);
    font-weight: 600;
    color: #264653;
    margin-bottom: 15px;
}

p, input, textarea, select, button, label, a, td, th {
    font-size: clamp(0.95rem, 0.8vw + 0.6rem, 1.1rem);
}

/* ----------------------------- */
/* 🪪 Containers communs */
/* ----------------------------- */
.login-container, 
.register-container,
.verify-container,
.dashboard-container {
    background: white;
    padding: clamp(1.5em, 3vw, 2em);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
    transition: 0.3s ease;
}

/* ----------------------------- */
/* 🧍 Login & Register */
/* ----------------------------- */
.login-container, .register-container, .verify-container {
    text-align: center;
    max-width: 420px;
}

.subtitle {
    color: #555;
    font-size: clamp(0.9rem, 1vw + 0.6rem, 1rem);
    margin-bottom: 25px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

input, textarea, select {
    width: 100%;
    padding: clamp(10px, 1.5vw, 16px);
    border-radius: 10px;
    border: 1px solid #ccc;
    font-family: inherit;
    transition: 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #2a9d8f;
    outline: none;
    box-shadow: 0 0 6px rgba(42, 157, 143, 0.3);
}

input, textarea{
    cursor:text;
}

select{
    cursor:pointer;
}

::placeholder {
    color: #666;
}

button {
    background-color: #2a9d8f;
    color: white;
    border: none;
    border-radius: 10px;
    padding: clamp(12px, 2vw, 16px);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

button:hover {
    background-color: #21867a;
}

.error {
    color: #e76f51;
    margin-bottom: 10px;
    font-weight: 500;
}

a {
    color: #2a9d8f;
    font-weight: 600;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ----------------------------- */
/* 📊 Tableau de bord */
/* ----------------------------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.logout {
    text-decoration:none;
    background-color: #e76f51;
    color: white;
    padding:6px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.logout:hover {
    background-color: #d45a40;
}

.admin-btn, .btn {
    text-decoration:none;
    background-color: #0077cc; /* bleu */
    color: white;
    border-radius: 8px;
    font-weight: 600;
    padding:6px 12px;
}

.admin-btn:hover, .btn:hover {
    background-color: #005fa3; /* bleu plus foncé au survol */
}


table {
    width: 100%;
    border-collapse: collapse;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

thead {
    background-color: #2a9d8f;
    color: white;
}

th, td {
    padding: clamp(8px, 0.8vw + 4px, 14px);
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* ----------------------------- */
/* 📱 Responsive (mobile-first) */
/* ----------------------------- */
@media (max-width: 868px) {
    body {
        padding: 10px;
        justify-content: center;
        align-items: center; /* ✅ centrage vertical */
        flex-direction: column;
    }

    .login-container, .register-container, .dashboard-container {
        max-width: none;
        width: 100%;
        padding: clamp(1.5em, 4vw, 2em);
        border-radius: 12px;
        box-shadow: none;
    }
    
    .login-container,
    .register-container,
    .verify-container {
        animation: fadeUp 0.8s ease-out;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Table responsive */
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 10px;
        margin-bottom: 15px;
        padding: 10px;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
    }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2a9d8f;
        flex: 1;
        text-align: left;
    }

    td span {
        flex: 2;
        text-align: right;
    }
    
     /* Table imbriquée dans les détails */
    /*.detail-inner table, 
    .detail-inner thead, 
    .detail-inner tbody, 
    .detail-inner th, 
    .detail-inner td, 
    .detail-inner tr {
        display: block;
        width: 100%;
    }

    .detail-inner thead {
        display: none;
    }

    .detail-inner tr {
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 8px;
        background: #fff;
    }

    .detail-inner td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px;
    }

    .detail-inner td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #0077cc;
        flex: 1;
        text-align: left;
    }

    .detail-inner td span {
        flex: 2;
        text-align: right;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .login-container, .register-container {
        padding: 1.5em 1em;
    }

    button {
        padding: 14px;
    }*/
}

/* ----------------------------- */
/* ✨ Animations d'apparition */
/* ----------------------------- */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(25px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Appliquer l'animation sur les pages de login et register */
.login-container,
.register-container,
.verify-container,
.dashboard-container{
    animation: fadeUp 0.6s ease-out;
}

.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}


.popup-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 15px 20px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* header flex pour aligner titre et bouton fermer sur la même ligne */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-content h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

/* bouton fermer compact à droite */
.popup-close {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    padding: 0;
    line-height: 1;
}

.popup-close:hover {
    background: none;
    
}

/* tableau responsive */
.popup-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95em;
    table-layout: auto;
}

.popup-table td {
    padding: 8px 5px;
    vertical-align: top;
}

.popup-table td.label {
    font-weight: bold;
    color: #444;
    width: 35%;
}

.popup-table td.value {
    color: #222;
    width: 65%;
    word-wrap: break-word;
}

.popup-table tr:not(:last-child) td {
    border-bottom: 1px solid #eee;
}

/* Adaptation mobile */
@media (max-width: 480px) {
    .popup-content {
        padding: 10px 15px;
    }
    .popup-table td.label,
    .popup-table td.value {
        display: block;
        width: 100%;
        padding: 5px 0;
    }
    .popup-table td.label {
        margin-top: 10px;
    }
    .popup-header {
        flex-direction: row; /* titre + bouton sur la même ligne */
    }
}
