/* ---- RESET + BASE ---- */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 16px;
    background: #f7f7f7;
    color: #232323;
    min-height: 100vh;
}
body {
    padding: 40px 0;
}
a { color: #A94673; text-decoration: none; }
a:hover { text-decoration: underline; }

.container, .form-container {
    max-width: 1400px;
    margin: auto;
    background: #fff;
    padding: 32px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 32px 0 rgba(0,0,0,0.04);
    margin-bottom: 30px;
}

/* --- Patient List / Table Large --- */
main {
    max-width: 1400px;
    margin: 35px auto 0 auto;
    padding: 0 32px;
}
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 18px #0001;
    padding: 0;
}
table {
    border-collapse: collapse;
    width: 100%;
    background: transparent;
    margin-bottom: 0;
}
th, td {
    padding: 13px 10px;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}
th {
    background: #f5f7fa;
    color: #A94673;
    font-weight: bold;
    font-size: 16px;
    border: none;
}
tr:nth-child(even) { background: #f6fafd; }
tr:hover { background: #eaf4fb; }

/* --- Recherche & Ajout patient --- */
.searchbar-row {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}
.search-input {
    padding: 12px 16px;
    border-radius: 6px;
    border: 1.3px solid #f0d4e3;
    font-size: 16px;
    width: 360px;
    background: #fff;
    box-shadow: 0 1px 8px #f0d4e322;
    transition: border .16s;
}
.search-input:focus {
    border-color: #A94673;
    outline: none;
    background: #fdf9fb;
}
.add-btn {
    font-size: 17px;
    padding: 12px 25px;
    font-weight: bold;
    box-shadow: 0 3px 10px #A9467322;
    margin-left: 8px;
}
@media (max-width: 900px) {
    main { padding: 0 8px; }
    .searchbar-row { flex-direction: column; gap: 10px; align-items: stretch; }
    .search-input { width: 100%; }
}

/* --- Boutons actions patients --- */
.action-btn {
    font-size: 14px;
    padding: 8px 16px;
    margin-right: 3px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 6px #A9467322;
    background: #A94673;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    transition: background 0.13s;
}
.action-btn:hover { background: #8a3760; }
.action-btn.danger, .danger {
    background: #e74c3c !important;
    color: #fff !important;
}
.action-btn:last-child { margin-right: 0; }

/* --- Barre d’infos et navigation --- */
.user-info {
    background: #dfe6e9;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 6px;
    color: #333;
    margin: 35px auto 0 auto;
    max-width: 1400px;
}
.topnav {
    margin: 35px auto 0 auto;
    max-width: 1400px;
}
.topnav .button {
    font-size: 17px;
    padding: 12px 26px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 3px 10px #A9467322;
}

/* ---- BOUTONS GÉNÉRIQUES UNIFORMES (bleu, vert, rouge) ---- */
.button, .action-btn, .add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 28px;
    background: #A94673;
    color: #fff !important;
    border: none;
    border-radius: 10px !important;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 3px 15px #A9467312;
    text-decoration: none !important;
    justify-content: center;
    text-align: center;
}
.button:hover, .action-btn:hover, .add-btn:hover {
    background: #8a3760;
    color: #fff !important;
    transform: translateY(-2px) scale(1.025);
    box-shadow: 0 6px 24px #8a376024;
}
.button.danger, .action-btn.danger, .danger {
    background: #e74c3c !important;
    color: #fff !important;
}
.button.danger:hover, .action-btn.danger:hover, .danger:hover {
    background: #c0392b !important;
}
.button.bg-green, .bg-green {
    background: #27ae60 !important;
    color: #fff !important;
}
.button.bg-green:hover, .bg-green:hover {
    background: #219150 !important;
}

/* Disposition des groupes de boutons */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 18px;
    margin-bottom: 14px;
}

/* ---- GROS BOUTONS DU MENU PRINCIPAL ---- */
.menu {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 45px;
}
.menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 260px;
    padding: 20px 0;
    margin-bottom: 18px;
    background: #A94673;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 0 3px 15px #0001;
    border: none;
    transition: background 0.16s, box-shadow 0.16s, transform 0.12s;
    cursor: pointer;
    letter-spacing: 0.01em;
}
.menu a:hover {
    background: #8a3760;
    box-shadow: 0 4px 24px #0002;
    transform: translateY(-3px) scale(1.035);
}

/* Bouton de déconnexion style bouton, à placer après le menu */
.logout-btn {
    background: #f7cac9;
    color: #c0392b !important;
    font-weight: 500;
    margin: 30px auto 0 auto;
    min-width: 220px;
    border-radius: 10px;
    font-size: 18px;
    padding: 16px 0;
    box-shadow: 0 2px 10px #0001;
    border: none;
    display: block;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}
.logout-btn:hover {
    background: #e74c3c;
    color: #fff !important;
}

/* ---- DESIGN FORMULAIRE AJOUT PATIENT ---- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
    margin-top: 32px;
}
.form-grid > .full {
    grid-column: 1 / 3;
}
@media (max-width: 800px) {
    .form-grid { grid-template-columns: 1fr; gap: 16px; }
    .form-grid > .full { grid-column: 1 / 2; }
}
.form-grid label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: #232323;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccd7e6;
    padding: 10px 12px;
    margin-bottom: 0;
    background: #f9fafb;
    transition: border 0.16s;
    box-sizing: border-box;
}
.form-grid input[type="radio"] {
    width: auto;
    margin-right: 8px;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border: 1.5px solid #3498db;
    background: #fff;
    outline: none;
}
.form-grid textarea {
    min-height: 56px;
    resize: vertical;
}
.button, button[type="submit"] {
    margin-top: 18px;
}

/* ---- SPÉCIFIQUE / APPLI MÉDICALE ---- */
.bodymap-flex {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.img-col {
    min-width: 240px;
    max-width: 260px;
    position: relative;
    height: 500px;
}
.injury-fields {
    display: none;
    margin-bottom: 10px;
    border-left: 2px solid #3498db;
    padding-left: 12px;
}
.injury-fields.active {
    display: block;
}
.zone-btn {
    position: absolute;
    cursor: pointer;
    z-index: 3;
    background: rgba(0,0,0,0);
    /* debug: border:1px solid #aaa; */
}
@media (max-width: 700px) {
    .bodymap-flex { flex-direction: column; }
    .img-col { margin-bottom: 15px; }

    .menu a, .logout-btn {
        min-width: 95vw;
        font-size: 18px;
    }
}

/* -- Utilitaires hérités -- */
.bg-blue { background: #A94673; color: white; }
.bg-green { background: #27ae60; color: white; }
.bg-grey { background: #f9fafb; color: #333; }
.rounded { border-radius: 8px !important; }
.shadow { box-shadow: 0 2px 10px 0 rgba(0,0,0,0.09); }

.success {
    background: #d3f9d8;
    color: #219150;
    padding: 12px 17px;
    margin-bottom: 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border-left: 5px solid #27ae60;
}
.error {
    background: #ffe2e0;
    color: #e74c3c;
    padding: 12px 17px;
    margin-bottom: 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border-left: 5px solid #e74c3c;
}
.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: #3498db;
    font-size: 16px;
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { text-decoration: underline; }

/* ----------- LOGIN PAGE SPECIFIQUE ----------- */
/* ----------- LOGIN PAGE (SAMR) ----------- */
.login-container {
    max-width: 400px;
    margin: 70px auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 32px #3498db10;
    padding: 38px 28px 30px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-img {
    max-width: 220px;
    border-radius: 12px;
    box-shadow: 0 4px 24px #0002;
    margin-bottom: 26px;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 13px 1px;
    border-radius: 7px;
    border: 1.2px solid #bcdffb;
    background: #f8fbfd;
    font-size: 1rem;
    margin-bottom: 0;
    transition: border 0.16s, box-shadow 0.15s;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: #3498db;
    outline: none;
    background: #fff;
    box-shadow: 0 2px 12px #3498db18;
}

.login-btn {
    width: 100%;
    font-size: 18px;
    margin-top: 7px;
}

.error {
    background: #ffe2e0;
    color: #e74c3c;
    padding: 12px 17px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border-left: 5px solid #e74c3c;
    width: 100%;
    text-align: left;
}

@media (max-width: 500px) {
    .login-container {
        padding: 22px 4vw 18px 4vw;
    }
    .login-img {
        max-width: 98vw;
    }
}
