/* Page questionnaire patient MedAuto. Charte : bleu #4662A0, fond #F4F6FB. */
:root {
  --accent: #4662A0;
  --accent-hover: #3A5389;
  --accent-soft: #EEF2FA;
  --on-accent: #FFFFFF;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --border: #E3E7EF;
  --text: #1D2125;
  --text-2: #5F6774;
  --text-3: #8A919C;
  --star: #F2B01E;
  --star-off: #D9DEE7;
  --ok: #1F7A4D;
  --ok-soft: #E8F5EE;
  --warn: #A4471B;
  --warn-soft: #FCEFE7;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8DA6DA;
    --accent-hover: #A3B8E3;
    --accent-soft: #232B3B;
    --on-accent: #1D2125;
    --bg: #14171C;
    --card: #1C2027;
    --border: #2C323C;
    --text: #ECEEF2;
    --text-2: #A7AEBA;
    --text-3: #7D8592;
    --star-off: #3A414D;
    --ok: #6FCF9C;
    --ok-soft: #18291F;
    --warn: #F0A27A;
    --warn-soft: #2E1F18;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }

.page { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  animation: rise 320ms var(--ease);
}
@media (min-width: 600px) { .page { padding-top: 48px; } .card { padding: 32px; } }

.preview-banner {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 16px;
}

.cabinet { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.cabinet-logo, .cabinet-initials {
  width: 48px; height: 48px; border-radius: 12px; flex: none; object-fit: contain;
  background: var(--accent-soft);
}
.cabinet-initials { display: grid; place-items: center; color: var(--accent); font-weight: 700; }
.cabinet-name { font-weight: 700; line-height: 1.3; }
.cabinet-practitioner { font-size: 14px; color: var(--text-2); }

h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 8px; }
@media (min-width: 600px) { h1 { font-size: 26px; } }
.muted { color: var(--text-2); margin: 0 0 20px; }

fieldset { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
legend, .question-label { font-weight: 600; margin-bottom: 4px; padding: 0; display: block; }
.question-help { font-size: 14px; color: var(--text-2); margin: 0 0 8px; }
.required-mark { color: var(--text-3); font-weight: 400; }

.stars { display: flex; gap: 4px; position: relative; }
.stars label {
  cursor: pointer; font-size: 36px; line-height: 1; color: var(--star-off);
  padding: 2px; border-radius: 6px; transition: color 120ms var(--ease), transform 120ms var(--ease);
}
.stars label.is-on { color: var(--star); }
.stars label:hover { transform: scale(1.08); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.caption { font-size: 14px; color: var(--text-2); min-height: 21px; margin-top: 2px; }

.scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; position: relative; }
.scale label {
  display: grid; place-items: center; min-height: 44px; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-weight: 600; font-size: 14px; background: var(--card);
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease);
}
.scale input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.scale input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.scale-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 4px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.choices label {
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; background: var(--card);
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease);
}
.choices input:checked + label { background: var(--accent-soft); border-color: var(--accent); }
.choices input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

textarea {
  width: 100%; min-height: 112px; resize: vertical; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
}
.counter { text-align: right; font-size: 13px; color: var(--text-3); margin-top: 4px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text-2); cursor: pointer; margin: 0 0 20px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: progress; }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text); }
.link-btn {
  background: none; border: 0; padding: 12px 0 0; cursor: pointer; width: 100%;
  color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; font-size: 15px;
}

.errors { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; font-size: 15px; }
.errors ul { margin: 0; padding-left: 18px; }

.state-icon { width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; font-size: 26px; margin-bottom: 16px; }
.state-icon.ok { background: var(--ok-soft); color: var(--ok); }
.state-icon.neutral { background: var(--accent-soft); color: var(--accent); }

.skeleton { background: var(--border); border-radius: 8px; height: 14px; margin-bottom: 12px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 20px; }
.skeleton-title { height: 24px; width: 70%; }
.skeleton-line.short { width: 45%; }

.foot { text-align: center; padding: 8px 16px 24px; font-size: 13px; }
.foot a { color: var(--text-3); text-decoration: none; }
.foot a:hover { color: var(--text-2); text-decoration: underline; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
