/* css/depot.css — bouton « + Dépôt app » et fenêtre du formulaire.
   Les couleurs reprennent vos variables si elles existent (--accent, --surface, --text, --muted, --border),
   sinon des valeurs de repli. */

.controls { display: flex; justify-content: flex-end; margin-bottom: 12px; }

.btn-depot {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border: 0; border-radius: 8px;
  background: var(--accent, #1f3a5f); color: #fff;
}
.btn-depot:hover { filter: brightness(1.1); }

.depot-modal {
  --d-bg: var(--surface, #fff);
  --d-text: var(--text, #1c2230);
  --d-muted: var(--muted, #5d6678);
  --d-line: var(--border, #d3d8e0);
  --d-accent: var(--accent, #1f3a5f);
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.depot-modal[hidden] { display: none; }
body.depot-open { overflow: hidden; }

.depot-backdrop { position: absolute; inset: 0; background: rgba(15, 20, 30, .55); }

.depot-panel {
  position: relative; box-sizing: border-box;
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 24px; border-radius: 12px;
  background: var(--d-bg); color: var(--d-text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}

.depot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.depot-head h2 { margin: 0; font-size: 1.25rem; }
.depot-x { font-size: 1.6rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--d-muted); }
.depot-intro { margin: 8px 0 20px; color: var(--d-muted); font-size: .92rem; }

.depot-form { display: grid; gap: 14px; }
.depot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.depot-field { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.depot-field em { font-weight: 400; color: var(--d-muted); font-style: normal; }

.depot-field input,
.depot-field select,
.depot-field textarea {
  font: inherit; font-weight: 400; color: inherit; box-sizing: border-box; width: 100%;
  padding: 10px 12px; border: 1px solid var(--d-line); border-radius: 8px; background: transparent;
}
.depot-field textarea { resize: vertical; }

.depot-full { grid-column: 1 / -1; }
.depot-row { align-items: start; }

.depot-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.depot-template-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--d-accent);
  text-decoration: none;
  white-space: nowrap;
}
.depot-template-link:hover { text-decoration: underline; }
.depot-template-link::before { content: "↓ "; }

.depot-modal :is(input, select, textarea, button):focus-visible {
  outline: 2px solid var(--d-accent); outline-offset: 2px;
}

.depot-message { min-height: 1.3em; margin: 0; font-size: .9rem; color: var(--d-muted); }
.depot-message[data-state="ok"] { color: #1b7a3d; }
.depot-message[data-state="error"] { color: #b3261e; }

.depot-actions { display: flex; justify-content: flex-end; gap: 10px; }
.depot-cancel, .depot-submit { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; cursor: pointer; }
.depot-cancel { background: transparent; border: 1px solid var(--d-line); color: inherit; }
.depot-submit { background: var(--d-accent); border: 0; color: #fff; }
.depot-submit:disabled { opacity: .6; cursor: wait; }

/* ---------- Choix du type d'organisation (radios) ------------ */
/* Groupe de radios avec titre */
.depot-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.depot-fieldset legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: .9rem;
  font-weight: 600;
}
.depot-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.depot-radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--d-line);
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 400;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.depot-radio-option:hover { border-color: var(--d-accent); }

/* Le rond du bouton radio */
.depot-radio-option input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid var(--d-line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color .15s ease;
}
.depot-radio-option input::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--d-accent);
  transform: scale(0);
  transition: transform .12s ease;
}
.depot-radio-option input:checked { border-color: var(--d-accent); }
.depot-radio-option input:checked::before { transform: scale(1); }

/* Carte sélectionnée */
.depot-radio-option:has(input:checked) {
  border-color: var(--d-accent);
  background: color-mix(in srgb, var(--d-accent) 8%, transparent);
  box-shadow: 0 0 0 1px var(--d-accent);
}

/* Focus clavier : un seul contour, autour de la carte */
.depot-radio-option input:focus-visible { outline: none; }
.depot-radio-option:has(input:focus-visible) {
  outline: 2px solid var(--d-accent);
  outline-offset: 2px;
}

.depot-budget-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

@media (max-width: 520px) {
    .depot-row { grid-template-columns: 1fr; }
    .depot-panel { padding: 18px; }
    .depot-radio-group { grid-template-columns: 1fr; }
}