/* ================================================================
   Maison Bleue – Formulaire Frontend
   ================================================================ */

:root {
    --mb-primary:    #2563EB;
    --mb-primary-h:  #1D4ED8;
    --mb-success:    #16A34A;
    --mb-error:      #DC2626;
    --mb-surface:    #F8FAFC;
    --mb-border:     #E2E8F0;
    --mb-text:       #1E293B;
    --mb-muted:      #64748B;
    --mb-radius:     12px;
    --mb-shadow:     0 4px 24px rgba(0,0,0,.08);
}

.mb-wrap {
    max-width: 680px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--mb-text);
}

/* ── En-tête ──────────────────────────────────────────────────── */
.mb-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    border-radius: var(--mb-radius) var(--mb-radius) 0 0;
    color: #fff;
}
.mb-logo { font-size: 2.5rem; margin-bottom: .4rem; }
.mb-header h2 { margin: 0 0 .3rem; font-size: 1.5rem; font-weight: 700; }
.mb-header p  { margin: 0; opacity: .85; font-size: .95rem; }

/* ── Alertes ──────────────────────────────────────────────────── */
.mb-alert {
    padding: .9rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: .95rem;
    margin: 0 0 .5rem;
    display: none;
}
.mb-alert.is-success { background: #DCFCE7; color: #166534; border-left: 4px solid #16A34A; display:block; }
.mb-alert.is-error   { background: #FEE2E2; color: #991B1B; border-left: 4px solid #DC2626; display:block; }

/* ── Étapes ───────────────────────────────────────────────────── */
.mb-step {
    background: #fff;
    padding: 1.5rem;
    border-left: 1px solid var(--mb-border);
    border-right: 1px solid var(--mb-border);
    border-bottom: 1px solid var(--mb-border);
}
.mb-step:last-child {
    border-radius: 0 0 var(--mb-radius) var(--mb-radius);
}
.mb-step-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1rem;
}
.mb-step-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mb-text);
}
.mb-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mb-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Boutons Ateliers ─────────────────────────────────────────── */
.mb-ateliers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.mb-atelier-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    border: 2px solid var(--mb-border);
    border-radius: 8px;
    background: var(--mb-surface);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    color: var(--mb-text);
    transition: all .18s ease;
    position: relative;
    overflow: hidden;
}
.mb-atelier-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--c, #4A90D9);
    opacity: 0;
    transition: opacity .18s ease;
}
.mb-atelier-btn:hover { border-color: var(--c, #4A90D9); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.mb-atelier-btn.is-selected {
    border-color: var(--c, #4A90D9);
    background: var(--c, #4A90D9);
    color: #fff;
}
.mb-atelier-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c, #4A90D9);
    flex-shrink: 0;
    transition: background .18s;
}
.mb-atelier-btn.is-selected .mb-atelier-dot { background: rgba(255,255,255,.7); }

/* ── Boutons Type ─────────────────────────────────────────────── */
.mb-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
}
.mb-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding: 1rem .5rem;
    border: 2px solid var(--mb-border);
    border-radius: 10px;
    background: var(--mb-surface);
    cursor: pointer;
    transition: all .18s ease;
    color: var(--mb-text);
}
.mb-type-btn:hover { border-color: var(--mb-primary); }
.mb-type-btn.is-selected {
    border-color: var(--mb-primary);
    background: #EFF6FF;
    color: var(--mb-primary);
}
.mb-type-icon  { font-size: 1.8rem; line-height: 1; }
.mb-type-label { font-size: .85rem; font-weight: 600; }

/* ── Date ─────────────────────────────────────────────────────── */
.mb-date-input {
    width: 100%;
    max-width: 220px;
    padding: .65rem .9rem;
    border: 2px solid var(--mb-border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--mb-text);
    transition: border .18s;
    box-sizing: border-box;
}
.mb-date-input:focus { outline: none; border-color: var(--mb-primary); }

/* ── Compteur ─────────────────────────────────────────────────── */
.mb-counter {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 2px solid var(--mb-border);
    border-radius: 8px;
    overflow: hidden;
}
.mb-counter-btn {
    width: 46px;
    height: 46px;
    border: none;
    background: var(--mb-surface);
    font-size: 1.4rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--mb-primary);
    transition: background .15s;
    line-height: 1;
}
.mb-counter-btn:hover { background: #EFF6FF; }
.mb-counter-btn:active { background: #DBEAFE; }
.mb-counter-input {
    width: 70px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--mb-border);
    border-right: 1px solid var(--mb-border);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mb-text);
    padding: 0;
    height: 46px;
    -moz-appearance: textfield;
}
.mb-counter-input::-webkit-inner-spin-button,
.mb-counter-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.mb-counter-input:focus { outline: none; }

/* ── Résumé ───────────────────────────────────────────────────── */
.mb-summary {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: .8rem 1rem;
    font-size: .9rem;
    margin-bottom: 1rem;
    color: #1E40AF;
}

/* ── Bouton Soumettre ─────────────────────────────────────────── */
.mb-submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--mb-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background .18s, transform .1s;
    letter-spacing: .01em;
}
.mb-submit-btn:hover   { background: var(--mb-primary-h); }
.mb-submit-btn:active  { transform: scale(.98); }
.mb-submit-btn:disabled {
    background: #94A3B8;
    cursor: not-allowed;
    transform: none;
}
.mb-submit-icon { font-size: 1.1rem; }

.mb-step-submit { background: #F8FAFC; }

.mb-empty { color: var(--mb-muted); font-style: italic; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 520px) {
    .mb-type-grid { grid-template-columns: repeat(3,1fr); }
    .mb-ateliers-grid { gap: .4rem; }
    .mb-atelier-btn { font-size: .8rem; padding: .5rem .8rem; }
}
