:root {
  --ink: #1a1a1a;
  --muted: #5f5e5a;
  --border: #e2e0d8;
  --bg: #faf9f6;
  --card: #ffffff;
  --accent: #1a1a1a;
  --accent-dark: #000000;
  --brand-gold: #fdb913;
  --brand-gold-dark: #6b4e00;
  --error: #b3261e;
  --success: #0f6e56;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.brand-logo { display: block; height: 38px; width: auto; }
.wordmark { font-weight: 700; letter-spacing: 0.02em; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand .brand-logo { height: 30px; }
.admin-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

.lang-switch a, .lang-switch .lang-current {
  display: inline-block;
  padding: 4px 7px;
  text-transform: uppercase;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 4px;
}

.lang-switch a:hover, .lang-switch a:focus-visible { color: var(--ink); background: var(--bg); }

.lang-switch .lang-current {
  color: var(--ink);
  font-weight: 700;
  background: var(--bg);
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 20px; margin-top: 4px; }
h3 { font-size: 16px; }

.intro { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-top: 20px;
}

.step-indicator {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-gold-dark);
}

.step-indicator::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 2px;
  background: var(--brand-gold);
  vertical-align: middle;
}

.field { margin-bottom: 18px; }

label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="text"], input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[aria-invalid="true"] { border-color: var(--error); }

.field-help { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--error); font-weight: 600; }

.error-banner {
  padding: 10px 12px;
  border: 1px solid var(--error);
  border-radius: 6px;
  color: var(--error);
  background: #fdf2f2;
  font-weight: 600;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 2px; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
  margin-top: 10px;
}
.btn-secondary:hover { background: var(--bg); }

.form-back { margin-top: 0; }

.declaration {
  margin: 12px 0 20px;
  padding: 14px 16px;
  border-left: 4px solid var(--brand-gold);
  background: var(--bg);
  font-style: italic;
}

.success-icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  margin: 0 auto 12px;
  text-align: center;
  font-size: 26px;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
}

.ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--muted);
}

.hp-field {
  display: none;
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .container { padding: 20px 14px 40px; }
  .card { padding: 18px 16px; }
  h1 { font-size: 22px; }
}

.container-wide { max-width: 1080px; }

.admin-nav { display: flex; gap: 14px; align-items: center; }
.admin-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.admin-nav a:hover { color: var(--ink); }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}
.link-button:hover { color: var(--ink); }

.card-narrow { max-width: 380px; }

.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.status-tabs a {
  padding: 6px 11px;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}
.status-tabs a:hover { color: var(--ink); }
.status-tabs .tab-active { color: #fff; background: var(--accent); border-color: var(--accent); }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input[type="search"] {
  flex: 1;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.btn-inline { width: auto; padding: 9px 16px; font-size: 14px; margin: 0; }

.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.data-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  background: #ececec;
  color: #444;
}
.badge-recue { background: #e6f1fb; color: #0c447c; }
.badge-accuse_envoye { background: #eeedfe; color: #3c3489; }
.badge-en_traitement { background: #faeeda; color: #854f0b; }
.badge-alternative_proposee { background: #faeeda; color: #854f0b; }
.badge-retour_attendu { background: #faeeda; color: #854f0b; }
.badge-remboursee { background: #e1f5ee; color: #085041; }
.badge-cloturee { background: #f1efe8; color: #444441; }
.badge-a_verifier { background: #fcebeb; color: #791f1f; }

.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.deadline-overdue { color: var(--error); font-weight: 700; }
.check-ok { color: var(--success); font-weight: 700; }
.check-warn { color: var(--error); font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { font-weight: 600; font-size: 14px; }
.kv dd { margin: 0; font-size: 14px; }

select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.notes {
  white-space: pre-wrap;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}
.btn-danger:hover { background: #fdf2f2; }

.reassure {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.reassure li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.reassure li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: -1px;
  width: 17px;
  height: 17px;
  line-height: 17px;
  text-align: center;
  font-size: 11px;
  color: var(--brand-gold-dark);
  background: #fdf2d0;
  border-radius: 50%;
}
.footer-help { margin: 0 0 4px; }
.footer-legal { margin: 8px 0 0; opacity: 0.8; }
.site-footer a { color: var(--ink); }

.howit { margin-top: 28px; }
.howit h2 { font-size: 17px; margin-bottom: 12px; }
.howit-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: howit;
}
.howit-steps li {
  position: relative;
  padding: 0 0 14px 40px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.howit-steps li::before {
  counter-increment: howit;
  content: counter(howit);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  background: var(--brand-gold);
  border-radius: 50%;
}
.howit-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 28px;
  bottom: 2px;
  width: 2px;
  background: var(--border);
}
