/* Charte reprise de vigilus-facilities.com */
:root {
    --red: #be1933; --red-dk: #9e1528; --red-lt: #fdf3f5;
    --blue: #18a4e3; --blue-dk: #1182b8; --blue-lt: #eaf7fd;
    --dark: #09131f; --dark-2: #0e1f33;
    --ink: #1c2735; --muted: #64748b; --line: #e2e8f0; --bg: #f1f5f9; --white: #fff;
    --good: #16a34a; --mid: #d97706; --bad: #be1933;
    --r: 4px;
    --font-h: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
    --font-b: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-b); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-h); color: var(--dark); line-height: 1.2; margin: 0 0 .6em; }
a { color: var(--blue-dk); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); font-size: .9rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Topbar */
.topbar { background: #fff; border-bottom: 3px solid var(--red); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; min-height: 108px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--dark); font-family: var(--font-h); font-weight: 600; }
.brand img { height: 88px; width: auto; display: block; }
.brand span { font-size: 1.2rem; letter-spacing: .01em; }
.lock { color: var(--blue-dk); font-size: .9rem; font-weight: 600; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .92rem; }
.topbar nav a:hover { color: var(--blue-dk); }

/* Hero */
.hero { background: #fff; border-bottom: 1px solid var(--line); color: var(--ink); padding: 44px 0 48px; }
.hero-sm { padding: 36px 0 40px; }
.hero h1 { color: var(--dark); font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: .4em; }
.hero .lead { max-width: 720px; color: #475569; font-size: 1.02rem; }
.eyebrow { display: inline-block; margin: 0 0 12px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.eyebrow::before { content: ''; display: inline-block; width: 26px; height: 3px; background: var(--red); vertical-align: middle; margin-right: 10px; }
.scale-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: .85rem; color: var(--muted); }
.scale-legend b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-lt); color: var(--blue-dk); margin-right: 4px; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(9,19,31,.04); }
main.container { padding-top: 28px; padding-bottom: 56px; }
.privacy { border-color: #ccedfb; background: var(--blue-lt); }
.privacy ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink); font-size: .93rem; }
.theme h2 { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.num { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: var(--r); background: var(--red); color: #fff; font-size: .95rem; font-weight: 700; }

/* Progress */
.progress { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.progress-in { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; font-size: .85rem; font-weight: 600; color: var(--dark); }
.progress-track { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-track .bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--blue-dk)); transition: width .25s; }

/* Questions */
.question { border: 0; padding: 0; margin: 0 0 26px; min-inline-size: 0; border-radius: var(--r); }
.question legend { padding: 0; font-weight: 600; color: var(--dark); margin-bottom: 12px; }
.question legend small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.question.has-error { outline: 2px solid var(--red); outline-offset: 8px; background: var(--red-lt); }
.err { color: var(--red); font-weight: 600; font-size: .88rem; margin: 8px 0 0; }
.rates { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rates.nps { grid-template-columns: repeat(11, 1fr); gap: 5px; }
.rate { display: block; cursor: pointer; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; text-align: center; border: 2px solid var(--line); border-radius: var(--r); background: #fff; transition: .15s; }
.pill b { font-family: var(--font-h); font-size: 1.35rem; color: var(--dark); }
.pill i { font-style: normal; font-size: .7rem; line-height: 1.2; color: var(--muted); }
.nps .pill { min-height: 46px; }
.nps .pill b { font-size: 1.05rem; }
.rate:hover .pill { border-color: var(--blue); background: var(--blue-lt); }
.rate input:focus-visible + .pill { outline: 3px solid var(--blue); outline-offset: 2px; }
.rate input:checked + .pill { border-color: var(--blue-dk); background: var(--blue); }
.rate input:checked + .pill b, .rate input:checked + .pill i { color: #fff; }
textarea, select, input[type=text], input[type=password], input[type=number], input[type=date] { width: 100%; font: inherit; color: var(--ink); padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: var(--r); background: #fff; }
textarea:focus, select:focus, input:focus { outline: 3px solid rgba(24,164,227,.35); border-color: var(--blue); }
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.submit-row { text-align: center; padding-top: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--r); cursor: pointer; text-decoration: none; transition: .15s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dk); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dk); }
.btn-outline { background: #fff; border-color: #cbd5e1; color: var(--dark); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-dk); }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }

/* Messages */
.msg { text-align: center; padding: 40px 24px; font-size: 1.05rem; background: var(--blue-lt); border-color: #ccedfb; }
.msg-success { background: #ecfdf3; border-color: #bbf7d0; }
.msg-error { background: var(--red-lt); border-color: #f5c5d0; }
.alert { padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-weight: 500; }
.alert-ok { background: #ecfdf3; color: #14532d; border: 1px solid #bbf7d0; }
.alert-error { background: var(--red-lt); color: var(--red-dk); border: 1px solid #f5c5d0; }
.alert-info { background: var(--blue-lt); color: #0b5a80; border: 1px solid #ccedfb; }

/* Footer */
.footer { background: #e9eef4; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; padding: 22px 0; text-align: center; }

/* ---------- Admin ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-draft { background: #e2e8f0; color: #475569; }
.badge-open { background: #dcfce7; color: #166534; }
.badge-closed { background: var(--red-lt); color: var(--red-dk); }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpi { margin: 0; padding: 18px 20px; }
.kpi .label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-family: var(--font-h); font-size: 2.2rem; font-weight: 700; color: var(--dark); line-height: 1.1; margin-top: 4px; }
.kpi .value small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.kpi .sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.value.good { color: var(--good); } .value.mid { color: var(--mid); } .value.bad { color: var(--bad); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #f8fafc; }
td.num-c, th.num-c { text-align: right; white-space: nowrap; }
.score-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) 3fr 70px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.score-row:last-child { border-bottom: 0; }
.score-row .t { font-weight: 600; color: var(--dark); }
.score-row .t small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.score-row .s { font-family: var(--font-h); font-weight: 700; font-size: 1.15rem; text-align: right; }
.s.good { color: var(--good); } .s.mid { color: var(--mid); } .s.bad { color: var(--bad); } .s.na { color: var(--muted); }
.stack { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--line); }
.stack .bar { display: block; height: 100%; }
.d1 { background: #be1933; } .d2 { background: #e06080; } .d3 { background: #cbd5e1; } .d4 { background: #7cc8ee; } .d5 { background: #18a4e3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); margin: 6px 0 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.comment { background: #f8fafc; border: 1px solid var(--line); padding: 10px 14px; margin: 8px 0; border-radius: var(--r); white-space: pre-wrap; font-size: .93rem; }
.notice { text-align: center; padding: 34px 20px; }
.notice .big { font-family: var(--font-h); font-size: 1.3rem; color: var(--dark); margin-bottom: 6px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: .85rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form .field { margin: 0; }
.inline-form .grow { min-width: 260px; flex: 2; }
.inline-form form { margin: 0; }
.table-wrap { overflow-x: auto; }
.sep-top { margin-top: 12px; }
.sep { height: 1px; background: var(--line); margin: 18px 0; }
.inline-form input[type=number] { width: 110px; }
.inline-form input[type=date] { width: auto; }
.copybox { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.login-card { max-width: 420px; margin: 48px auto; }
.danger { border-color: #f5c5d0; background: var(--red-lt); }
h2.sec { font-size: 1.25rem; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
h2.sec::before { content: ''; width: 5px; height: 22px; background: var(--red); border-radius: 2px; }

/* Rapport imprimable */
.report-wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.report-head { border-bottom: 4px solid var(--red); padding-bottom: 14px; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.report-head img { height: 88px; width: auto; }
.report-head h1 { margin: 0; font-size: 1.6rem; }
.report-head p { margin: 4px 0 0; color: var(--muted); }
.noprint { background: #e9eef4; border-bottom: 1px solid var(--line); padding: 12px 20px; text-align: right; }

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .pill i { display: none; }
    .pill { min-height: 54px; }
    .rates.nps { grid-template-columns: repeat(6, 1fr); }
    .score-row { grid-template-columns: 1fr 60px; }
    .score-row .stack { grid-column: 1 / -1; order: 3; }
    .brand span { display: none; }
    .topbar-in { min-height: 84px; }
    .brand img { height: 64px; }
    .card { padding: 18px; }
    th, td { padding: 8px 6px; }
}
@media print {
    body { background: #fff; }
    .noprint, .topbar, .footer { display: none !important; }
    .card { box-shadow: none; break-inside: avoid; }
    .report-wrap { padding: 0; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    h2.sec { break-after: avoid; }
}
