/* Base commune : polices système, jetons de couleur (bleu / blanc / navy), composants simples. */
:root {
  --navy: #0f1b3d;
  --ink: #16213e;
  --muted: #4a5670;
  --blue: #1a4fd6;
  --blue-strong: #123da8;
  --blue-soft: #eaf1ff;
  --blue-softer: #f4f7fd;
  --line: #d6deeb;
  --line-strong: #b4c1d8;
  --bg: #ffffff;
  --ok: #0f6b3a;
  --ok-bg: #e8f5ed;
  --warn: #8a4b00;
  --warn-bg: #fff4e0;
  --ko: #b42318;
  --ko-bg: #fdecea;
  --info: #1a4fd6;
  --info-bg: #eaf1ff;
  --focus: #f0a400;
  --radius: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
  color: var(--navy);
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--blue);
}
a:hover {
  color: var(--blue-strong);
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.icon {
  flex: none;
  vertical-align: -0.2em;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.skip-link:focus {
  top: 8px;
  color: #fff;
}
.small {
  font-size: 0.875rem;
}
.muted {
  color: var(--muted);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue-strong);
  color: #fff;
}
.btn-secondary {
  background: #fff;
  color: var(--blue-strong);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  background: var(--blue-softer);
}
.btn-danger {
  background: var(--ko);
  color: #fff;
}
.btn-lg {
  min-height: 52px;
  padding: 0.7rem 1.6rem;
  font-size: 1.05rem;
}
.btn-small {
  min-height: 32px;
  padding: 0.25rem 0.6rem;
  font-size: 0.875rem;
  background: #fff;
  border-color: currentColor;
  color: inherit;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 0.4rem 0.2rem;
  min-height: 36px;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover {
  color: var(--blue-strong);
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  cursor: pointer;
}

/* Formulaires */
.field {
  margin: 0 0 1.25rem;
}
.field-label,
fieldset.field legend {
  display: block;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
fieldset.field {
  border: 0;
  padding: 0;
  min-width: 0;
}
.input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  min-height: 44px;
}
.input::placeholder,
textarea::placeholder {
  color: #66718a;
}
.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  cursor: pointer;
  background: #fff;
}
.choice-item:hover {
  border-color: var(--line-strong);
}
.choice-item input {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--blue);
}
.choice-item:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-softer);
}

/* Avis */
.notice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 1rem;
}
.notice p:last-child {
  margin-bottom: 0;
}
.notice-info {
  background: var(--info-bg);
  border-color: #b9cdf6;
}
.notice-warn {
  background: var(--warn-bg);
  border-color: #f0c784;
  color: #4d2a00;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.tag-ko {
  color: var(--ko);
  background: var(--ko-bg);
  margin-left: 0.4rem;
}
.tag-fictive {
  color: var(--muted);
  background: #f3f4f7;
}
.tag-self {
  color: var(--blue-strong);
  background: var(--blue-soft);
}

/* Dialogues */
.dialog {
  border: 0;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: min(560px, calc(100vw - 2rem));
  box-shadow: 0 20px 60px rgba(15, 27, 61, 0.35);
  color: var(--ink);
}
.dialog::backdrop {
  background: rgba(15, 27, 61, 0.55);
}
.dialog-title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--serif);
  font-size: 1.35rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.dialog-large {
  max-width: min(1100px, calc(100vw - 2rem));
  width: 100%;
  max-height: calc(100vh - 2rem);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.icon-warn {
  color: var(--warn);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
