/* ══════════════════════════════════════════════════════════
   IUA Cartographie des Compétences — Formulaire public
   Design plat, sans dégradés
   ══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --theme: #036C70;
  --theme-dark: #025357;
  --theme-light: #E8F2F2;
  --theme-border: #B8D4D5;
  --ink: #1A1A1A;
  --ink-2: #505050;
  --ink-3: #767676;
  --line: #8A8886;
  --bg: #F3F4F4;
  --card: #FFFFFF;
  --border: #D1D1D1;
  --red: #A4262C;
  --red-bg: #FDF2F2;
  --green: #0B6A0B;
  --green-bg: #F1FAF1;
  --warn-bg: #FFF8E6;
  --warn-border: #E8C547;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.06);
  --touch: 44px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.55;
  background: var(--bg);
  min-height: 100vh;
  padding: 20px 16px 64px;
}

.forms-shell { max-width: 680px; margin: 0 auto; }

/* ─── CARTES ─── */
.f-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

/* ─── EN-TÊTE ─── */
.f-banner {
  height: auto;
  min-height: 88px;
  background: var(--theme);
  display: flex;
  align-items: center;
  padding: 20px 28px;
  gap: 14px;
  border-bottom: 3px solid var(--theme-dark);
}
.f-banner .brand-pillar { width: 3px; height: 40px; background: #fff; border-radius: 1px; flex-shrink: 0; }
.f-banner .brand-name { font-family: Georgia, serif; font-size: 26px; font-weight: 700; color: #fff; letter-spacing: 2px; line-height: 1.2; }
.f-banner .brand-sub { font-size: 10px; letter-spacing: 1.5px; color: rgba(255,255,255,.9); text-transform: uppercase; margin-top: 4px; }

.f-head-body { padding: 22px 28px 24px; }
.f-title { font-size: 22px; font-weight: 600; line-height: 1.35; margin-bottom: 10px; color: var(--ink); }
.f-desc { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; max-width: 58ch; }
.f-required-note { font-size: 12px; color: var(--red); margin-top: 14px; font-weight: 500; }

/* Sections repliables */
.f-details { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 2px; }
.f-details details { padding: 10px 0; border-bottom: 1px solid #EBEBEB; }
.f-details details:last-child { border-bottom: none; }
.f-details summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--theme);
  padding: 8px 0; list-style-position: inside; outline: none;
  user-select: none;
}
.f-details summary:hover { color: var(--theme-dark); text-decoration: underline; }
.f-details summary:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; border-radius: 2px; }
.f-details .d-body { font-size: 13px; color: var(--ink-2); padding: 4px 0 12px 4px; line-height: 1.65; max-width: 62ch; }
.f-details .d-body p { margin-bottom: 10px; }
.f-details .d-body p:last-child { margin-bottom: 0; }
.f-details .d-body strong { color: var(--ink); font-weight: 600; }

/* ─── SECTIONS (intercalaires wizard) ─── */
.f-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--theme);
  border-radius: var(--radius);
  padding: 16px 24px 14px;
  margin: 0 0 12px;
  box-shadow: var(--shadow);
}
.f-section .s-label { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--theme); margin-bottom: 4px; }
.f-section .s-title { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.f-section .s-desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }

/* ─── QUESTIONS ─── */
.f-q { padding: 18px 24px 22px; }
.f-q-label {
  font-size: 15px; font-weight: 500; color: var(--ink);
  margin-bottom: 12px; display: block; line-height: 1.45;
}
.f-q-label .qnum { color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.f-q-label .req { color: var(--red); margin-left: 3px; font-weight: 600; }
.f-q-hint { font-size: 12.5px; color: var(--ink-3); margin: -4px 0 14px; line-height: 1.45; }

/* Champs texte */
.f-input, .f-textarea {
  font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card);
  padding: 10px 12px; width: 100%; max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
  min-height: var(--touch);
}
.f-textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.f-input::placeholder, .f-textarea::placeholder { color: var(--ink-3); }
.f-input:hover, .f-textarea:hover { border-color: var(--line); }
.f-input:focus, .f-textarea:focus {
  outline: none; border-color: var(--theme);
  box-shadow: 0 0 0 2px var(--theme-light);
}

/* Liste déroulante */
.f-select {
  font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  padding: 10px 12px; width: 100%; max-width: 100%; cursor: pointer;
  min-height: var(--touch);
  transition: border-color .15s, box-shadow .15s;
}
.f-select:hover { border-color: var(--line); }
.f-select:focus { outline: none; border-color: var(--theme); box-shadow: 0 0 0 2px var(--theme-light); }

/* Cases à cocher */
.f-opts { display: flex; flex-direction: column; gap: 4px; }
.f-opts.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
@media (max-width: 560px) { .f-opts.two-col { grid-template-columns: 1fr; } }
.f-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 10px; border-radius: var(--radius); cursor: pointer;
  font-size: 14px; color: var(--ink); transition: background .12s;
  border: 1px solid transparent; min-height: var(--touch);
}
.f-opt:hover { background: #F7F7F7; border-color: var(--border); }
.f-opt:has(input:focus-visible) { outline: 2px solid var(--theme); outline-offset: 1px; }
.f-opt input[type=checkbox] {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  accent-color: var(--theme); cursor: pointer;
}

/* Curseurs */
.f-range-wrap { display: flex; align-items: center; gap: 16px; width: 100%; padding: 4px 0; }
.f-range-wrap input[type=range] { flex: 1; accent-color: var(--theme); height: 6px; cursor: pointer; min-width: 0; }
.f-range-val { font-size: 14px; font-weight: 600; color: var(--theme); min-width: 64px; text-align: right; flex-shrink: 0; }
.f-scale-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
.f-prog-track { height: 4px; background: #E5E5E5; border-radius: 2px; margin-top: 10px; width: 100%; overflow: hidden; }
.f-prog-fill { height: 100%; background: var(--theme); border-radius: 2px; transition: width .25s ease; }

/* Consentement */
.f-consent {
  background: #FAFAFA; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-size: 13px; color: var(--ink-2);
  margin-bottom: 14px; line-height: 1.6;
}
.f-consent strong { color: var(--ink); font-weight: 600; }

/* ─── ALERTES ─── */
.f-alert {
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 14px 18px; font-size: 14px; margin-bottom: 12px;
  background: var(--card); line-height: 1.5;
}
.f-alert-err { border-left: 4px solid var(--red); background: var(--red-bg); color: var(--red); }
.f-alert-ok { border-left: 4px solid var(--green); background: var(--green-bg); color: var(--green); }
.f-alert-info { border-left: 4px solid var(--theme); background: var(--theme-light); color: var(--ink); }

/* ─── WIZARD ─── */
.f-wizard-bar {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 20px; margin-bottom: 12px;
  position: sticky; top: 8px; z-index: 40;
}
.f-wizard-track { height: 5px; background: #E5E5E5; border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.f-wizard-fill { height: 100%; background: var(--theme); border-radius: 3px; transition: width .3s ease; width: 12.5%; }
.f-wizard-label { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center; letter-spacing: .2px; }

.f-step { display: none; }
.f-step.active { display: block; animation: fFadeIn .2s ease; }
@keyframes fFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.f-wizard-nav {
  display: flex; align-items: stretch; justify-content: space-between; gap: 10px;
  padding: 16px 0 4px; flex-wrap: wrap; margin-top: 4px;
}
.f-wizard-nav .f-btn { flex: 1; min-width: 140px; justify-content: center; min-height: var(--touch); }

.f-draft-notice {
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-left: 4px solid var(--warn-border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 12px; font-size: 13px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; line-height: 1.45;
}

.f-recap { padding: 18px 24px 22px; }
.f-recap-intro { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; line-height: 1.5; }
.f-recap-list { display: grid; gap: 0; }
.f-recap-item {
  display: grid; grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 8px 16px; padding: 12px 0;
  border-bottom: 1px solid #EBEBEB; font-size: 14px;
}
.f-recap-item:last-child { border-bottom: none; }
.f-recap-item dt { font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; padding-top: 2px; }
.f-recap-item dd { color: var(--ink); margin: 0; word-break: break-word; line-height: 1.45; }
@media (max-width: 560px) {
  .f-recap-item { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
  .f-recap-item dt { font-size: 11px; }
}

/* Boutons */
.f-btn {
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 24px; border-radius: var(--radius); cursor: pointer; border: none;
  transition: background .15s, border-color .15s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; line-height: 1.2;
}
.f-btn:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; }
.f-btn:disabled { opacity: .45; cursor: not-allowed; }
.f-btn-primary { background: var(--theme); color: #fff; border: 1px solid var(--theme-dark); }
.f-btn-primary:hover:not(:disabled) { background: var(--theme-dark); }
.f-btn-plain { background: var(--card); color: var(--ink-2); border: 1px solid var(--border); }
.f-btn-plain:hover:not(:disabled) { background: #F7F7F7; border-color: var(--line); }

/* ─── CONFIRMATION ─── */
.f-thanks { padding: 40px 28px 44px; text-align: center; }
.f-thanks .tick {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--theme); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; position: relative;
}
.f-thanks .tick::after {
  content: '';
  display: block; width: 10px; height: 18px;
  border: solid #fff; border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -2px);
}
.f-thanks h2 { font-size: 20px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.f-thanks p { font-size: 14px; color: var(--ink-2); margin-bottom: 24px; max-width: 40ch; margin-left: auto; margin-right: auto; line-height: 1.55; }

/* ─── PIED DE PAGE ─── */
.f-footer {
  text-align: center; font-size: 12px; color: var(--ink-3);
  padding: 24px 12px 0; line-height: 1.75;
}
.f-footer a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.f-footer a:hover { color: var(--theme); }
.f-footer .sep { margin: 0 5px; color: var(--border); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  body { padding: 12px 10px 48px; font-size: 14px; }
  .forms-shell { max-width: 100%; }

  .f-banner { padding: 16px 18px; min-height: 76px; }
  .f-banner .brand-name { font-size: 22px; }
  .f-head-body { padding: 16px 18px 20px; }
  .f-title { font-size: 19px; }

  .f-section { padding: 14px 16px 12px; }
  .f-section .s-title { font-size: 16px; }
  .f-q { padding: 14px 16px 18px; }
  .f-q-label { font-size: 14px; margin-bottom: 10px; }

  .f-wizard-bar { top: 0; border-radius: 0; margin-left: -10px; margin-right: -10px; border-left: none; border-right: none; }

  .f-wizard-nav {
    flex-direction: column-reverse; gap: 8px;
    position: sticky; bottom: 0;
    background: var(--bg);
    padding: 12px 0; margin: 0;
    z-index: 50; border-top: 1px solid var(--border);
  }
  .f-wizard-nav .f-btn { width: 100%; min-width: 0; }
  #btn-prev { order: 2; }
  #btn-next, #btn-submit { order: 1; }

  .f-draft-notice { flex-direction: column; align-items: stretch; text-align: left; }
  .f-draft-notice .f-btn { width: 100%; }

  .f-thanks { padding: 28px 18px 32px; }
  .f-details summary { font-size: 12.5px; }
}

@media (max-width: 480px) {
  .f-title { font-size: 17px; }
  .f-banner .brand-name { font-size: 20px; letter-spacing: 1.5px; }
}
