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

.clickable {
    cursor: pointer;
}

body {
    font-family: 'Arial', sans-serif;
}

/* =========================
   PAGE LOGIN
========================= */
body.login {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 360px;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

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

.logo {
    width: 110px;
    margin-bottom: 20px;
    border-radius: 50%;
}

h2 {
    color: #333;
    margin-bottom: 10px;
}

.subheading {
    color: #555;
    margin-bottom: 30px;
}

/* INPUT + LABEL FLOTTANT */
.input-group {
    position: relative;
    margin-bottom: 28px;
}

.input-group input {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: 0.3s;
    outline: none;
    background: white;
}

.input-group input:focus {
    border-color: #2575fc;
}

.input-group input::placeholder {
    color: transparent; /* Nécessaire pour :placeholder-shown */
}

.input-group label {
    position: absolute;
    left: 12px;
    top: 14px;
    color: #777;
    font-size: 16px;
    pointer-events: none;
    transition: 0.3s ease;
    background: white;
    padding: 0 6px;
}

/* Le label flotte si focus ou si rempli */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -8px;
    left: 10px;
    font-size: 12px;
    color: #2575fc;
}

.login-btn, .btnPass {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background-color: #2575fc;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.login-btn:hover, .btnPass:hover {
    background-color: #6a11cb;
}

.message {
    margin-top: 15px;
    color: red;
    font-size: 0.95em;
}

/* SELECT FLOTTANT PAR DÉFAUT */
.input-group select {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: 0.3s;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%23777' d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px; /* espace pour la flèche */
}

/* Floating label */
.input-group select:focus + label,
.input-group select:not([value=""]) + label,
.input-group select option:checked + label {
    top: -8px;
    left: 10px;
    font-size: 12px;
    color: #2575fc;
}

/* Label par défaut à l’intérieur */
.input-group select + label {
    position: absolute;
    left: 12px;
    top: 14px;
    color: #777;
    font-size: 16px;
    pointer-events: none;
    background: white;
    padding: 0 6px;
    transition: 0.3s ease;
}

/* Option placeholder gris */
.input-group select option[value=""] {
    color: #999;
}


/* =========================
   DASHBOARD / DOWNLOAD
========================= */
body.download, body.dashboard {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    min-height: 100vh;
    padding: 400;
    font-family: Arial, sans-serif;
    color: #222;
}

.page-box {
    max-width: 1200px;
    margin: 0px auto;
    padding: 20px;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

header {
    text-align: center;
    padding: 30px 10px;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 600;
}

header p {
    margin: 5px 0 0 0;
    font-size: 1.2em;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

/* CARD */
.card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.10);
    transition: transform 0.25s ease, box-shadow 0.25s;
    cursor: default;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card.clickable {
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.18);
}

.card-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.card-content h2, .card-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    color: #2575fc;
    word-break: break-word;
}

.card-content p {
    margin: 0;
    color: #555;
    font-size: 0.95em;
}

.btn, .download-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    background: #4da6ff;
    color: #000;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    transition: 0.2s;
    text-align: center;
}

.btn:hover, .download-btn:hover {
    background: #7ec0ff;
}

/* CARD BACK */
.card-back {
    background-color: #2a2a30;
    color: #fff;
}

.back-link {
    text-decoration: none;
}


/* Section Admin */

.hidden {
    display: none;
}

.show {
    display: block;
}

/* =========================
   TABLEAU ADMIN
========================= */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: white;
    border-radius: 12px;
    overflow: hidden; /* arrondis aussi le header */
    font-size: 0.95em;
    box-shadow: 0 8px 25px rgba(0,0,0,0.10);
}

.admin-table thead {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    font-weight: bold;
}

.admin-table th,
.admin-table td {
    padding: 14px 18px;
    text-align: left;
}

.admin-table tbody tr {
    border-bottom: 1px solid #eeeeee;
    transition: background 0.25s;
}

.admin-table tbody tr:hover {
    background: rgba(100, 100, 255, 0.08);
}

/* Boutons dans le tableau */
.admin-table .btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: #4da6ff;
    color: #fff;
}

.btn-edit:hover {
    background: #7ec0ff;
}

.btn-delete {
    background: #ff4d4d;
    color: #fff;
}

.btn-delete:hover {
    background: #ff7777;
}

/* =========================
   QR CODE / SELECT CONTACT
========================= */

.qrcode-card {
    grid-column: span 2; /* plus large si possible */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 30px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: transform 0.25s ease, box-shadow 0.25s;
}

.qrcode-card h3 {
    margin-bottom: 20px;
    color: #2575fc;
    font-size: 1.4em;
    text-align: center;
}

.qrcode-card ul {
    list-style: none;
    width: 100%;
    padding: 0;
}

.qrcode-card ul li {
    margin-bottom: 12px;
}

.qrcode-card ul li a {
    display: block;
    padding: 10px 14px;
    background: #f0f0f0;
    border-radius: 8px;
    text-decoration: none;
    color: #222;
    font-weight: 500;
    transition: 0.3s;
}

.qrcode-card ul li a:hover {
    background: #4da6ff;
    color: #fff;
}

#qrcode {
    margin: 20px 0;
    padding: 10px;
    border: 2px dashed #2575fc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9ff;
}

#back-btn {
    padding: 10px 18px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background: #2575fc;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
}

#back-btn:hover {
    background: #6a11cb;
}

/* Pour mobile, QR code prend toute la largeur */
@media (max-width: 768px) {
    .qrcode-card {
        grid-column: span 1;
        padding: 20px;
    }
}

/* =========================
   FOOTER
========================= */

.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.site-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-footer p {
    margin: 0 0 10px 0;
    font-size: 0.95em;
}

.site-footer .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.site-footer .footer-links li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.site-footer .footer-links li a:hover {
    color: #ffdd57;
    text-decoration: underline;
}

/* Responsive footer */
@media (max-width: 768px) {
    .site-footer .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}
