/* Dialogue — le composant qui dessine le concept Dialogue : un <dialog> ouvert par
   showModal() (static/js/dialogue.js), sur fond assombri. Référence : docs/design-system.md. */

.dialogue {
  width: calc(100% - 2 * var(--space-4));
  max-width: 560px;
  max-height: calc(100% - 2 * var(--space-4));
  margin: auto;
  padding: 0;
  overflow-y: auto;
  color: var(--color-text);
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px color-mix(in srgb, var(--color-shadow) 20%, transparent);
}

.dialogue::backdrop {
  background: var(--color-overlay);
}

.dialogue--sm {
  max-width: 440px;
}

.dialogue--lg {
  max-width: 720px;
}

.dialogue--xl {
  max-width: 960px;
}

.dialogue__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.dialogue__title {
  margin: 0;
  font-size: var(--text-16);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

.dialogue__close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-16);
  line-height: normal;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.dialogue__close:hover {
  color: var(--color-text);
  background: var(--color-bg-subtle);
}

/* L'échec d'une action confirmée (DIAL-002.3), écrit par htmx ; vide, la zone ne se voit pas. */
.dialogue__error {
  margin: var(--space-4) var(--space-6) 0;
  padding: var(--space-3) var(--space-4);
  color: var(--badge-danger-text);
  font-size: var(--text-13);
  line-height: var(--leading-snug);
  background: var(--badge-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-md);
}

.dialogue__error:empty {
  display: none;
}

.dialogue__body {
  padding: var(--space-6);
}

.dialogue__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
}
