/* Espace Socrates HR — feuille de style */
:root {
  --navy: #052F63;
  --turq: #00A2CF;
  --turq-light: #E6F6FB;
  --gray: #3C3C3B;
  --muted: #6B7280;
  --line: #E2E8F0;
  --bg: #F4F7FA;
  --white: #FFFFFF;
  --ok: #2F9E44;
  --err: #C92A2A;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(5, 47, 99, .06), 0 4px 16px rgba(5, 47, 99, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--gray);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--turq); }
img { max-width: 100%; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; margin-top: 1.4em; }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* En-tête */
.topbar { background: var(--white); border-bottom: 3px solid var(--turq); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar .logo img { height: 34px; display: block; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.topbar nav a, .topbar nav button { font: inherit; font-size: .93rem; color: var(--navy); text-decoration: none; padding: 6px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.topbar nav a:hover, .topbar nav button:hover { background: var(--turq-light); }

main { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }
main.wide { max-width: 1100px; }
footer.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 16px 30px; }

/* Cartes */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; margin-bottom: 18px; }
.card > :last-child { margin-bottom: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--turq); font-weight: 700; margin-bottom: .3em; }
.hero-result h2 { font-size: 1.4rem; }

/* Formulaires */
label { display: block; font-weight: 600; color: var(--navy); margin: 0 0 6px; font-size: .95rem; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid #CBD5E1; border-radius: 10px; background: #fff; color: var(--gray);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--turq); box-shadow: 0 0 0 3px rgba(0, 162, 207, .18); }
.field.has-error input, .field.has-error textarea { border-color: var(--err); }
.error-msg { color: var(--err); font-size: .88rem; margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--gray); font-size: .9rem; }
.check input { margin-top: 4px; width: 20px; height: 20px; flex: none; accent-color: var(--turq); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  background: var(--turq); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; }
.btn:hover { filter: brightness(.95); }
.btn.big { width: 100%; padding: 15px 20px; font-size: 1.05rem; }
.btn.navy { background: var(--navy); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid #CBD5E1; }
.btn.danger { background: #fff; color: var(--err); border: 1.5px solid #F1B5B5; }
.btn.sm { padding: 6px 10px; font-size: .84rem; border-radius: 8px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: #E9F7EE; color: #1E6B30; border: 1px solid #BFE5CB; }
.flash.error { background: #FDECEC; color: #8F1D1D; border-color: #F4C4C4; }

/* Accueil participant */
.session-head { border-left: 5px solid var(--turq); }
.session-head .company { color: var(--muted); font-size: .95rem; margin-bottom: .2em; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--muted); }

/* Questionnaire */
.progress-wrap { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 10px 0 12px; }
.progress { height: 8px; background: #DCE6EE; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--turq); transition: width .25s; }
.progress-label { font-size: .85rem; color: var(--muted); margin-top: 5px; display: flex; justify-content: space-between; }
.q { min-width: 0; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 14px; border: 2px solid transparent; scroll-margin-top: 70px; }
.q.missing { border-color: var(--err); }
.q .qtext { font-weight: 600; color: var(--navy); margin-bottom: 12px; display: flex; gap: 10px; }
.q .qnum { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--turq-light); color: var(--navy); font-size: .85rem; display: grid; place-items: center; }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { margin: 0; text-align: center; font-weight: 600; font-size: .9rem; color: var(--navy); border: 1.5px solid #CBD5E1; border-radius: 10px; padding: 10px 2px; cursor: pointer; background: #fff; user-select: none; }
.scale label span { display: block; font-size: 1.1rem; }
.scale input:checked + label { background: var(--navy); border-color: var(--navy); color: #fff; }
.scale input:focus-visible + label { box-shadow: 0 0 0 3px rgba(0, 162, 207, .35); }
@media (max-width: 380px) { .scale label { font-size: .78rem; } }

/* Résultats */
.chart svg { width: 100%; height: auto; display: block; }
.chart-map { max-width: 520px; margin: 0 auto 10px; }
.chip { display: inline-block; color: #fff; font-weight: 700; padding: 3px 12px; border-radius: 99px; font-size: 1rem; margin: 0 4px 4px 0; }
.style-row { border-left: 4px solid var(--turq); padding: 6px 0 6px 14px; margin-bottom: 14px; }
.style-row p { margin-bottom: .35em; }
.style-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.style-head .score { font-size: .88rem; color: var(--muted); font-weight: 600; }

/* Admin */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-bottom: .15em; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl tr.rowlink { cursor: pointer; }
.tbl tr.rowlink:hover td { background: #F8FBFD; }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #EEF2F6; color: var(--navy); white-space: nowrap; }
.badge.open { background: #E3F6E9; color: #1E6B30; }
.badge.closed { background: #F3F4F6; color: #6B7280; }
.badge.warn { background: #FFF4E5; color: #8A4B00; }
.badge.err { background: #FDECEC; color: #8F1D1D; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi .v { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.kpi .l { font-size: .82rem; color: var(--muted); }
.share { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
.share canvas, .share .qr { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; border-radius: 8px; }
.linkbox { display: flex; gap: 6px; }
.linkbox input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.code-big { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.4rem; font-weight: 800; letter-spacing: .12em; color: var(--navy); }
@media (max-width: 640px) { .share { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 210px; }
.actions .btn, .actions form { margin: 0; }
.actions .btn { margin: 2px 0; }
details.danger-zone summary { cursor: pointer; color: var(--err); font-weight: 600; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.objective { white-space: pre-line; }

/* Barres de scores (web) */
.hbars { margin: 6px 0 4px; }
.hb-scale { position: relative; height: 20px; margin-left: 38%; margin-right: 40px; font-size: .75rem; color: var(--muted); }
.hb-scale span { position: absolute; top: 0; text-align: center; }
.hb-row { display: grid; grid-template-columns: 38% 1fr 40px; align-items: center; gap: 0; margin-bottom: 8px; }
.hb-label { font-weight: 700; color: var(--navy); font-size: .9rem; padding-right: 10px; text-align: right; line-height: 1.2; }
.hb-track { position: relative; height: 22px; border-radius: 4px; background: linear-gradient(90deg, #F1F5F9 0 30%, #E2E8F0 30% 70%, #F1F5F9 70% 100%); }
.hb-fill { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 3px; }
.hb-range { position: absolute; top: 50%; height: 12px; margin-top: -6px; border-left: 2px solid #0F172A; border-right: 2px solid #0F172A; }
.hb-range::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; border-top: 2px solid #0F172A; }
.hb-val { font-weight: 800; color: var(--navy); text-align: right; }
