
/* =====================================================
   VARIABLES
===================================================== */

:root {
    --primary: #263746;
    --primary-hover: #354b60;
    --accent: #bdf36b;
    --background: #f5f6f8;
    --white: #ffffff;
    --text: #222831;
    --muted: #747d87;
    --border: #e3e7eb;
    --success: #1d7b47;
    --danger: #b42323;
    --radius: 14px;
}

/* =====================================================
   BASE
===================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.header {
    background: var(--primary);
    color: var(--white);
    padding: 24px 20px;
}

.header-content {
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.header p {
    margin: 5px 0 0;
    color: #d5dce3;
    font-size: 14px;
}

.admin-link {
    display: inline-block;
    padding: 9px 15px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    transition: .2s;
}

.admin-link:hover {
    background: rgba(255,255,255,.1);
}

/* =====================================================
   CONTAINER
===================================================== */

.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

/* =====================================================
   CALENDAR SECTION
===================================================== */

.calendar-section {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 4px 18px rgba(0,0,0,.04);
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-navigation h2 {
    margin: 0;
    font-size: 23px;
    text-transform: capitalize;
    text-align: center;
}

.calendar-navigation button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--primary);
    font-size: 25px;
    line-height: 1;
    transition: .2s;
}

.calendar-navigation button:hover {
    background: var(--primary);
    color: white;
}

/* =====================================================
   JOURS DE LA SEMAINE
===================================================== */

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 8px 0;
}

/* =====================================================
   GRILLE CALENDRIER
===================================================== */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-day {
    min-height: 90px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 10px;
    color: var(--text);
    transition: .2s;
}

.calendar-day:not(.empty-day):hover {
    border-color: var(--primary);
    background: #f7f9fb;
}

.calendar-day.empty-day {
    border: none;
    background: transparent;
    cursor: default;
}

.day-number {
    font-size: 14px;
    font-weight: 600;
}

.calendar-day.has-slots {
    border-color: #d5e9b7;
    background: #f7fbed;
}

.calendar-day.has-slots:hover {
    background: #eef8dd;
}

.day-indicator {
    display: none;
}

.day-count {
    font-size: 11px;
    color: #527c29;
    margin-top: 3px;
}

.calendar-day.today {
    border: 2px solid var(--primary);
}

.calendar-day.selected-day {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.calendar-day.selected-day .day-indicator {
    background: var(--accent);
}

.calendar-day.selected-day .day-count {
    color: white;
}


/* =====================================================
   CRENEAUX
===================================================== */

.slots-section {
    margin-top: 30px;
}

.slots-section h2 {
    margin-bottom: 20px;
    font-size: 22px;
    text-transform: capitalize;
}

.slot-card {
    background: var(--white);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 15px;
    box-shadow: 0 3px 12px rgba(0,0,0,.03);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.slot-header h3 {
    margin: 0;
    font-size: 18px;
}

.slot-time {
    display: inline-block;
    background: #eef1f5;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
}

.slot-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
    color: var(--muted);
    font-size: 13px;
}

/* =====================================================
   BOUTON INSCRIPTION
===================================================== */

.inscription-button {
    display: inline-block;
    width: 100%;
    padding: 13px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 9px;
    font-weight: 700;
    transition: .2s;
}

.inscription-button:hover {
    background: var(--primary-hover);
}

.inscription-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* =====================================================
   ADMIN : BENEVOLES
===================================================== */

.admin-volunteers {
    background: #f6f7f9;
    padding: 14px;
    margin-top: 15px;
    border-radius: 8px;
    font-size: 13px;
}

.admin-volunteers div {
    padding: 5px 0;
}

/* =====================================================
   MESSAGES
===================================================== */

.empty-message {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    color: var(--muted);
    border: 1px solid var(--border);
}

/* =====================================================
   MODAL
===================================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 35, .6);
    padding: 20px;
    overflow-y: auto;
}

.modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: 16px;
    margin: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,.2);
}

.modal-content h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.modal-content p {
    color: var(--muted);
    font-size: 14px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

/* =====================================================
   FORMULAIRE
===================================================== */

.form-group {
    margin-top: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    outline: none;
    background: white;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(38,55,70,.08);
}

.required-note {
    font-size: 12px !important;
    margin-top: 15px;
}

.submit-button {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    border: none;
    border-radius: 9px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.submit-button:hover {
    background: var(--primary-hover);
}

.submit-button:disabled {
    opacity: .6;
    cursor: wait;
}

/* =====================================================
   MESSAGE FORMULAIRE
===================================================== */

.form-message {
    display: none;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 13px;
}

.form-message.success {
    display: block;
    background: #e2f5e8;
    color: var(--success);
}

.form-message.error {
    display: block;
    background: #fde8e8;
    color: var(--danger);
}

/* =====================================================
   RESPONSIVE TABLETTE
===================================================== */

@media (max-width: 768px) {

    .container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .header {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 21px;
    }

    .calendar-section {
        padding: 15px;
    }

    .calendar-grid,
    .calendar-weekdays {
        gap: 4px;
    }

    .calendar-day {
        min-height: 65px;
        padding: 6px;
        border-radius: 7px;
    }

    .day-number {
        font-size: 12px;
    }

    .day-count {
        font-size: 9px;
    }

    .calendar-navigation h2 {
        font-size: 19px;
    }

    .calendar-navigation button {
        width: 35px;
        height: 35px;
    }
}

/* =====================================================
   RESPONSIVE MOBILE
===================================================== */

@media (max-width: 480px) {

    body {
        font-size: 14px;
    }

    .header-content {
        align-items: flex-start;
    }

    .admin-link {
        font-size: 11px;
        padding: 7px 10px;
    }

    .calendar-weekdays div {
        font-size: 10px;
    }

    .calendar-day {
        min-height: 52px;
        padding: 5px;
    }

    .day-indicator {
        width: 5px;
        height: 5px;
        margin-top: 5px;
    }

    .day-count {
        font-size: 8px;
    }

    .calendar-legend {
        font-size: 11px;
    }

    .slot-card {
        padding: 16px;
    }

    .slot-header h3 {
        font-size: 16px;
    }

    .slot-info {
        font-size: 12px;
    }

    .modal {
        padding: 12px;
    }

    .modal-content {
        padding: 22px 18px;
    }
}
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    padding: 6px 8px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
@media (max-width: 600px) {

    .calendar-day {
        min-width: 0;
        overflow: hidden;
    }

    .availability-badge {
        font-size: 9px;
        padding: 4px 2px;
        width: 100%;
        box-sizing: border-box;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .calendar-day.has-slots {
        min-height: 100px;
    }

}
/* CALENDRIER : CASES UNIFORMES SUR MOBILE */
@media (max-width: 600px) {

    .calendar-day {
        height: 100px !important;
        min-height: 100px !important;
        max-height: 100px !important;
        box-sizing: border-box;
        overflow: hidden;
        padding: 8px;
    }

    .day-number {
        color: #263746 !important;
        font-weight: 700;
    }

    .availability-badge {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 10px;
        line-height: 1.2;
        padding: 4px 2px;
        overflow-wrap: anywhere;
        word-break: normal;
    }

}
/* Badge créneau : ordinateur */
.badge-mobile {
    display: none;
}

/* Badge créneau : téléphone */
@media (max-width: 600px) {

    .badge-desktop {
        display: none;
    }

    .badge-mobile {
        display: inline;
        font-size: 11px;
        white-space: nowrap;
    }

    .availability-badge {
        width: auto;
        max-width: 100%;
        padding: 5px 7px;
        box-sizing: border-box;
    }
}
/* BADGE RESPONSIVE */

.badge-desktop {
    display: inline;
}

.badge-mobile {
    display: none;
}

@media screen and (max-width: 600px) {

    .badge-desktop {
        display: none !important;
    }

    .badge-mobile {
        display: inline-block !important;
        white-space: nowrap;
        font-size: 11px;
    }

    .availability-badge {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 5px !important;
        box-sizing: border-box;
        overflow: hidden;
    }
}@media screen and (max-width: 600px) {

    .calendar-day {
        height: 75px !important;
        min-height: 75px !important;
        max-height: 75px !important;
        padding: 6px !important;
        box-sizing: border-box;
    }

}
@media screen and (max-width: 600px) {

    .availability-badge {
        font-size: 0 !important;
        width: 32px !important;
        height: 28px !important;
        padding: 4px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .badge-mobile {
        font-size: 11px !important;
        display: inline-block !important;
        white-space: nowrap !important;
    }

    .badge-desktop {
        display: none !important;
    }

}
/* Légende disponible uniquement sur iPhone */
.calendar-legend-mobile {
    display: none;
}

@media (max-width: 600px) {
    .calendar-legend-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
        font-size: 12px;
        color: #263746;
    }

    .legend-square {
        width: 12px;
        height: 12px;
        background: #bdf36b;
        border-radius: 3px;
        display: inline-block;
        flex-shrink: 0;
    }
}