:root {
  --navy: #123c5a;
  --navy-dark: #0d2c43;
  --accent: #2c7fb8;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #22303c;
  --muted: #5c6b78;
  --border: #d7dee4;
  --error: #b3261e;
  --error-bg: #fdecea;
  --ok: #1e7a46;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(18, 60, 90, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

/* Header / footer */
.site-header { background: var(--navy); padding: 16px 20px; display: flex; justify-content: center; }
.site-header .logo { height: 76px; width: auto; display: block; }
.brand { display: inline-block; }
.site-footer { text-align: center; color: var(--muted); padding: 28px 20px; font-size: .9rem; }
.site-footer p { margin: 4px 0; }
.rgpd-link a { color: var(--navy); }

.wrap { max-width: 820px; margin: 0 auto; padding: 28px 20px 40px; }

h1 { color: var(--navy); font-size: 1.7rem; margin: .2em 0 .4em; }
h2 { color: var(--navy); }
a { color: var(--navy); }

/* Introduction */
.intro { margin-bottom: 8px; }
.intro .lead { font-size: 1.15rem; color: var(--navy); font-weight: 600; margin: 0 0 6px; }
.intro .duree { color: var(--muted); font-weight: 600; margin: 0 0 16px; }
.intro p { color: var(--text); }
.puces { margin: 8px 0 16px; padding-left: 20px; }
.puces li { margin: 6px 0; color: var(--muted); }

/* Bloc de questions */
.fieldset {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 22px 18px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

.question { margin: 22px 0; padding-top: 6px; border-top: 1px solid var(--border); }
.question:first-child { border-top: 0; }
.q-label { font-weight: 600; margin: 0 0 8px; color: var(--navy); }
.req { color: var(--error); }
.help { margin: 0 0 8px; color: var(--muted); font-size: .88rem; }

input[type=text], input[type=email], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--navy); border-color: var(--navy); }
textarea { resize: vertical; }

.radio-group, .check-group { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.opt { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; cursor: pointer; }
.opt input { margin-top: 4px; flex: none; }
.opt input:disabled + span { color: var(--muted); }

.precision { margin: 10px 0 0; padding-left: 4px; }
.precision label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; color: var(--muted); }

.consent .opt { font-weight: 400; }

.question.has-error input, .question.has-error textarea,
.precision.has-error input { border-color: var(--error); background: var(--error-bg); }
.error-msg { color: var(--error); font-size: .85rem; margin: 5px 0 0; font-weight: 600; }

.alert { padding: 14px 18px; border-radius: var(--radius); margin: 16px 0; }
.alert-error { background: var(--error-bg); border: 1px solid var(--error); color: #7a1a15; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 8px; border: 2px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: #eef3f7; }
.btn-danger { background: #fff; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.inline-form { display: inline; margin: 0; }

/* Honeypot caché */
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Confirmation */
.confirm { text-align: center; background: var(--card); border-radius: var(--radius); padding: 40px 24px; box-shadow: var(--shadow); }
.confirm-icon { width: 68px; height: 68px; line-height: 68px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; margin: 0 auto 14px; }

/* Contenu légal */
.legal h2 { font-size: 1.1rem; margin-top: 22px; }

/* Back-office */
.admin-bar { background: var(--navy); color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.admin-bar a { color: #fff; }
table.data { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: .92rem; }
table.data th { background: var(--navy); color: #fff; }
table.data tr:hover td { background: #f0f5f9; }
.detail-grid { display: grid; grid-template-columns: 260px 1fr; gap: 6px 16px; background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-grid dt { font-weight: 700; color: var(--navy); }
.detail-grid dd { margin: 0; }
.login-box { max-width: 380px; margin: 40px auto; background: #fff; padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.stat { background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--navy); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.stat .l { color: var(--muted); font-size: .85rem; }
.field { margin: 14px 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 5px; }

@media (max-width: 560px) {
  .site-header .logo { height: 60px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* Impression */
@media print {
  .site-header, .site-footer, .actions, .admin-bar { display: none !important; }
  body { background: #fff; }
  .fieldset, .confirm, table.data { box-shadow: none; border: 1px solid #999; }
  a { color: #000; text-decoration: none; }
}
