/* Modern Normalize */

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

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    width: 100%;
}

img {
    max-width: 100%;
    display: block;
}

@font-face {
    font-display: swap;
    font-family: "Readex Pro";
    font-style: normal;
    font-weight: 400;
    src: url('/font/Readex-Pro/readex-pro-v27-latin-regular.woff2') format("woff2");
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

/* Font / Body */
body {
    background-color: #353B37;
    color: #c8f7dc;
    display: flex;
    flex-direction: column;
    font-family: "Readex Pro", sans-serif;
    font-size: 0.875rem;
    margin: 0;
    width: 100%;
}

.site-header {
    background-color: #252B27;
    background-image: url("../img/background.png");
    background-repeat: repeat;
    background-size: 30%;
    padding: 35px;
    width: 100%;
}

.header-container {
    margin: 0 auto;
    max-width: 1000px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-name {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #c8f7dc;
    white-space: nowrap;
}

.brand-separator {
    height: 2px;
    width: 215px;
    background: rgba(200, 247, 220, 0.25);
    border-radius: 999px;
}

.brand-page {
    font-size: 2rem;
    font-weight: 700;
    color: #9fdcc0;
    opacity: 0.95;
}

.navbar {
    display: flex;
    gap: 40px;
}

.navbar div {
    display: none;
}

.navbar a {
    text-decoration: none;
    color: #0b0f0c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    white-space: nowrap;

    background-color: #4caf78;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    padding: 10px 30px;
    cursor: pointer;
}

.navbar a:hover,
.navbar a:active {
    background-color: #c8f7dc;
    color: #0b0f0c;
}


.container {
    margin: auto;
    max-width: 1000px;
}

.form-container {
    justify-content: center;
    display: flex;
    margin: auto;
    max-width: 1000px;
}

.site-main {
    background-color: #353B37;
    background-image: url("../img/background.png");
    background-repeat: repeat;
    background-size: 20%;
    flex: 1;
    padding: 35px;
}

.site-main-form {
    background-color: #353B37;
    background-image: url("../img/background.png");
    background-repeat: repeat;
    background-size: 30%;
    flex: 1;
}

h1 {
    font-size: 2.5rem;
    margin: 0 0 40px 0;
}

h2 {
    font-size: 2rem;
    margin: 20px 0;
}

.dashboard {
    display: flex;
    gap: 30px;
    margin: 0;
}

.card {
    background-color: #1a3a2a;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 20px;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 120px;
}

.dashboard-card .card-label {
    font-size: 1rem;
    opacity: 0.85;
}

.dashboard-card .card-value {
    font-size: 3rem;
    font-weight: 700;
    margin-top: 0.3rem;
}


/* Tables */
table {
    border-collapse: collapse;
    background-color: #1a3a2a;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    width: 100%;
}

thead {
    background-color: #13422d;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
}

th {
    color: #c8f7dc;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

td {
    color: #c8f7dc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

table .actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

table .actions form {
    margin: 0;
}

table .actions .sep {
    opacity: 0.6;
}


tbody tr:last-child th {
    border-bottom: none;
}

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

/* Bouton voir */
table a {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4caf78;
    color: #0b0f0c;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

table a:hover,
table a:active {
    background-color: #c8f7dc;
    color: #0b0f0c;
}

table .delete_button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4caf78;
    color: #0b0f0c;
    border-radius: 6px;
    font-weight: 600;

    border: none;
    cursor: pointer;

    font-family: inherit;
    font-size: inherit;
    line-height: 1.2;
    vertical-align: middle;

    appearance: none;
    -webkit-appearance: none;
    background-clip: padding-box;

    transition: background-color 0.2s ease, color 0.2s ease;
}


table .delete_button:hover,
table .delete_button:active {
    background-color: #ff3609;
    color: #0b0f0c;
}

/* Sections Actions */
.action-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background-color: #4caf78;
    color: black;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: #c8f7dc;
}

.action-danger:hover {
    background-color: #ff3609;
}

.action-info form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}


.action-info select {
    padding: 4px 6px;
    border-radius: 6px;
}


.warning {
    margin-top: 10px;
    font-style: italic;
}

section h3 + p {
    margin-top: 10px;
}

section p {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Liens d'action (Modifier / Supprimer / Inscrire,) */
section p a {
    display: inline-block;
    padding: 8px 14px;
    background-color: #13422d;
    color: #c8f7dc;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

section p a:hover {
    background-color: #2ecc71;
    color: #0b0f0c;
    text-decoration: none;
}

/* Lien retour */
section p a:last-child[href^="categories"],
section p a:last-child[href^="membres"],
section p a:last-child[href^="cours"] {
    background-color: transparent;
    color: #c8f7dc;
    padding: 0;
    font-weight: 500;
}

section p a:last-child:hover[href^="categories"],
section p a:last-child:hover[href^="membres"],
section p a:last-child:hover[href^="cours"] {
    background-color: transparent;
    color: grey;
    padding: 0;
    font-weight: 500;
}

/* Select */
.select-clean {
    min-width: 0;
    padding: 6px 10px;
    border-radius: 6px;
    border: 2px solid #13422d;
    background-color: #c8f7dc;
    font-weight: 500;
    color: #0b0f0c;
    cursor: pointer;
}

.select-clean:focus {
    outline: none;
    border-color: #13422d;
    background-color: #c8f7dc;
}

/* désinscription */
.action-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.action-form label {
    font-weight: 600;
}

.action-form select {
    font-family: inherit;
}

/* Formulaires */
.form-card {
    padding: 22px;
    margin: 30px 0;
    width: 300px;
}

.pp-form {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pp-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-form-row label {
    font-weight: 700;
}

.pp-form input[type="text"],
.pp-form input[type="email"],
.pp-form input[type="number"],
.pp-form input[type="datetime-local"],
.pp-form textarea,
.pp-form select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #13422d;
    background-color: #c8f7dc;
    color: #0b0f0c;
    font-weight: 500;
    font-family: inherit;
}

.pp-form textarea {
    resize: vertical;
    min-height: 120px;
    text-align: left;
}

.pp-form input:focus,
.pp-form textarea:focus,
.pp-form select:focus {
    outline: none;
    border-color: #13422d;
    background-color: #c8f7dc;
}

.pp-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 6px;
}

.action-ghost {
    background-color: #4caf78;
    border: 2px solid #13422d;
    color: black;
}

.action-ghost:hover {
    background-color: #c8f7dc;
}

/* Inputs validation */

.pp-form-row input:valid,
.pp-form-row select:valid{
    border-left: 4px solid #218838;
}

.pp-form-row input:invalid,
.pp-form-row select:invalid {
    border-left: 4px solid #c82333;
}

/* Supprimer flèches input number */

/* Chrome, Edge, Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

/* Footer */

.site-footer {
    background-color: #252B27;
    background-image: url("../img/background.png");
    background-repeat: repeat;
    background-size: 30%;
    padding: 35px;
    color: #9fdcc0;
    font-size: 0.85rem;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

/*infos adresse / contact */
.footer-info p {
    margin: 0;
    line-height: 1.5;
}

.footer-info strong {
    font-size: 1rem;
    color: #c8f7dc;
}

/* horaires */
.footer-hours p {
    margin: 0;
    line-height: 1.5;
}

.footer-hours strong {
    font-size: 0.95rem;
    color: #c8f7dc;
}

/* --- Toast --- */
.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(37, 43, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #c8f7dc;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    z-index: 9999;

    opacity: 0;
    transform: translateY(10px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success {
    border-left: 4px solid rgba(76, 175, 120, 0.9);
}

.toast--error {
    border-left: 4px solid rgba(231, 76, 60, 0.9);
    color: #ffd7d7;
}

/* --- Confirm dialog --- */
.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.confirm-dialog {
    border: none;
    border-radius: 14px;
    padding: 0;
    background: rgba(37, 43, 39, 0.95);
    color: #c8f7dc;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.confirm-content {
    padding: 22px 24px;
    text-align: center;
    min-width: 320px;
}

.confirm-icon {
    justify-content: center;
    width: 260px;
    height: 120px;
    margin-bottom: 12px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.confirm-actions button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.confirm-actions [data-confirm] {
    background: #c0392b;
    color: black;
}

.confirm-actions [data-cancel] {
    background: rgba(76, 175, 120, 0.9);
    color: #0b0f0d;
}



@media (width >= 670px) and (width <= 950px) {

    .site-header {
        background-color: #252B27;
        padding: 25px 18px;
        width: 100%;
    }

    .header-container {
        max-width: 1000px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 18px;
    }

    .brand {
        align-items: center;
        text-align: center;
    }

    .brand-name {
        font-size: 2.1rem;
        font-weight: 900;
        letter-spacing: 1px;
        color: #c8f7dc;
        white-space: nowrap;
    }

    .brand-name br {
        display: none;
    }

    .brand-separator {
        width: 260px;
    }

    .brand-page {
        font-size: 1.6rem;
    }

    .navbar {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 14px;
        flex-wrap: wrap;
    }

    .navbar a {
        padding: 10px 18px;
        font-size: 1rem;
    }

    table .actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    table .actions .sep {
        display: none;
    }

    table .actions a,
    table .actions .delete_button {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .form-card {
        margin: 30px 0;
    }
}


@media (width >= 300px) and (width <= 670px) {

    .site-main {
        padding: 15px;
    }

    .header-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    .brand {
        align-items: center;
        text-align: center;
    }

    .brand-name {
        white-space: nowrap;
    }

    .brand-name br {
        display: none;
    }

    .navbar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .navbar a {
        width: calc(50% - 6px);
        justify-content: center;
        text-align: center;
        padding: 10px 0;
    }

    .dashboard {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .dashboard .dashboard-card {
        width: calc(50% - 7px);
        min-width: 150px;
    }

    h1, h2 {
        text-align: center;
    }

    /* Compactage table */

    table {
        font-size: 0.7rem;
    }

    th {
        font-size: 0.7rem;
        padding: 6px 6px;
    }

    td {
        padding: 6px 6px;
        line-height: 1.2;
    }

    table .actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    table .actions .sep {
        display: none;
    }

    table .actions a,
    table .actions .delete_button {
        width: 100%;
        text-align: center;
        padding: 6px 10px;
        font-size: 0.7rem;
        border-radius: 10px;
    }

    .form-card {
        margin: 30px 0;
    }
}






