/* ============================================================
   PALETTE COULEURS
   ------------------------------------------------------------
   Primary              #273747
   Primary dark         #1B2731
   Primary soft         #E4E8EC
   Secondary            #0399A8
   Secondary soft       #E6F9FB
   ============================================================ */

/* ============================================================
   GÉNÉRAL
   ============================================================ */

.egovt-salles-resa {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0 0 40px;
}

.elementor .elementor-section.elementor-element-daee2a2 {
    margin-bottom: 40px !important;
}

.egovt-salles-resa-inner {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
    padding: 1.75rem 1.75rem 2rem;
}

/* ============================================================
   STEP HEADER (RESPONSIVE)
   ============================================================ */

.egovt-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.egovt-step {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.egovt-step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: #e5e7eb;
    font-weight: 600;
    font-size: 0.85rem;
    padding-bottom: 3px;
}

/* Actif */
.egovt-step.is-active {
    background: #273747;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(39, 55, 71, 0.35);
}
.egovt-step.is-active .egovt-step-index {
    background: #1B2731;
    color: #ffffff;
}

/* Complété */
.egovt-step.is-completed {
    background: #E6F9FB;
    color: #074B52;
}
.egovt-step.is-completed .egovt-step-index {
    background: #0399A8;
    color: #012329;
}

/* Tablette → 2 colonnes */
@media (max-width: 900px) {
    .egovt-step {
        flex: 1 1 calc(50% - 0.75rem);
    }
}

/* Mobile → 1 colonne */
@media (max-width: 600px) {
    .egovt-step {
        flex: 1 1 100%;
        font-size: 0.8rem;
        padding: 0.55rem 0.8rem;
    }
    .egovt-step-index {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
    }
}

/* ============================================================
   PANELS
   ============================================================ */

.egovt-step-panel {
    display: none;
}
.egovt-step-panel.is-active {
    display: block;
}

.egovt-step-panel h2 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    color: #111827;
}

.egovt-step-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

/* ============================================================
   STEP 2 : LAYOUT DATES & CRENEAU
   ============================================================ */

.egovt-dates-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.egovt-dates-calendar,
.egovt-dates-slot {
    flex: 1 1 0;
    min-width: 260px;
}

/* Mobile : on passe en colonne */
@media (max-width: 800px) {
    .egovt-dates-layout {
        flex-direction: column;
    }
}


/* ============================================================
   GRID PRINCIPALE
   ============================================================ */

.egovt-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .egovt-content-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   CARD SALLE
   ============================================================ */

.egovt-salles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.egovt-salle-card {
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    display: flex;
    flex-direction: column;
}

.egovt-salle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    background: #ffffff;
}

.egovt-salle-card.is-selected {
    border-color: #0399A8;
    background: #E6F9FB;
    box-shadow:
        0 0 0 1px rgba(3, 153, 168, 0.5),
        0 10px 25px rgba(39, 55, 71, 0.22);
}

.egovt-salle-card-image {
    position: relative;
    padding-bottom: 60%;
    background: #e5e7eb;
    overflow: hidden;
}

.egovt-salle-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.egovt-salle-card-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #9ca3af;
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

.egovt-salle-card-body {
    padding: 0.9rem 0.95rem 1rem;
}

.egovt-salle-title {
    font-size: 1rem;
    margin: 0 0 0.35rem;
    color: #111827;
}

.egovt-salle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 0.4rem;
}

.egovt-salle-meta span {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #E4E8EC;
}

/* Équipements */
.egovt-salle-equipements {
    list-style: none;
    padding: 0;
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    color: #4b5563;
}

.egovt-salle-equipements li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.egovt-eq-label {
    font-weight: 500;
    color: #273747;
}

.egovt-eq-detail {
    color: #6b7280;
}

/* ============================================================
   BOUTONS
   ============================================================ */

.egovt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.45rem 1.15rem;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.egovt-btn-primary {
    background: #273747;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(39, 55, 71, 0.35);
}
.egovt-btn-primary:hover {
    background: #1B2731;
    box-shadow: 0 10px 25px rgba(39, 55, 71, 0.45);
    transform: translateY(-1px);
}

.egovt-btn-outline {
    background: transparent;
    color: #273747;
    border: 1px solid rgba(3, 153, 168, 0.8);
}
.egovt-btn-outline:hover {
    background: rgba(3, 153, 168, 0.08);
}

.egovt-btn-ghost {
    background: transparent;
    color: #4b5563;
}
.egovt-btn-ghost:hover {
    background: #f3f4f6;
}

.egovt-btn[disabled],
.egovt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Actions de step (boutons dans les panels) */
.egovt-step-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Sur mobile, on cache ces boutons pour laisser la bottom nav gérer la nav */
@media (max-width: 900px) {
    .egovt-step-actions {
        display: none;
    }
}

/* ============================================================
   FORMULAIRES
   ============================================================ */

.egovt-field-group {
    margin-bottom: 1rem;
}

.egovt-field-group label {
    display: flex;
    font-size: 0.85rem;
    font-weight: 600;
    height: fit-content;
    color: #374151;
    margin-bottom: 0.35rem;
    align-items: center;
}

.egovt-input,
.egovt-textarea {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    background: #ffffff;
}

.egovt-textarea {
    border-radius: 0.9rem;
    resize: vertical;
}

.egovt-input:focus,
.egovt-textarea:focus {
    border-color: #0399A8;
    box-shadow: 0 0 0 1px rgba(3, 153, 168, 0.4);
    background: #f9fafb;
}

.egovt-field-help {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

/* Slots */
.egovt-slot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.egovt-slot-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    width: 100%;
    font-size: 0.85rem;
    cursor: pointer;
    background: #ffffff;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.egovt-slot-option input {
    accent-color: #273747;
}

.egovt-slot-option:hover {
    border-color: #0399A8;
    background: #E6F9FB;
}

/* Grid formulaire */
.egovt-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 0.75rem;
}

@media (max-width: 700px) {
    .egovt-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkbox */
.egovt-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #374151;
}

.egovt-checkbox input {
    margin-top: 0.15rem;
}

.iti.iti--allow-dropdown.iti--show-flags {
    width: 100% !important;
}

/* ============================================================
   ALERTES
   ============================================================ */

.egovt-alert {
    border-radius: 0.75rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.egovt-alert-soft {
    background: #E4E8EC;
    color: #273747;
}

.egovt-alert-error {
    background: #fef2f2;
    color: #b91c1c;
}

/* ============================================================
   CALENDRIER INLINE FLATPICKR
   ============================================================ */

.egovt-calendar-inline {
    /* On laisse Flatpickr gérer sa largeur,
       on s'assure juste qu'il ne déborde pas */
    max-width: 100%;
}

/* On stylise seulement l'enveloppe, pas la largeur interne */
.egovt-calendar-inline .flatpickr-calendar.rangeMode.animate.inline {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

/* Header mois + nav */
.egovt-calendar-inline .flatpickr-months {
    background: #273747;
    color: #ffffff;
}

.egovt-calendar-inline .flatpickr-current-month {
    font-weight: 600;
}

.egovt-calendar-inline .flatpickr-weekdaycontainer .flatpickr-weekday {
    color: rgba(255, 255, 255, 0.85);
}

/* Flèches de navigation */
.egovt-calendar-inline .flatpickr-prev-month,
.egovt-calendar-inline .flatpickr-next-month {
    fill: #ffffff;
    color: #ffffff;
}

/* Jours par défaut */
.egovt-calendar-inline .flatpickr-day {
    border-radius: 8px;
    margin: 2px 0;
}

/* Jours aujourd'hui */
.egovt-calendar-inline .flatpickr-day.today {
    border-color: #0399A8;
}

/* Jours dans la plage sélectionnée */
.egovt-calendar-inline .flatpickr-day.inRange {
    background: rgba(39, 55, 71, 0.08);
    border-radius: 8px;
    color: #111827;
}

/* Début/fin de plage */
.egovt-calendar-inline .flatpickr-day.startRange,
.egovt-calendar-inline .flatpickr-day.endRange {
    background: #273747;
    color: #ffffff;
}

/* Hover */
.egovt-calendar-inline .flatpickr-day:hover {
    background: rgba(3, 153, 168, 0.15);
    border-color: transparent;
}

/* Jours désactivés */
.egovt-calendar-inline .flatpickr-day.disabled,
.egovt-calendar-inline .flatpickr-day.disabled:hover {
    color: #9ca3af;
    background: #f3f4f6;
    cursor: not-allowed;
}

/* Légende calendrier */
.egovt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    align-items: center;
    margin: 0.75rem 0 0; /* en bas du calendrier */
    font-size: 0.8rem;
    color: #4b5563;
}

.egovt-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.egovt-legend-item.is-hidden {
    display: none;
}

.egovt-legend-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

/* pleine journée */
.egovt-legend-full {
    background: rgba(248, 113, 113, 0.9);
}

/* matin réservé */
.egovt-legend-morning {
    background: linear-gradient(
        to bottom,
        rgba(248, 113, 113, 0.8) 0%,
        rgba(248, 113, 113, 0.8) 50%,
        transparent 50%,
        transparent 100%
    );
}

/* après-midi réservé */
.egovt-legend-afternoon {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(248, 113, 113, 0.8) 50%,
        rgba(248, 113, 113, 0.8) 100%
    );
}

/* Indicateurs demi-journée dans le calendrier Flatpickr */
.flatpickr-day.egovt-day-morning-booked {
    background: linear-gradient(
        to bottom,
        rgba(248, 113, 113, 0.7) 0%,
        rgba(248, 113, 113, 0.7) 50%,
        transparent 50%,
        transparent 100%
    );
    color: #111827;
}

.flatpickr-day.egovt-day-afternoon-booked {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(248, 113, 113, 0.7) 50%,
        rgba(248, 113, 113, 0.7) 100%
    );
    color: #111827;
}

.flatpickr-day.egovt-day-full-booked {
    background: rgba(248, 113, 113, 0.9);
    color: #ffffff;
}

/* Bordure quand sélectionnée + demi-journée marquée */
.flatpickr-day.egovt-day-morning-booked.selected,
.flatpickr-day.egovt-day-afternoon-booked.selected {
    box-shadow: 0 0 0 1px #273747 inset;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.egovt-sidebar {
    font-size: 0.9rem;
}

.egovt-sidebar-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

.egovt-sidebar-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #273747;
}

.egovt-sidebar-section + .egovt-sidebar-section {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px dashed #e5e7eb;
}

.egovt-sidebar-section h4 {
    margin: 0 0 0.15rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.egovt-summary-muted {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ============================================================
   CONFIRMATION
   ============================================================ */

.egovt-confirmation {
    background: #ecfdf3;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
    color: #14532d;
}

.egovt-confirmation p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   BOTTOM NAV MOBILE
   ============================================================ */

.egovt-bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    .egovt-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.15);
        padding: 0.6rem 0.9rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .egovt-bottom-step-info {
        flex: 1 1 auto;
        min-width: 0;
    }

    .egovt-bottom-step-label {
        font-size: 0.8rem;
        font-weight: 600;
        color: #273747;
        margin-bottom: 0.15rem;
    }

    .egovt-bottom-step-instruction {
        font-size: 0.78rem;
        color: #4b5563;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .egovt-bottom-step-actions {
        flex-shrink: 0;
        display: flex;
        gap: 0.4rem;
    }

    .egovt-bottom-step-actions .egovt-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    /* On ajoute un peu de marge en bas du contenu pour ne pas masquer la fin */
    .egovt-salles-resa-inner {
        padding-bottom: 3.5rem;
    }
}

/* ====== Anti-zoom iOS sur les champs ====== */
@media screen and (max-width: 600px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px !important;
    }
}
