/* Questionnaire — s'appuie sur les variables et boutons de styles.css */

.q-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.q-main { flex: 1; }

/* ---------- En-tête + progression ---------- */
.q-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #D3E3DA;
  border-bottom: 1px solid var(--silver);
  padding: 18px 0 20px;
}
.q-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.q-brand {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 15px;
  color: var(--night);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-brand:hover { color: var(--emerald); }
.q-step-count {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  color: var(--emerald);
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.progress {
  height: 8px;
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--night);
  border-radius: 999px;
  transition: width .3s ease;
}

/* ---------- Écran ---------- */
.q-container {
  max-width: 720px;
  padding-top: 64px;
  padding-bottom: 80px;
}
.q-part {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 28px;
}
.q-title {
  font-size: clamp(28px, 4vw, 38px);
  color: var(--emerald);
  margin-bottom: 24px;
}

.q-field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.q-field + .q-field { margin-top: 44px; }

.q-label {
  display: block;
  padding: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.3;
  color: var(--night);
  margin-bottom: 8px;
}
.q-label:focus,
.q-title:focus,
[tabindex="-1"]:focus { outline: none; }
.q-req {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--ink);
  opacity: .7;
  white-space: nowrap;
}
.q-hint {
  font-size: 15px;
  color: var(--ink);
  opacity: .75;
  margin: 0 0 18px;
}
.q-label + .q-options,
.q-label + .input-group,
.q-label + .input,
.q-label + .q-sub { margin-top: 18px; }

.q-sublabel {
  display: block;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  color: var(--night);
  margin-bottom: 8px;
}
.q-sub + .q-sub { margin-top: 18px; }

/* ---------- Champs ---------- */
.input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s ease;
}
.input:focus {
  outline: 3px solid var(--pale);
  outline-offset: 0;
  border-color: var(--emerald);
}
textarea.input {
  resize: vertical;
  min-height: 140px;
  line-height: 1.55;
}
textarea.input.short { min-height: 92px; }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23105B49' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.input-group {
  display: flex;
  align-items: stretch;
  max-width: 360px;
}
.input-group .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-variant-numeric: tabular-nums;
}
.input-unit {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--silver);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--pale);
  font-size: 15px;
  color: var(--night);
  white-space: nowrap;
}

/* ---------- Options radio / cases ---------- */
.q-options { display: grid; gap: 10px; }
.q-options-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.45;
  transition: border-color .15s ease, background-color .15s ease;
}
.option:hover { border-color: var(--emerald); }
.option:has(input:checked) {
  border-color: var(--emerald);
  background: var(--pale);
}
.option:has(input:focus-visible) {
  outline: 3px solid var(--pale);
  outline-offset: 0;
  border-color: var(--emerald);
}

.option input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--silver);
  background: var(--white);
  cursor: pointer;
}
.option input:focus { outline: none; }
.option input[type="radio"] { border-radius: 50%; }
.option input[type="radio"]:checked {
  border-color: var(--emerald);
  background: radial-gradient(circle, var(--emerald) 0 4.5px, var(--white) 5px);
}
.option input[type="checkbox"] { border-radius: 4px; }
.option input[type="checkbox"]:checked {
  border-color: var(--emerald);
  background: var(--emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23F4F6F4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.q-other { margin-top: 10px; }

/* ---------- Commentaire optionnel ---------- */
.q-comment-toggle {
  margin-top: 16px;
  padding: 4px 0;
  background: none;
  border: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  color: var(--emerald);
  cursor: pointer;
}
.q-comment-toggle:hover { text-decoration: underline; }
.q-comment { margin-top: 16px; }

/* ---------- Identité ---------- */
.q-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
.q-identity .q-sub:last-child { grid-column: 1 / -1; }
.q-identity .q-sub + .q-sub { margin-top: 0; }

/* ---------- Erreurs ---------- */
.q-error {
  margin: 10px 0 0;
  font-size: 14.5px;
  color: #A23B2A;
}
.q-error:empty { display: none; }
.has-error .input,
.has-error .option { border-color: #A23B2A; }

/* ---------- Navigation ---------- */
.q-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--silver);
}
.q-nav .btn:only-child { margin-left: auto; }
.btn-ghost {
  background: transparent;
  border-color: var(--silver);
  color: var(--emerald);
}
.btn-ghost:hover {
  background: var(--pale);
  border-color: var(--emerald);
  color: var(--emerald);
}
.btn[disabled] { opacity: .6; cursor: wait; }
button.btn { cursor: pointer; }
.q-send-error { margin-top: 16px; text-align: right; }

/* ---------- Intro / fin ---------- */
.q-intro-list {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  border: 1px solid var(--silver);
  border-radius: var(--radius-lg);
  background: var(--white);
}
.q-intro-list li {
  padding: 18px 22px;
  display: flex;
  gap: 14px;
}
.q-intro-list li + li { border-top: 1px solid var(--silver); }
.q-intro-list strong {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--night);
}
.q-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--emerald);
}
.q-done-card {
  background: var(--pale);
  border: 1px solid var(--silver);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 36px;
}
.q-test-banner {
  margin-top: 28px;
  padding: 14px 18px;
  border: 1px dashed var(--emerald);
  border-radius: var(--radius);
  font-size: 14px;
}

/* « Je ne souhaite pas répondre » */
.q-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14.5px;
  cursor: pointer;
}
.q-skip input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--silver);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
}
.q-skip input:checked {
  border-color: var(--emerald);
  background: var(--emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23F4F6F4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.q-skip input:focus-visible { outline: 3px solid var(--pale); outline-offset: 1px; }
.is-skipped textarea.input {
  background: var(--paper);
  opacity: .55;
  cursor: not-allowed;
}

/* Consentement */
.q-consent { margin-top: 40px; }
.q-consent-box { font-size: 15px; line-height: 1.55; }
.q-consent-box a { color: var(--emerald); white-space: nowrap; }

/* Piège à robots (invisible) */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Centrage (comme la vitrine) ---------- */
.q-part,
.q-title,
.q-label,
.q-hint,
.q-error,
.q-send-error { text-align: center; }
.q-intro-text { text-align: center; }
.q-sublabel { text-align: center; }
.q-container > div > p:not(.q-part):not(.q-test-banner) { text-align: center; }
.q-field > legend.q-label { width: 100%; }
.input-group { margin-left: auto; margin-right: auto; }
.q-options-inline { margin-left: auto; margin-right: auto; }
.q-comment-toggle { display: block; margin-left: auto; margin-right: auto; }
.q-done-card { text-align: center; }
.q-done .btn,
.q-intro-start { display: table; margin-left: auto; margin-right: auto; }

/* ---------- Pied de page ---------- */
.q-footer {
  border-top: 1px solid var(--silver);
  padding: 24px 0 32px;
  font-size: 13.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .q-header { padding: 14px 0 16px; }
  .q-header-inner { margin-bottom: 12px; }
  .q-brand { font-size: 14px; }
  .q-brand-long { display: none; }
  .q-container { padding-top: 40px; padding-bottom: 56px; }
  .q-part { margin-bottom: 20px; }
  .q-field + .q-field { margin-top: 36px; }
  .input-group { max-width: none; }
  .q-identity { grid-template-columns: 1fr; }
  .q-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    margin-top: 40px;
  }
  .q-nav .btn { width: 100%; }
}
