/* Carrefour de l'eau - Réservations : styles publics.
   Palette neutre pilotée par variables — surchargez-les dans le thème. */

.cde-booking {
    --cde-primary: #0e7490;
    --cde-primary-dark: #155e75;
    --cde-surface: #ffffff;
    --cde-border: #d1d5db;
    --cde-text: #1f2937;
    --cde-muted: #6b7280;

    max-width: 860px;
    margin: 0 auto;
    color: var(--cde-text);
}

.cde-booking-header h2 {
    margin-bottom: 0.25em;
}

.cde-booking-header p {
    color: var(--cde-muted);
}

.cde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
    margin: 20px 0;
}

.cde-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
}

.cde-field input,
.cde-field select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--cde-border);
    border-radius: 6px;
    background: var(--cde-surface);
    font: inherit;
}

.cde-field input:focus,
.cde-field select:focus {
    outline: 2px solid var(--cde-primary);
    outline-offset: 1px;
}

/* Champ leurre anti-pourriel : hors écran, invisible pour les humains */
.cde-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Calendrier */
.cde-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cde-cal-title {
    font-weight: 700;
    text-transform: capitalize;
}

.cde-cal-nav button {
    border: 1px solid var(--cde-border);
    background: var(--cde-surface);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
}

.cde-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cde-cal-head {
    text-align: center;
    font-weight: 700;
    font-size: 0.8em;
    color: var(--cde-muted);
    padding: 4px 0;
}

.cde-cal-day {
    position: relative;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font: inherit;
    border: 1px solid transparent;
}

.cde-cal-day.is-off {
    color: var(--cde-muted);
    opacity: 0.45;
}

.cde-cal-day.is-available {
    border-color: var(--cde-border);
    background: var(--cde-surface);
    cursor: pointer;
}

.cde-cal-day.is-available:hover {
    border-color: var(--cde-primary);
}

.cde-cal-day.is-selected {
    background: var(--cde-primary);
    border-color: var(--cde-primary);
    color: #fff;
}

.cde-cal-count {
    font-size: 0.7em;
    color: inherit;
    opacity: 0.8;
}

/* Créneaux */
.cde-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin: 12px 0 20px;
}

.cde-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    border: 1px solid var(--cde-border);
    border-radius: 6px;
    background: var(--cde-surface);
    cursor: pointer;
    font: inherit;
}

.cde-slot:hover {
    border-color: var(--cde-primary);
}

.cde-slot.is-selected {
    background: var(--cde-primary);
    border-color: var(--cde-primary);
    color: #fff;
}

.cde-slot-time {
    font-weight: 700;
}

.cde-slot-remaining {
    font-size: 0.8em;
    opacity: 0.8;
}

/* Soumission et messages */
.cde-actions {
    margin-top: 8px;
}

.cde-submit {
    padding: 10px 28px;
    border: none;
    border-radius: 6px;
    background: var(--cde-primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.cde-submit:hover:not(:disabled) {
    background: var(--cde-primary-dark);
}

.cde-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cde-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
}

.cde-message-success {
    background: #d1e7dd;
    color: #0f5132;
}

.cde-message-error {
    background: #f8d7da;
    color: #842029;
}

.cde-loading {
    color: var(--cde-muted);
}
