/* ── Corrections layout bare (pas de .page-shell parent) ───────────────── */

.mobile-form-page {
    margin: 0;
    background: #f6f8fa;
    min-height: 100dvh;
}

.mobile-form-shell {
    min-height: 100dvh;
    background: #f6f8fa;
}

/* Header : s'étire pleine largeur + respect de l'encoche iPhone */
.mobile-form-header {
    padding-top: max(16px, env(safe-area-inset-top, 16px));
}

/* Carte formulaire sans border-radius sur mobile, fond blanc continu */
.mobile-form-card {
    border-radius: 0;
    border-top: none;
    /* Espace home indicator iPhone */
    padding-bottom: max(32px, calc(env(safe-area-inset-bottom, 0px) + 24px));
}

/* Sur desktop : remettre un peu de style */
@media (min-width: 601px) {
    .mobile-form-page  { padding: 24px 16px 48px; background: #f6f8fa; }
    .mobile-form-shell { min-height: auto; border-radius: 20px; overflow: visible; box-shadow: 0 4px 32px rgba(0,0,0,.10); }
    .mobile-form-card  { border-radius: 0; }
}

/* ── Bannière erreur globale ────────────────────────────────────────────── */

.form-error-banner {
    background: #fff0f0;
    border-left: 3px solid #e53e3e;
    color: #c53030;
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 18px;
    margin: 0;
}

/* ── Panneau de confirmation ────────────────────────────────────────────── */

.confirm-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 8px 0 4px;
    color: var(--cms-ink);
    font-size: 15px;
    line-height: 1.55;
}

/* ── Sélecteur de type — cartes (état initial) ──────────────────────────── */

.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    transition: all .25s ease;
}

.type-card {
    border: 1.5px solid var(--app-line);
    border-radius: 16px;
    padding: 20px 12px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color .18s, box-shadow .18s, background .18s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    /* Touch target généreux */
    min-height: 120px;
    justify-content: center;
}

.type-card:active { transform: scale(.97); }

.type-card.is-selected {
    border-color: var(--app-fuchsia);
    background: var(--app-fuchsia-soft);
    box-shadow: 0 2px 12px rgba(214,0,127,.12);
}

.type-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--app-fuchsia-soft);
    border: 1.5px solid var(--app-line);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, border-color .18s;
    flex-shrink: 0;
}

.type-card__icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--app-fuchsia);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.type-card.is-selected .type-card__icon {
    background: var(--app-fuchsia);
    border-color: var(--app-fuchsia);
}

.type-card.is-selected .type-card__icon svg { stroke: #fff; }

.type-card__name {
    font-size: 14px;
    font-weight: 800;
    color: var(--cms-ink);
    letter-spacing: -.01em;
}

.type-card__desc {
    font-size: 11.5px;
    color: var(--cms-muted);
    line-height: 1.45;
}

/* ── Chips (état après sélection) ───────────────────────────────────────── */

.type-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--app-line);
    border-radius: 20px;
    min-height: 40px;
    padding: 7px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cms-muted);
    background: #fff;
    cursor: pointer;
    transition: all .18s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.type-chip svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.type-chip.is-selected {
    border-color: var(--app-fuchsia);
    color: var(--app-fuchsia);
    background: var(--app-fuchsia-soft);
}

.type-chip__check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--app-fuchsia);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.type-chip__check svg {
    width: 9px;
    height: 9px;
    stroke: #fff;
    stroke-width: 2.5;
}

/* ── Champs spécifiques ─────────────────────────────────────────────────── */

.sub-fields {
    border-top: 1px solid var(--app-line);
    padding-top: 18px;
    display: grid;
    gap: 14px;
    animation: subFieldsIn .28s cubic-bezier(.16,1,.3,1) both;
}

@keyframes subFieldsIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Multi-select besoins spéciaux ──────────────────────────────────────── */

.needs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.need-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1.5px solid var(--app-line);
    border-radius: 22px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cms-muted);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s, transform .1s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.need-chip:active { transform: scale(.95); }

.need-chip.is-active {
    border-color: var(--app-fuchsia);
    color: var(--app-fuchsia);
    background: var(--app-fuchsia-soft);
}

.need-chip__icon {
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Champ "Besoin non listé" ───────────────────────────────────────────── */

.v2-notes-wrap {
    border-top: 1px solid var(--app-line);
    padding-top: 6px;
    margin-top: -6px;
}

.v2-notes-field {
    background: var(--app-fuchsia-soft);
    border: 1.5px dashed color-mix(in srgb, var(--app-fuchsia) 30%, transparent);
    border-radius: 14px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .18s;
}

.v2-notes-field:focus-within {
    border-color: var(--app-fuchsia);
    border-style: solid;
}

.v2-notes-header {
    display: flex;
    align-items: center;
    gap: 7px;
}

.v2-notes-header svg {
    stroke: var(--app-fuchsia);
    flex-shrink: 0;
}

.v2-notes-header label {
    font-size: 13px;
    font-weight: 700;
    color: var(--cms-ink);
    cursor: pointer;
    flex: 1;
}

.v2-notes-optional {
    font-size: 11px;
    font-weight: 600;
    color: var(--app-fuchsia);
    background: color-mix(in srgb, var(--app-fuchsia) 12%, transparent);
    border-radius: 20px;
    padding: 2px 8px;
    letter-spacing: .02em;
}

.v2-notes-field textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--cms-ink);
    line-height: 1.55;
    resize: none;
    outline: none;
    font-family: inherit;
    padding: 0;
    min-height: 48px;
    field-sizing: content; /* auto-resize natif (Chrome 123+) */
}

.v2-notes-field textarea::placeholder {
    color: var(--cms-muted);
}

/* ── Bouton submit (caché jusqu'à sélection type) ───────────────────────── */

.rdv2-submit-wrap {
    animation: subFieldsIn .28s cubic-bezier(.16,1,.3,1) both;
}

/* ── Légende section : plus de respiration ──────────────────────────────── */

.form-section legend {
    margin-bottom: 6px;
}

/* ── Séparateur visuel entre sections ───────────────────────────────────── */

.form-section + .form-section {
    border-top: 1px solid var(--app-line);
    padding-top: 6px;
    margin-top: -6px;
}
