/* NDOLI — formulaires : champs, aides, erreurs, choix, cases, téléversement. */

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
.form__group { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); margin: 0; padding: 0; border: 0; min-width: 0; }
.form__group > legend { margin-bottom: var(--sp-3); color: var(--nd-primary-deep); font-size: var(--fs-md); font-weight: 700; }
.form__alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--nd-danger-soft);
  color: var(--nd-danger-ink);
  font-weight: 500;
}
.form__alert .icon { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.form__alert ul { margin: 4px 0 0; padding-left: 18px; font-weight: 400; }

.field { display: grid; gap: 6px; min-width: 0; }
.field label,
.field__label { color: var(--nd-text); font-size: var(--fs-sm); font-weight: 600; }
.field__label small { color: var(--nd-text-muted); font-weight: 400; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="number"],
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--nd-border-strong);
  border-radius: var(--radius-sm);
  background: var(--nd-white);
  color: var(--nd-text);
  font-size: var(--fs-md);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field textarea:focus { border-color: var(--nd-primary); outline: none; box-shadow: var(--focus-halo); }
.field [aria-invalid="true"] { border-color: var(--nd-danger); }
.field input[type="file"] { font-size: var(--fs-sm); }
.field__hint { color: var(--nd-text-muted); font-size: var(--fs-xs); line-height: 1.45; }
.field__hint a { color: var(--nd-primary); font-weight: 600; }
.field__error { color: var(--nd-danger-ink); font-size: var(--fs-sm); font-weight: 500; }
.field-row { display: grid; gap: var(--sp-4); }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.select--block { display: flex; }
.select--block select { width: 100%; min-height: 48px; border-radius: var(--radius-sm); font-size: var(--fs-md); }

.choice-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--nd-border-strong);
  border-radius: var(--radius-pill);
  background: var(--nd-white);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.choice span .icon { width: 18px; height: 18px; color: var(--nd-primary); }
.choice input:checked + span { border-color: var(--nd-primary); background: var(--nd-lavender); color: var(--nd-primary-ink); }
.choice input:focus-visible + span { box-shadow: var(--focus-halo); }
.choice input:disabled + span { opacity: .5; }

.check { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); line-height: 1.5; }
.check input { width: 24px; height: 24px; margin-top: -1px; flex-shrink: 0; accent-color: var(--nd-primary); }
.check a { color: var(--nd-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.link-btn { padding: 0; border: 0; background: none; color: var(--nd-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.input-prefix { display: flex; overflow: hidden; border: 1px solid var(--nd-border-strong); border-radius: var(--radius-sm); }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; background: var(--nd-lavender-soft); color: var(--nd-text-muted); font-size: var(--fs-xs); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-prefix input { border: 0 !important; border-radius: 0 !important; }

/* Téléversement de photos */
.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: var(--sp-6) var(--sp-4);
  border: 2px dashed var(--nd-border-strong);
  border-radius: var(--radius-lg);
  background: var(--nd-lavender-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--nd-primary); background: var(--nd-lavender); }
.dropzone:focus-within { box-shadow: var(--focus-halo); border-color: var(--nd-primary); }
.dropzone__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--nd-white); color: var(--nd-primary); box-shadow: var(--shadow-xs); }
.dropzone__text { font-size: var(--fs-md); }
.dropzone__hint { color: var(--nd-text-muted); font-size: var(--fs-xs); }
@media (hover: none) { .dropzone__desktop { display: none; } }

/* Fichier unique (logo, pièce d'identité) : même langage que la zone photos, en compact */
.file-pick {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-3);
  min-height: 60px;
  padding: 10px 14px;
  border: 2px dashed var(--nd-border-strong);
  border-radius: var(--radius-md);
  background: var(--nd-lavender-soft);
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.file-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick:hover { border-color: var(--nd-primary); background: var(--nd-lavender); }
.file-pick:focus-within { box-shadow: var(--focus-halo); border-color: var(--nd-primary); }
.file-pick.is-filled { border-style: solid; border-color: var(--nd-primary); background: var(--nd-white); }
.file-pick:has(input[aria-invalid="true"]) { border-color: var(--nd-danger); }
.file-pick__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--nd-white); color: var(--nd-primary); box-shadow: var(--shadow-xs); }
.file-pick.is-filled .file-pick__icon { background: var(--nd-lavender); }
.file-pick__text { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-sm); }
.file-pick__text strong { font-weight: 600; }
.file-pick__name { color: var(--nd-text-muted); font-size: var(--fs-xs); }
.file-pick.is-filled .file-pick__name { overflow: hidden; color: var(--nd-text); white-space: nowrap; text-overflow: ellipsis; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.thumb-grid:empty { display: none; }
.thumb { position: relative; overflow: hidden; aspect-ratio: 5 / 4; border-radius: var(--radius-sm); background: var(--nd-lavender-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__badge { position: absolute; top: 4px; left: 4px; padding: 2px 6px; border-radius: var(--radius-pill); background: var(--nd-primary-deep); color: var(--nd-white); font-size: 10px; font-weight: 600; }
.thumb__remove { position: absolute; inset: auto 4px 4px; display: flex; }
.thumb__remove input { position: absolute; opacity: 0; }
.thumb__remove span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--nd-surface-card); font-size: 11px; font-weight: 600; cursor: pointer; }
.thumb__remove .icon { width: 14px; height: 14px; color: var(--nd-danger); }
.thumb__remove input:checked + span { background: var(--nd-danger); color: var(--nd-white); }
.thumb__remove input:checked + span .icon { color: var(--nd-white); }
.thumb__remove input:focus-visible + span { box-shadow: var(--focus-halo); }

.otp-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-weight: 700; }
.dev-notice { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border: 1px dashed var(--nd-warning); border-radius: var(--radius-md); background: var(--nd-ivory); color: var(--nd-text); font-size: var(--fs-sm); }
.dev-notice .icon { width: 18px; height: 18px; color: var(--nd-warning); flex-shrink: 0; margin-top: 2px; }
