/* Garantit que l'attribut HTML hidden n'est pas écrasé par display:grid/flex */
[hidden] { display: none !important; }

/* Empêche le zoom iOS au focus sur les inputs (<16px déclenche le zoom) */
:root {
    --bs-body-bg: #f6f8fa;
    --cms-ink: #172026;
    --cms-muted: #69777f;
    --cms-brand: #0f766e;
    --app-black: #08070a;
    --app-fuchsia: #d6007f;
    --app-fuchsia-dark: #a90063;
    --app-fuchsia-soft: #fff0f8;
    --app-line: #ead5e1;
    --app-radius-input: 14px;
    --app-input-height: 52px;
}

/* ── Base ────────────────────────────────────────────────────────────────── */

html {
    /* Empêche les ajustements de taille sur rotation mobile */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    color: var(--cms-ink);
    font-size: 16px; /* Base 16 px obligatoire pour éviter le zoom iOS */
}

/* Supprime le flash bleu au tap sur iOS/Android */
a, button, label, [role="option"] {
    -webkit-tap-highlight-color: transparent;
}

/* Manipulation directe sans délai 300 ms sur mobile */
button, a, label, select, input {
    touch-action: manipulation;
}

/* ── Éléments généraux ───────────────────────────────────────────────────── */

.navbar-brand {
    font-weight: 700;
}

.page-shell {
    min-height: calc(100vh - 56px);
    padding: 32px 0;
}

.hero-panel,
.admin-card,
.auth-panel {
    background: #fff;
    border: 1px solid #dfe7eb;
    border-radius: 8px;
}

.hero-panel {
    padding: clamp(24px, 5vw, 56px);
}

.text-muted-soft {
    color: var(--cms-muted);
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    background: #142026;
    color: #fff;
    padding: 24px;
}

.admin-sidebar a {
    color: #d7ece9;
    display: block;
    padding: 10px 0;
    text-decoration: none;
}

.admin-content {
    padding: 28px;
}

.auth-panel {
    margin: 48px auto;
    max-width: 420px;
    padding: 28px;
}

/* ── Page accueil — liste sociétés ──────────────────────────────────────── */

.home-intro {
    color: var(--cms-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    margin: 0;
    text-transform: uppercase;
}

.home-societes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-societe-btn {
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--app-line);
    border-radius: 14px;
    color: var(--cms-ink);
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}

.home-societe-btn:hover,
.home-societe-btn:focus-visible {
    border-color: var(--app-fuchsia);
    box-shadow: 0 2px 12px rgb(214 0 127 / 12%);
}

.home-societe-btn:active {
    transform: scale(.98);
}

.home-societe-btn__initial {
    align-items: center;
    background: var(--app-fuchsia);
    border-radius: 10px;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.home-societe-btn__name {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
}

.home-societe-btn svg {
    color: var(--cms-muted);
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────── */

.form-split {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Formulaire mobile — structure ───────────────────────────────────────── */

.mobile-form-page {
    margin: 0 -12px;
    min-height: 100vh;
    padding: 0;
}

.appointment-request-page .public-nav    { display: none; }
.appointment-request-page .public-footer { display: none; }
.appointment-request-page .page-shell {
    min-height: 100vh;
    padding: 0;
}

.mobile-form-shell {
    margin: 0 auto;
    max-width: 680px;
    min-height: 100vh;
}

.mobile-form-header {
    align-items: center;
    background: linear-gradient(135deg, #0f1318 0%, #2a0520 100%);
    color: #fff;
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
}

.mobile-form-header svg {
    background: rgba(214,0,127,.25);
    border: 1px solid rgba(214,0,127,.5);
    border-radius: 8px;
    flex-shrink: 0;
    padding: 6px;
    width: 32px;
    height: 32px;
}

.mobile-form-header h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0;
}


.mobile-form-card {
    background: #fff;
    border-top: 1px solid var(--app-line);
    display: grid;
    gap: 24px;
    /* Safe area bas (home indicator iPhone) */
    padding: 24px 20px max(28px, env(safe-area-inset-bottom, 0px));
}

/* ── Sections de formulaire ──────────────────────────────────────────────── */

.form-section {
    border: 0;
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.form-section legend {
    color: var(--app-black);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 4px;
    padding: 0;
}

/* ── Champs ──────────────────────────────────────────────────────────────── */

.app-field {
    display: grid;
    gap: 8px;
}

.app-field.form-hidden,
.form-hidden {
    display: none;
}

.app-field.form-hidden.is-visible,
.form-hidden.is-visible {
    display: grid;
}

.app-field span,
.app-field > label > span {
    color: #20151b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.app-field input,
.app-field select,
.lieu-search-input {
    appearance: none;
    -webkit-appearance: none;
    background: #fff8fc;
    border: 1.5px solid var(--app-line);
    border-radius: var(--app-radius-input);
    color: var(--cms-ink);
    font: inherit;
    font-size: 16px; /* Crucial : empêche le zoom iOS */
    min-height: var(--app-input-height);
    outline: 0;
    padding: 14px 16px;
    width: 100%;
    /* Transitions douces pour les états */
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.app-field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--app-fuchsia) 50%),
                      linear-gradient(135deg, var(--app-fuchsia) 50%, transparent 50%);
    background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
    background-repeat: no-repeat;
    background-size: 6px 6px, 6px 6px;
    padding-right: 42px;
}

.app-field input:focus,
.app-field select:focus,
.lieu-search-input:focus {
    background: #fff;
    border-color: var(--app-fuchsia);
    box-shadow: 0 0 0 4px rgb(214 0 127 / 14%);
    outline: none;
}

/* ── Date & heure : picker custom ────────────────────────────────────────── */

.date-pick {
    align-items: center;
    background: #fff8fc;
    border: 1.5px solid var(--app-line);
    border-radius: var(--app-radius-input);
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: var(--app-input-height);
    padding: 0 16px;
    position: relative;
    transition: border-color .15s, box-shadow .15s;
}

.date-pick:focus-within {
    border-color: var(--app-fuchsia);
    box-shadow: 0 0 0 4px rgb(214 0 127 / 14%);
}

.has-error .date-pick {
    border-color: #e53e3e;
}

/* Icône calendrier / horloge */
.date-pick__icon {
    color: var(--app-fuchsia);
    flex-shrink: 0;
}

/* Texte affiché (placeholder ou valeur formatée) */
.date-pick__text {
    color: var(--cms-muted);
    flex: 1;
    font-size: 16px;
    line-height: 1.3;
    pointer-events: none;
}

.date-pick.is-filled .date-pick__text {
    color: var(--cms-ink);
    font-weight: 600;
}

/* Input natif : complètement caché, ouvert via JS showPicker() */
.date-pick__native {
    height: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 0;
}

/* ── Air Datepicker — déclencheur (réutilise .time-pick, pas de CSS dédié) ── */

/* ── Flatpickr — modal overlay ───────────────────────────────────────────── */

.fp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}

.fp-overlay.fp-visible {
    opacity: 1;
    pointer-events: auto;
}

.fp-box {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    transform: translateY(12px) scale(.97);
    transition: transform .18s;
    max-width: 340px;
    width: 100%;
}

.fp-overlay.fp-visible .fp-box {
    transform: translateY(0) scale(1);
}

.fp-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.fp-box-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.fp-box-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s;
    flex-shrink: 0;
}

.fp-box-close:hover {
    background: #e5e7eb;
    color: #1a1a2e;
}

/* ── Air Datepicker — overrides dans la modal ────────────────────────────── */

/* Calendrier en mode inline : pas de border/shadow propre */
.fp-box .air-datepicker {
    border: none;
    box-shadow: none;
    width: 100%;
    --adp-accent-color:          #6c63ff;
    --adp-color-secondary:       #6c63ff;
    --adp-selected-color:        #fff;
    --adp-selected-background:   #6c63ff;
    --adp-nav-action-size:       48px;
    --adp-day-cell-height:       44px;
    --adp-day-name-color:        #6c63ff;
    --adp-day-name-color-hover:  #6c63ff;
}

/* Flèches nav : 48 × 48 px pour le tactile */
.fp-box .air-datepicker-nav--action {
    width:  var(--adp-nav-action-size);
    height: var(--adp-nav-action-size);
}

/* Titre nav : touche large, clic → vue mois puis années */
.fp-box .air-datepicker-nav--title {
    font-size: 1rem;
    font-weight: 700;
}

/* Cellules de jours : cible min. 44 px */
.fp-box .air-datepicker-cell.-day- {
    height:      var(--adp-day-cell-height);
    line-height: var(--adp-day-cell-height);
    border-radius: 8px;
    font-size: .95rem;
}

/* Cellules mois/années : plus hautes */
.fp-box .air-datepicker-cell.-month-,
.fp-box .air-datepicker-cell.-year- {
    height: 50px;
    font-size: .95rem;
}

/* Couleur sélectionnée */
.fp-box .air-datepicker-cell.-selected- {
    background: #6c63ff !important;
    color: #fff !important;
}

.fp-box .air-datepicker-cell.-focus- {
    background: #f0effe;
}

/* ── Time picker trigger ─────────────────────────────────────────────────── */

.time-pick {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    user-select: none;
    min-height: 48px;
}

.time-pick:hover,
.time-pick:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,.12);
    outline: none;
}

.time-pick.has-value .time-pick__text {
    color: #1a1a2e;
    font-weight: 500;
}

.time-pick__icon {
    color: #9ca3af;
    flex-shrink: 0;
    transition: color .15s;
}

.time-pick:hover .time-pick__icon,
.time-pick:focus .time-pick__icon {
    color: #6c63ff;
}

.time-pick__text {
    flex: 1;
    font-size: .95rem;
    color: #9ca3af;
}

/* ── Time picker modal ───────────────────────────────────────────────────── */

.tp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}

.tp-overlay.tp-visible {
    opacity: 1;
    pointer-events: auto;
}

.tp-box {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 2rem 1.5rem;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    transform: translateY(12px) scale(.97);
    transition: transform .18s, opacity .18s;
    text-align: center;
}

.tp-overlay.tp-visible .tp-box {
    transform: translateY(0) scale(1);
}

.tp-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: .25rem;
}

.tp-hint {
    font-size: .75rem;
    color: #9ca3af;
    margin-bottom: 1.25rem;
}

.tp-fields {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.tp-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}

.tp-btn {
    width: 40px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: .9rem;
    cursor: pointer;
    color: #4b5563;
    transition: background .12s, color .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tp-btn:hover {
    background: #6c63ff;
    color: #fff;
}

.tp-drum {
    width: 72px;
    height: 64px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
    position: relative;
    transition: border-color .15s, box-shadow .15s, background .1s;
    background: #fafafa;
}

.tp-drum:hover {
    border-color: #6c63ff;
    background: #f5f4ff;
}

.tp-drum.tp-dragging {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,.15);
    background: #f0effe;
}

.tp-drum.tp-editing {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,.15);
    cursor: text;
}

.tp-val {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
    pointer-events: none;
    transition: opacity .1s;
}

.tp-drum.tp-editing .tp-val { opacity: 0; }

/* Input de saisie manuelle — superposé au drum, invisible par défaut */
.tp-edit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    color: #1a1a2e;
    outline: none;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    cursor: text;
}

.tp-drum.tp-editing .tp-edit {
    opacity: 1;
    pointer-events: auto;
}

.tp-sep {
    font-size: 2rem;
    font-weight: 700;
    color: #6c63ff;
    line-height: 1;
    padding-bottom: .2rem;
}

.tp-label {
    font-size: .72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}

.tp-validate {
    width: 100%;
    padding: .7rem;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.tp-validate:hover {
    background: #5a52d5;
}

/* ── Erreurs champ ───────────────────────────────────────────────────────── */

.app-field.has-error input,
.app-field.has-error select,
.app-field.has-error .lieu-search-input {
    border-color: #e11d48;
    background: #fff5f7;
}

.app-field__error {
    color: #e11d48;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.app-field span em,
.app-field label em {
    color: #d6007f;
    font-style: normal;
    margin-left: 2px;
}

/* ── Bouton principal ────────────────────────────────────────────────────── */

.app-submit {
    background: var(--app-black);
    border: 0;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    display: block;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .01em;
    min-height: 56px;
    padding: 14px 18px;
    text-align: center;
    width: 100%;
    transition: background 0.15s, transform 0.1s;
}

.app-submit:hover,
.app-submit:focus {
    background: var(--app-fuchsia-dark);
    outline: none;
}

.app-submit:active {
    background: var(--app-fuchsia-dark);
    transform: scale(0.98);
}

.app-submit:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.app-submit--outline {
    background: transparent;
    border: 2px solid var(--app-line);
    color: var(--cms-ink);
    margin-top: 4px;
}

.app-submit--outline:hover,
.app-submit--outline:focus {
    background: var(--app-fuchsia-soft);
    border-color: var(--app-fuchsia);
    color: var(--app-fuchsia);
}

.app-submit--outline:active {
    background: var(--app-fuchsia-soft);
    border-color: var(--app-fuchsia);
    color: var(--app-fuchsia);
    transform: scale(0.98);
}

/* ── Upload document custom ──────────────────────────────────────────────── */

.doc-upload {
    display: grid;
    gap: 10px;
}

/* Input natif masqué mais accessible */
.doc-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Zone de tap stylisée */
.doc-upload__btn {
    align-items: center;
    background: var(--app-fuchsia-soft);
    border: 1.5px dashed var(--app-fuchsia);
    border-radius: 16px;
    color: var(--app-fuchsia);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 96px;
    padding: 20px 16px;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}

.doc-upload__btn:active {
    background: #ffe0f3;
}

.doc-upload__btn span {
    font-size: 15px;
    font-weight: 700;
}

.doc-upload__btn small {
    color: var(--cms-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Aperçu fichier sélectionné */
.doc-upload__preview {
    align-items: center;
    background: var(--app-fuchsia-soft);
    border: 1.5px solid var(--app-line);
    border-radius: 14px;
    color: var(--cms-ink);
    display: flex;
    gap: 12px;
    overflow: hidden;
    padding: 10px 12px;
}

/* Vignette 56×56 */
.doc-upload__thumb {
    align-items: center;
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    display: flex;
    flex-shrink: 0;
    height: 56px;
    justify-content: center;
    overflow: hidden;
    width: 56px;
}

/* Miniature image */
.doc-upload__thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

/* Badge PDF */
.doc-upload__thumb-pdf {
    align-items: center;
    color: var(--app-fuchsia);
    display: flex;
    flex-direction: column;
    font-size: 10px;
    font-weight: 800;
    gap: 2px;
    justify-content: center;
    letter-spacing: .05em;
}

/* Nom + taille empilés */
.doc-upload__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* width:0 + flex:1 = seul moyen fiable de forcer ellipsis dans un flex */
    flex: 1;
    width: 0;
}

.doc-upload__name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-upload__size {
    color: var(--cms-muted);
    font-size: 12px;
}

.doc-upload__remove {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--cms-muted);
    cursor: pointer;
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    min-height: 36px;
    min-width: 36px;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.doc-upload__remove:active,
.doc-upload__remove:hover {
    background: #ffe0f3;
    color: var(--app-fuchsia);
}

/* Fix fieldset : empêche le débordement horizontal natif */
.form-section {
    min-width: 0;
}

.mobile-form-header__company {
    color: rgba(255,255,255,.55);
    font-size: 12px;
    font-weight: 500;
    margin: 2px 0 0;
}

/* ── Carte utilisateur mémorisé ─────────────────────────────────────────── */

.saved-user-card {
    align-items: center;
    background: var(--app-fuchsia-soft);
    border: 1.5px solid var(--app-line);
    border-radius: 14px;
    box-sizing: border-box;
    display: flex;
    gap: 10px;
    overflow: hidden;
    padding: 10px 12px;
    width: 100%;
}

/* Initiales dans un cercle */
.saved-user-card__avatar {
    align-items: center;
    background: var(--app-fuchsia);
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    letter-spacing: .02em;
    width: 40px;
}

.saved-user-card__info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}

.saved-user-card__info strong {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-user-card__info span {
    color: var(--cms-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-user-card__edit {
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--app-line);
    border-radius: 8px;
    color: var(--cms-ink);
    cursor: pointer;
    display: flex;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
    padding: 6px 10px;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
}

.saved-user-card__edit:hover {
    border-color: var(--app-fuchsia);
    color: var(--app-fuchsia);
}

/* ── Autocomplete lieu ───────────────────────────────────────────────────── */

#lieu-autocomplete-wrap,
#med-lieu-autocomplete-wrap,
.ban-ac-wrap {
    position: relative;
}

.lieu-suggestions {
    background: #fff;
    border: 1.5px solid var(--app-line);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgb(0 0 0 / 12%);
    left: 0;
    list-style: none;
    margin: 6px 0 0;
    max-height: 320px;
    overflow-x: hidden;
    overflow-y: auto;
    /* Scroll momentum iOS */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px;
    position: absolute;
    right: 0;
    top: 100%;
    width: 100%;
    box-sizing: border-box;
    z-index: 1300;
}
.lieu-suggestions.drop-up {
    top: auto;
    bottom: 100%;
    margin: 0 0 6px;
}

/* Items lieux simples (MySQL) */
.lieu-suggestions li.v2-ac-lieu {
    border-radius: 10px;
    color: var(--cms-ink);
    cursor: pointer;
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    transition: background 0.1s;
    /* Évite le débordement horizontal */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
    line-height: 48px;
}

/* Items génériques (v1 — lieux non v2) */
.lieu-suggestions li:not(.v2-ac-groupe):not(.v2-ac-medecin):not(.v2-ac-lieu):not(.v2-ac-group) {
    border-radius: 10px;
    color: var(--cms-ink);
    cursor: pointer;
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    transition: background 0.1s;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lieu-suggestions li:hover,
.lieu-suggestions li.is-active {
    background: var(--app-fuchsia-soft);
    color: var(--app-fuchsia);
}

/* Items médecins dans le dropdown combiné v2 */
.lieu-suggestions li.v2-ac-medecin {
    border-radius: 10px;
    cursor: pointer;
    padding: 10px 14px;
    transition: background 0.1s;
    min-height: unset;
    align-items: unset;
    /* Réinitialise le flex du li générique */
    display: block;
}

.lieu-suggestions li.v2-ac-medecin .medecin-ac-name,
.lieu-suggestions li.v2-ac-medecin .medecin-ac-addr {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.lieu-suggestions li.v2-ac-medecin:hover,
.lieu-suggestions li.v2-ac-medecin.is-active {
    background: var(--app-fuchsia-soft);
}

.lieu-suggestions li.v2-ac-medecin:hover .medecin-ac-name,
.lieu-suggestions li.v2-ac-medecin.is-active .medecin-ac-name {
    color: var(--app-fuchsia);
}

/* En-tête de groupe dans le dropdown combiné */
.lieu-suggestions li.v2-ac-lieu__text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lieu-suggestions .v2-ac-lieu__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--cms-primary, #e91e8c);
    background: color-mix(in srgb, var(--cms-primary, #e91e8c) 10%, transparent);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}
.lieu-suggestions li.v2-ac-group {
    padding:        4px 14px;
    font-size:      10px;
    font-weight:    700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color:          #b0b7c3;
    background:     transparent;
    cursor:         default;
    min-height:     unset;
    display:        block;
    border-radius:  0;
    margin-top:     4px;
}

/* ── Toggle lieu liste / adresse libre ──────────────────────────────────── */

.lieu-toggle-btn {
    display:     inline-flex;
    align-items: center;
    gap:         .35rem;
    margin-top:  .5rem;
    padding:     0;
    background:  none;
    border:      none;
    font-size:   .82rem;
    font-weight: 600;
    color:       #6c63ff;
    cursor:      pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition:  color .12s;
}

.lieu-toggle-btn:hover {
    color: #5a52d5;
}

.lieu-toggle-btn--back {
    color: #6b7280;
}

.lieu-toggle-btn--back:hover {
    color: #374151;
}

/* ── Autocomplete médecins (dropdown sous #lieu_libre) ──────────────────── */

/* Le champ parent doit être en position relative pour ancrer le dropdown */
#lieu-libre-wrap {
    position: relative;
}

.medecin-ac-list {
    position:   absolute;
    top:        calc(100% + 2px); /* juste sous le champ */
    left:       0;
    right:      0;
    z-index:    200;
    list-style: none;
    margin:     0;
    padding:    4px 0;
    background: #fff;
    border:     1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 280px;
    overflow-y: auto;
    /* Scrollbar discrète */
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}


.medecin-ac-item {
    display:     flex;
    flex-direction: column;
    gap:         2px;
    padding:     10px 14px;
    cursor:      pointer;
    border-bottom: 1px solid #f3f4f6;
    transition:  background .12s;
}

.medecin-ac-item:last-child {
    border-bottom: none;
}

.medecin-ac-item:hover,
.medecin-ac-item.is-active {
    background: #f5f3ff;
}

.medecin-ac-name {
    font-size:   14px;
    font-weight: 600;
    color:       #111827;
    line-height: 1.3;
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

.medecin-ac-addr {
    font-size:  12px;
    color:      #6b7280;
    white-space: nowrap;
    overflow:   hidden;
    text-overflow: ellipsis;
}

/* ── Bandeau erreur global ───────────────────────────────────────────────── */

.form-error-banner {
    background: #fff1f2;
    border-left: 4px solid #e11d48;
    border-radius: 0 8px 8px 0;
    color: #9f1239;
    font-size: 14px;
    font-weight: 600;
    margin: 0 16px;
    padding: 12px 16px;
}

/* ── Note champs obligatoires ────────────────────────────────────────────── */

.form-required-note {
    color: var(--cms-muted);
    font-size: 13px;
    margin: -4px 0 0;
}

.form-required-note em {
    color: #d6007f;
    font-style: normal;
}

/* ── Page confirmation ───────────────────────────────────────────────────── */

.confirm-check {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 0;
    text-align: center;
}

.confirm-check p {
    color: var(--cms-muted);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

.confirm-recap {
    background: #f9f5f8;
    border-radius: 16px;
    padding: 18px;
}

.confirm-recap h2 {
    color: var(--app-black);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.confirm-recap ul {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.confirm-recap li {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.confirm-recap li span {
    color: var(--cms-muted);
    flex-shrink: 0;
    font-size: 13px;
}

.confirm-recap li strong {
    color: var(--app-black);
    font-size: 14px;
    text-align: right;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    /* Prenom + Nom en colonne sur petits écrans */
    .form-split {
        gap: 14px;
        grid-template-columns: 1fr;
    }
}

@media (min-width: 601px) and (max-width: 800px) {
    .form-split {
        gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 801px) {
    .mobile-form-page {
        margin: 0;
        min-height: auto;
    }

    .mobile-form-shell {
        border-radius: 24px;
        min-height: auto;
        overflow: hidden;
    }

    .mobile-form-card {
        border-radius: 22px;
        padding: 32px;
    }

    .form-split {
        gap: 16px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Admin (inchangé) ────────────────────────────────────────────────────── */

@media (max-width: 800px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .page-shell {
        padding: 0;
    }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Espace client — /mes-courses/{token}                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

.mon-rdv-wrap {
    max-width: 520px;
    margin: 28px auto 0;
    padding: 0 16px 48px;
}

/* Bandeau statut */
.mon-rdv-statut {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid;
    border-left-width: 4px;
    margin-bottom: 16px;
}
.mon-rdv-statut__icon {
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1.4;
    font-style: normal;
}
.mon-rdv-statut__body { flex: 1; min-width: 0; }
.mon-rdv-statut__label {
    font-size: 16px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}
.mon-rdv-statut__hint {
    margin: 0;
    font-size: 14px;
    color: #475569;
}

/* Carte détail */
.mon-rdv-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.mon-rdv-card__title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.mon-rdv-card__subtitle {
    margin: -8px 0 20px;
    font-size: 14px;
    color: #64748b;
}

/* DL liste détails */
.mon-rdv-dl {
    display: grid;
    row-gap: 0;
}
.mon-rdv-dl__row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 15px;
}
.mon-rdv-dl__row:last-child { border-bottom: none; }
.mon-rdv-dl__row dt { color: #64748b; font-weight: 500; }
.mon-rdv-dl__row dd { margin: 0; color: #1e293b; }
.mon-rdv-dl__row--highlight dt,
.mon-rdv-dl__row--highlight dd { font-weight: 700; }
/* ─────────────────────────────────────────────────────────────────────────── */
/* Layout client — cl-*  (layouts/client.php)                                  */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Corps de page */
.cl-body {
    background: #f0f4f8;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
}

/* En-tête */
.cl-header {
    background: #1e293b;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,.22);
}
.cl-header__inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cl-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.cl-header__icon {
    width: 34px;
    height: 34px;
    color: #facc15;
    flex-shrink: 0;
}
.cl-header__name {
    display: block;
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cl-header__sub {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-top: 1px;
}
.cl-header__contacts {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.cl-header__contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 99px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.cl-header__contact:hover {
    background: rgba(255,255,255,.2);
    color: #fff;
}
/* Email masqué sur mobile, visible dès 560 px */
.cl-header__contact--email { display: none; }

/* Contenu principal */
.cl-main { padding-bottom: 56px; flex: 1; }

/* Flash messages */
.cl-flash {
    max-width: 520px;
    margin: 20px auto 0;
    padding: 13px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.cl-flash--success { background: #dcfce7; color: #166534; }
.cl-flash--danger  { background: #fee2e2; color: #991b1b; }
.cl-flash--info    { background: #dbeafe; color: #1e40af; }
.cl-flash--warning { background: #fef3c7; color: #92400e; }

/* Pied de page */
.cl-footer {
    border-top: 1px solid #e2e8f0;
    background: #fff;
    text-align: center;
    padding: 14px 20px;
    font-size: 13px;
    color: #94a3b8;
}
.cl-footer__name { font-weight: 500; color: #64748b; }
.cl-footer a { color: #64748b; text-decoration: none; }
.cl-footer a:hover { text-decoration: underline; }
.cl-footer__sep { margin: 0 6px; }

/* Modal de confirmation (annulation client) */
.cl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.cl-modal-overlay[hidden] { display: none; }
.cl-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    animation: cl-modal-in .18s ease;
}
@keyframes cl-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.cl-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
}
.cl-modal__header--danger {
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
}
.cl-modal__title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}
.cl-modal__body {
    padding: 20px 24px 8px;
    font-size: 15px;
    color: #334155;
    line-height: 1.55;
}
.cl-modal__body p { margin: 0 0 10px; }
.cl-modal__body p:last-child { margin-bottom: 0; }
.cl-modal__hint {
    font-size: 13px;
    color: #64748b;
}
.cl-modal__footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 24px 24px;
}

@media (min-width: 400px) {
    .cl-modal__footer {
        flex-direction: row-reverse;
    }
    .cl-modal__footer .mon-rdv-btn {
        flex: 1;
    }
}

@media (min-width: 560px) {
    .cl-header__contact--email { display: inline-flex; }
}

/* Avertissement annulation */
.mon-rdv-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left-width: 4px;
    border-radius: 8px;
    color: #78350f;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 16px;
    padding: 12px 16px;
}

/* Actions */
.mon-rdv-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.mon-rdv-actions__note {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
}
.mon-rdv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
    transition: opacity .15s;
}
.mon-rdv-btn:hover { opacity: .88; }
.mon-rdv-btn--primary  { background: #6c63ff; color: #fff; }
.mon-rdv-btn--secondary { background: #ede9fe; color: #6c63ff; }
.mon-rdv-btn--danger   { background: #fee2e2; color: #dc2626; }
.mon-rdv-btn--ghost    { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }

/* Formulaire de modification */
.mon-rdv-back {
    display: inline-block;
    font-size: 14px;
    color: #6c63ff;
    text-decoration: none;
    margin-bottom: 16px;
}
.mon-rdv-back:hover { text-decoration: underline; }
.mon-rdv-field {
    margin-bottom: 20px;
}
.mon-rdv-field.has-error .mon-rdv-input {
    border-color: #dc2626;
}
.mon-rdv-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.mon-rdv-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s;
}
.mon-rdv-input:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.mon-rdv-error {
    margin: 4px 0 0;
    font-size: 13px;
    color: #dc2626;
}
.mon-rdv-form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 480px) {
    .mon-rdv-dl__row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .mon-rdv-dl__row dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
}
