/* ==========================================================================
   QEngine — Typeform-style Questionnaire Engine
   Version: 2.0.1
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --q-primary: #008074;
  --q-primary-dark: #1a6670;
  --q-primary-light: #e6f5f3;
  --q-violet: #7d4490;
  --q-bg: #fbfbf7;
  --q-surface: #ffffff;
  --q-text: #13343b;
  --q-text-secondary: #626c71;
  --q-border: rgba(94, 82, 64, 0.15);
  --q-error: #e53e3e;
  --q-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --q-radius: 8px;
  --q-transition-duration: 300ms;
  --q-transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* ---------- Host Container ---------- */
.q-engine {
  font-family: var(--q-font);
  background-color: var(--q-bg);
  color: var(--q-text);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Progress Bar ---------- */
.q-progress-track {
  width: 100%;
  height: 3px;
  background: var(--q-border);
  overflow: hidden;
}

.q-progress-fill {
  height: 100%;
  background: var(--q-primary);
  width: 0%;
  transition: width 0.5s var(--q-transition-ease);
  border-radius: 0 2px 2px 0;
}

/* ---------- Viewport Slide Container ---------- */
.q-viewport {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ---------- Slide (one question) ---------- */
.q-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 60px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--q-transition-duration) var(--q-transition-ease),
              transform var(--q-transition-duration) var(--q-transition-ease);
  pointer-events: none;
  will-change: transform, opacity;
}

.q-slide--active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

/* Forward exit: slide up + fade out */
.q-slide--exit-up {
  opacity: 0;
  transform: translateY(-40px);
  pointer-events: none;
}

/* Backward exit: slide down + fade out */
.q-slide--exit-down {
  opacity: 0;
  transform: translateY(40px);
  pointer-events: none;
}

/* Forward enter: start below */
.q-slide--enter-up {
  opacity: 0;
  transform: translateY(40px);
}

/* Backward enter: start above */
.q-slide--enter-down {
  opacity: 0;
  transform: translateY(-40px);
}

/* ---------- Slide Inner ---------- */
.q-slide__inner {
  max-width: 640px;
  width: 100%;
}

/* ---------- Question Header (back + number) ---------- */
.q-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.q-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--q-text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.q-header-back:hover {
  background: var(--q-primary-light);
  color: var(--q-primary-dark);
}

.q-header-back:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 2px;
}

.q-header-spacer {
  width: 36px;
  flex-shrink: 0;
}

.q-header-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--q-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.q-question-number {
  font-size: 14px;
  font-weight: 500;
  color: var(--q-text-secondary);
  flex-shrink: 0;
}

/* ---------- Question Text ---------- */
.q-question-text {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--q-text);
  margin-bottom: 8px;
}

.q-question-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--q-text-secondary);
  margin-bottom: 24px;
}

.q-question-required {
  color: var(--q-error);
  margin-left: 4px;
  font-weight: 400;
}

/* ---------- Statement Type ---------- */
.q-statement-text {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--q-text);
  margin-bottom: 32px;
}

.q-statement-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--q-primary);
  color: #fff;
  border: none;
  border-radius: var(--q-radius);
  font-family: var(--q-font);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.q-statement-continue:hover {
  background: var(--q-primary-dark);
}

.q-statement-continue:active {
  transform: scale(0.98);
}

.q-statement-continue:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 3px;
}

/* ---------- Text Inputs ---------- */
.q-input-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.q-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--q-border);
  background: transparent;
  font-family: var(--q-font);
  font-size: 20px;
  color: var(--q-text);
  padding: 12px 0;
  outline: none;
  transition: border-color 0.2s ease;
  caret-color: var(--q-primary);
}

.q-input::placeholder {
  color: var(--q-text-secondary);
  opacity: 0.5;
}

.q-input:focus {
  border-bottom-color: var(--q-primary);
}

.q-input--error {
  border-bottom-color: var(--q-error);
}

/* Long text */
.q-textarea {
  width: 100%;
  border: 2px solid var(--q-border);
  border-radius: var(--q-radius);
  background: var(--q-surface);
  font-family: var(--q-font);
  font-size: 18px;
  color: var(--q-text);
  padding: 16px;
  outline: none;
  resize: vertical;
  min-height: 120px;
  max-height: 300px;
  transition: border-color 0.2s ease;
  caret-color: var(--q-primary);
  line-height: 1.5;
}

.q-textarea::placeholder {
  color: var(--q-text-secondary);
  opacity: 0.5;
}

.q-textarea:focus {
  border-color: var(--q-primary);
}

.q-textarea--error {
  border-color: var(--q-error);
}

/* Phone input prefix */
.q-phone-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--q-border);
  transition: border-color 0.2s ease;
}

.q-phone-wrapper:focus-within {
  border-bottom-color: var(--q-primary);
}

.q-phone-wrapper--error {
  border-bottom-color: var(--q-error);
}

.q-phone-prefix {
  font-family: var(--q-font);
  font-size: 20px;
  color: var(--q-text-secondary);
  padding: 12px 8px 12px 0;
  user-select: none;
  flex-shrink: 0;
}

.q-phone-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--q-font);
  font-size: 20px;
  color: var(--q-text);
  padding: 12px 0;
  outline: none;
  caret-color: var(--q-primary);
}

.q-phone-input::placeholder {
  color: var(--q-text-secondary);
  opacity: 0.5;
}

/* Number input */
.q-number-input {
  width: 160px;
  text-align: center;
  border: none;
  border-bottom: 2px solid var(--q-border);
  background: transparent;
  font-family: var(--q-font);
  font-size: 28px;
  font-weight: 500;
  color: var(--q-text);
  padding: 12px 0;
  outline: none;
  transition: border-color 0.2s ease;
  caret-color: var(--q-primary);
  -moz-appearance: textfield;
}

.q-number-input::-webkit-outer-spin-button,
.q-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.q-number-input:focus {
  border-bottom-color: var(--q-primary);
}

.q-number-input--error {
  border-bottom-color: var(--q-error);
}

/* ---------- Multiple Choice ---------- */
.q-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.q-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--q-border);
  border-radius: var(--q-radius);
  background: var(--q-surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  position: relative;
}

.q-choice:hover {
  border-color: var(--q-primary);
  background: var(--q-primary-light);
}

.q-choice--selected {
  border-color: var(--q-primary);
  background: var(--q-primary-light);
  box-shadow: 0 0 0 1px var(--q-primary);
}

.q-choice--focused {
  border-color: var(--q-primary);
  box-shadow: 0 0 0 2px var(--q-primary);
}

.q-choice__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--q-border);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--q-text-secondary);
  background: var(--q-bg);
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.q-choice--selected .q-choice__letter {
  background: var(--q-primary);
  color: #fff;
  border-color: var(--q-primary);
}

.q-choice__label {
  font-size: 16px;
  line-height: 1.4;
  color: var(--q-text);
  flex: 1;
}

.q-choice__check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--q-border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.q-choice--selected .q-choice__check {
  background: var(--q-primary);
  border-color: var(--q-primary);
}

.q-choice--selected .q-choice__check::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Other Text Field (hasTextField on options) ---------- */
.q-other-textfield {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--q-border);
  background: transparent;
  font-family: var(--q-font);
  font-size: 16px;
  color: var(--q-text);
  padding: 10px 18px;
  margin-top: 4px;
  outline: none;
  transition: border-color 0.2s ease;
  caret-color: var(--q-primary);
}

.q-other-textfield::placeholder {
  color: var(--q-text-secondary);
  opacity: 0.5;
}

.q-other-textfield:focus {
  border-bottom-color: var(--q-primary);
}

/* ---------- Free Text below MC (withFreeText) ---------- */
.q-freetext {
  width: 100%;
  border: 2px solid var(--q-border);
  border-radius: var(--q-radius);
  background: var(--q-surface);
  font-family: var(--q-font);
  font-size: 16px;
  color: var(--q-text);
  padding: 12px 16px;
  margin-top: 12px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  transition: border-color 0.2s ease;
  caret-color: var(--q-primary);
  line-height: 1.5;
}

.q-freetext::placeholder {
  color: var(--q-text-secondary);
  opacity: 0.5;
}

.q-freetext:focus {
  border-color: var(--q-primary);
}

/* ---------- Inline Progress (left of OK button) ---------- */
.q-progress-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.q-progress-inline .q-progress-track {
  width: 120px;
}

.q-progress-counter {
  font-size: 13px;
  font-weight: 500;
  color: var(--q-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Opinion Scale ---------- */
.q-scale-wrapper {
  margin-bottom: 8px;
}

.q-scale {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.q-scale__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--q-border);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  color: var(--q-text);
  background: var(--q-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.q-scale__item:hover {
  border-color: var(--q-primary);
  background: var(--q-primary-light);
  color: var(--q-primary-dark);
}

.q-scale__item--selected {
  background: var(--q-primary);
  border-color: var(--q-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 128, 116, 0.3);
}

.q-scale__item--focused {
  box-shadow: 0 0 0 3px rgba(0, 128, 116, 0.3);
}

.q-scale-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.q-scale-labels__text {
  font-size: 13px;
  color: var(--q-text-secondary);
}

/* ---------- Rating ---------- */
.q-rating-wrapper {
  margin-bottom: 8px;
}

.q-rating {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.q-rating__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--q-border);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  color: var(--q-text);
  background: var(--q-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.q-rating__item:hover {
  border-color: var(--q-primary);
  background: var(--q-primary-light);
  color: var(--q-primary-dark);
}

.q-rating__item--selected {
  background: var(--q-primary);
  border-color: var(--q-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 128, 116, 0.3);
}

.q-rating__item--focused {
  box-shadow: 0 0 0 3px rgba(0, 128, 116, 0.3);
}

/* ---------- OK / Submit Button Row ---------- */
.q-action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.q-action-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.q-ok-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--q-primary);
  color: #fff;
  border: none;
  border-radius: var(--q-radius);
  font-family: var(--q-font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.q-ok-btn:hover {
  background: var(--q-primary-dark);
}

.q-ok-btn:active {
  transform: scale(0.97);
}

.q-ok-btn:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 3px;
}

.q-ok-btn--submit {
  padding: 12px 32px;
  font-size: 16px;
  background: var(--q-violet);
}

.q-ok-btn--submit:hover {
  background: #6b3a7d;
}

/* Bouton OK désactivé (ex. téléphone incomplet) */
.q-ok-btn:disabled,
.q-ok-btn--disabled,
.q-ok-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Bouton OK en état "saisie invalide" (phone) — vert translucide, reste cliquable
   pour déclencher le message d'erreur explicatif au click. Surcharge --submit. */
.q-ok-btn.q-ok-btn--invalid,
.q-ok-btn.q-ok-btn--invalid.q-ok-btn--submit {
  background: rgba(0, 128, 116, 0.45);
  color: #fff;
  cursor: pointer;
}

.q-ok-btn.q-ok-btn--invalid:hover,
.q-ok-btn.q-ok-btn--invalid.q-ok-btn--submit:hover {
  background: rgba(0, 128, 116, 0.65);
}

/* Marqueur "invalide" dans le wrapper phone, à droite du numéro sur la même ligne —
   cercle rouge 100% opaque avec une croix découpée à l'intérieur (SVG mask) qui
   laisse voir le fond de la page à travers la croix. */
.q-phone-invalid-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
}

.q-phone-invalid-mark svg {
  width: 24px;
  height: 24px;
  display: block;
}

.q-enter-hint {
  font-size: 13px;
  color: var(--q-text-secondary);
  opacity: 0.7;
  flex-shrink: 0;
  margin-top: 8px;
}

/* ---------- Validation Error ---------- */
.q-error-msg {
  font-size: 13px;
  color: var(--q-error);
  margin-top: 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.q-error-msg--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Shake Animation ---------- */
@keyframes q-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.q-shake {
  animation: q-shake 0.5s ease-in-out;
}

/* ---------- Intro Screen ---------- */
.q-intro {
  text-align: center;
}

.q-intro__label {
  display: inline-block;
  background: #e0e0e0;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

.q-intro__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--q-text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.q-intro__subtitle {
  font-size: 18px;
  color: var(--q-text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.q-intro__statement {
  font-size: 16px;
  color: var(--q-text);
  line-height: 1.7;
  margin-bottom: 24px;
  text-align: left;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.q-intro__statement p {
  margin-bottom: 14px;
}

.q-intro__statement p:last-child {
  margin-bottom: 0;
}

.q-intro__time {
  font-size: 14px;
  color: var(--q-text-secondary);
  margin-bottom: 24px;
}

.q-intro__start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--q-primary);
  color: #fff;
  border: none;
  border-radius: var(--q-radius);
  font-family: var(--q-font);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.q-intro__start:hover {
  background: var(--q-primary-dark);
}

.q-intro__start:active {
  transform: scale(0.97);
}

.q-intro__start:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 3px;
}

/* ---------- Completion Screen ---------- */
.q-completion {
  text-align: center;
  padding: 40px 20px;
}

.q-completion__icon {
  width: 72px;
  height: 72px;
  background: var(--q-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}

.q-completion__message {
  font-size: 26px;
  font-weight: 600;
  color: var(--q-text);
  margin-bottom: 16px;
  line-height: 1.4;
}

.q-completion__sub {
  font-size: 16px;
  color: var(--q-text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ---------- Conditional CTA Block ---------- */
.q-completion__cta {
  margin-top: 28px;
  padding: 24px 20px;
  background: var(--q-primary-light);
  border-radius: 12px;
  text-align: center;
}

.q-completion__cta p {
  font-size: 16px;
  color: var(--q-text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.q-completion__cta p:last-child {
  margin-bottom: 0;
}

.q-completion__cta .cta-btn {
  display: inline-block;
  padding: 14px 28px;
  background: #25D366;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.q-completion__cta .cta-btn:hover {
  background: #1da851;
}

.q-completion__cta .cta-btn--subtle {
  background: transparent;
  color: var(--q-primary);
  border: 1px solid var(--q-primary);
  font-weight: 500;
}

.q-completion__cta .cta-btn--subtle:hover {
  background: var(--q-primary-light);
}

/* ---------- Score Display ---------- */
.q-score {
  margin: 24px auto 32px;
  max-width: 400px;
}

.q-score__value-wrapper {
  margin-bottom: 20px;
}

.q-score__value {
  font-size: 64px;
  font-weight: 700;
  color: var(--q-primary);
  line-height: 1;
}

.q-score__max {
  font-size: 24px;
  font-weight: 400;
  color: var(--q-text-secondary);
}

.q-score__range-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--q-violet);
  margin-bottom: 12px;
}

.q-score__message {
  font-size: 16px;
  color: var(--q-text);
  line-height: 1.6;
}

/* ---------- Loading Spinner ---------- */
.q-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
}

.q-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--q-border);
  border-top-color: var(--q-primary);
  border-radius: 50%;
  animation: q-spin 0.8s linear infinite;
}

@keyframes q-spin {
  to { transform: rotate(360deg); }
}

.q-loading__text {
  font-size: 15px;
  color: var(--q-text-secondary);
}

/* ---------- Retry ---------- */
.q-retry {
  text-align: center;
  padding: 40px 20px;
}

.q-retry__message {
  font-size: 18px;
  color: var(--q-error);
  margin-bottom: 20px;
}

.q-retry__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--q-primary);
  color: #fff;
  border: none;
  border-radius: var(--q-radius);
  font-family: var(--q-font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.q-retry__btn:hover {
  background: var(--q-primary-dark);
}

/* ---------- Resume Banner ---------- */
.q-resume-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  width: calc(100% - 48px);
  animation: q-slide-in-up 0.4s var(--q-transition-ease);
}

@keyframes q-slide-in-up {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.q-resume-banner__text {
  font-size: 14px;
  color: var(--q-text);
  flex: 1;
  line-height: 1.4;
}

.q-resume-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.q-resume-banner__btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--q-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease;
}

.q-resume-banner__btn--resume {
  background: var(--q-primary);
  color: #fff;
}

.q-resume-banner__btn--resume:hover {
  background: var(--q-primary-dark);
}

.q-resume-banner__btn--restart {
  background: transparent;
  color: var(--q-text-secondary);
  border: 1px solid var(--q-border);
}

.q-resume-banner__btn--restart:hover {
  background: var(--q-bg);
}

/* ---------- Redirect Notice ---------- */
.q-redirect-notice {
  font-size: 14px;
  color: var(--q-text-secondary);
  margin-top: 16px;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 768px) {
  .q-slide {
    padding: 40px 20px 40px;
    align-items: flex-start;
    padding-top: 60px;
  }

  .q-question-text {
    font-size: 20px;
  }

  .q-question-description {
    font-size: 14px;
  }

  .q-statement-text {
    font-size: 18px;
  }

  .q-input {
    font-size: 18px;
  }

  .q-textarea {
    font-size: 16px;
  }

  .q-phone-prefix {
    font-size: 18px;
  }

  .q-phone-input {
    font-size: 18px;
  }

  .q-number-input {
    font-size: 24px;
    width: 120px;
  }

  .q-scale__item {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .q-scale {
    gap: 6px;
  }

  .q-rating__item {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .q-rating {
    gap: 6px;
  }

  .q-choice {
    padding: 12px 14px;
  }

  .q-choice__label {
    font-size: 15px;
  }

  .q-enter-hint {
    display: none;
  }

  .q-intro__title {
    font-size: 26px;
  }

  .q-intro__subtitle {
    font-size: 16px;
  }

  .q-intro__statement {
    font-size: 15px;
  }

  .q-completion__message {
    font-size: 22px;
  }

  .q-score__value {
    font-size: 52px;
  }

  .q-header-back {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .q-header-spacer {
    width: 32px;
  }

  .q-resume-banner {
    bottom: 16px;
    flex-direction: column;
    text-align: center;
    padding: 14px 18px;
  }

  .q-resume-banner__actions {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .q-scale__item {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .q-scale {
    gap: 4px;
  }

  .q-rating__item {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .q-rating {
    gap: 4px;
  }
}

/* ---------- Focus-visible utility ---------- */
.q-input:focus-visible,
.q-textarea:focus-visible,
.q-phone-input:focus-visible,
.q-number-input:focus-visible {
  outline: none;
}

/* ---------- Scrollbar styling (subtle) ---------- */
.q-textarea::-webkit-scrollbar {
  width: 6px;
}

.q-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.q-textarea::-webkit-scrollbar-thumb {
  background: var(--q-border);
  border-radius: 3px;
}

.q-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--q-text-secondary);
}

/* ==========================================================================
   V2 FEATURES — Profile Name, Radar Chart, Axes, Action Buttons, Toast
   ========================================================================== */

/* ---------- Profile Name Display ---------- */
.q-profile-name {
  margin: 24px auto 32px;
  max-width: 500px;
  text-align: center;
}

.q-profile-name__line {
  font-size: 22px;
  line-height: 1.4;
  color: var(--q-text);
  margin-bottom: 12px;
}

.q-profile-name__prefix {
  font-weight: 400;
}

.q-profile-name__value {
  font-weight: 700;
  color: var(--q-violet);
  font-size: 26px;
}

.q-profile-name__score {
  font-size: 48px;
  font-weight: 700;
  color: var(--q-primary);
  margin: 16px 0 8px;
  line-height: 1;
}

.q-profile-name__congrats {
  font-size: 16px;
  color: var(--q-primary);
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.6;
}

.q-profile-name__message {
  font-size: 16px;
  color: var(--q-text);
  line-height: 1.6;
  margin-top: 16px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Radar Chart ---------- */
.q-radar-section {
  margin: 32px auto;
  max-width: 560px;
  text-align: center;
}

.q-radar__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--q-text);
  margin-bottom: 20px;
}

.q-radar__wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.q-radar__canvas {
  max-width: 100%;
  height: auto;
}

/* ---------- Improvement Axes ---------- */
.q-axes-section {
  margin: 36px auto;
  max-width: 560px;
}

.q-axes__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--q-text);
  margin-bottom: 20px;
  text-align: center;
}

.q-axes__cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.q-axes__card {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-left: 4px solid var(--q-violet);
  border-radius: 8px;
  padding: 20px 24px;
  text-align: left;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.q-axes__card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.q-axes__card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--q-text);
  margin-bottom: 8px;
}

.q-axes__card-message {
  font-size: 15px;
  color: var(--q-text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.q-axes__card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--q-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.q-axes__card-link:hover {
  color: var(--q-primary-dark);
  text-decoration: underline;
}

.q-axes__card-link::before {
  content: '\2192';
  margin-right: 2px;
}

/* ---------- Action Buttons ---------- */
.q-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 32px auto;
  max-width: 560px;
}

.q-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--q-radius);
  font-family: var(--q-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  border: 1px solid var(--q-border);
  background: var(--q-surface);
  color: var(--q-text);
  white-space: nowrap;
}

.q-action-btn:hover {
  background: var(--q-primary-light);
  border-color: var(--q-primary);
  color: var(--q-primary-dark);
  box-shadow: 0 2px 8px rgba(0, 128, 116, 0.15);
}

.q-action-btn:active {
  transform: scale(0.97);
}

.q-action-btn:focus-visible {
  outline: 2px solid var(--q-primary);
  outline-offset: 2px;
}

.q-action-btn svg {
  flex-shrink: 0;
}

.q-action-btn--pdf:hover {
  border-color: var(--q-violet);
  color: var(--q-violet);
}

.q-action-btn--email {
  background: var(--q-primary);
  color: #fff;
  border-color: var(--q-primary);
}

.q-action-btn--email:hover {
  background: var(--q-primary-dark);
  color: #fff;
  border-color: var(--q-primary-dark);
}

/* ---------- Month/Year Dropdowns ---------- */
.q-month-year-block {
  margin-top: 28px;
}

.q-month-year-check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--q-font);
  font-size: 14px;
  color: var(--q-text);
  cursor: pointer;
  line-height: 1.4;
}

.q-month-year-checkbox {
  margin-top: 3px;
  accent-color: var(--q-primary);
  min-width: 16px;
  min-height: 16px;
  cursor: pointer;
}

.q-month-year-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.q-month-year-label {
  font-family: var(--q-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--q-text);
  white-space: nowrap;
}

.q-month-year-selects {
  display: flex;
  gap: 10px;
}

.q-month-select,
.q-year-select {
  font-family: var(--q-font);
  font-size: 16px;
  padding: 10px 16px;
  border: 2px solid var(--q-border);
  border-radius: 8px;
  background: #fff;
  color: var(--q-text);
  cursor: pointer;
  appearance: auto;
  min-width: 120px;
  transition: border-color 0.2s ease;
}

.q-month-select:focus,
.q-year-select:focus {
  border-color: var(--q-primary);
  outline: none;
}

/* ---------- Toast Notification ---------- */
.q-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--q-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--q-font);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.q-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- V2 Mobile Responsive ---------- */
@media (max-width: 768px) {
  .q-profile-name__line {
    font-size: 18px;
  }

  .q-profile-name__value {
    font-size: 22px;
  }

  .q-profile-name__score {
    font-size: 40px;
  }

  .q-radar-section {
    margin: 24px auto;
  }

  .q-radar__title {
    font-size: 18px;
  }

  .q-radar__canvas {
    max-width: 320px;
  }

  .q-axes-section {
    margin: 24px auto;
  }

  .q-axes__title {
    font-size: 18px;
  }

  .q-axes__card {
    padding: 16px 18px;
  }

  .q-axes__card-title {
    font-size: 15px;
  }

  .q-axes__card-message {
    font-size: 14px;
  }

  .q-action-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 8px;
  }

  .q-action-btn {
    justify-content: center;
    font-size: 14px;
    padding: 12px 16px;
  }
}

@media (max-width: 380px) {
  .q-profile-name__line {
    font-size: 16px;
  }

  .q-profile-name__value {
    font-size: 20px;
  }

  .q-radar__canvas {
    max-width: 280px;
  }
}

/* ---------- Print ---------- */
@media print {
  .q-progress-inline,
  .q-question-header,
  .q-enter-hint,
  .q-resume-banner,
  .q-action-buttons,
  .q-toast {
    display: none !important;
  }

  .q-slide {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    min-height: auto;
    page-break-inside: avoid;
    padding: 20px 0;
  }

  .q-completion {
    padding: 20px 0;
  }

  .q-radar-section {
    page-break-inside: avoid;
  }

  .q-radar__canvas {
    max-width: 480px;
  }

  .q-axes-section {
    page-break-inside: avoid;
  }

  .q-axes__card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .q-profile-name {
    margin: 16px auto 24px;
  }
}

/* ==========================================================================
   Mode Lecture Nocturne — questionnaires v1.0
   ========================================================================== */

/* ---- Bouton mode sombre ---- */
#q-night-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 14px auto 0;
  padding: 7px 18px;
  background: #1a0e04;
  border: 1.5px solid #d4782a;
  border-radius: 22px;
  color: #f0a050;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--q-font);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 10px rgba(212, 120, 42, 0.28);
}

#q-night-mode-btn:hover {
  border-color: #f0a050;
  box-shadow: 0 0 16px rgba(240, 160, 80, 0.45);
}

#q-night-mode-btn.q-night-btn--active {
  background: #1f1206;
  border-color: #f0a050;
  color: #ffd090;
  box-shadow: 0 0 20px rgba(240, 160, 80, 0.5);
}

/* ---- Variables sombres ---- */
body.mode-nocturne {
  --q-bg: #151515;
  --q-surface: #1c2826;
  --q-text: #d0ccc4;
  --q-text-secondary: #8aaeaa;
  --q-border: rgba(80, 120, 115, 0.3);
  --q-primary-light: #1a2e2c;
}

/* Label badge (couleur hardcodée) */
body.mode-nocturne .q-intro__label {
  background: #2a3e3c;
  color: #8aaeaa;
}

/* Selects date (background hardcodé) */
body.mode-nocturne .q-month-select,
body.mode-nocturne .q-year-select {
  background: #1c2826;
  color: var(--q-text);
  color-scheme: dark;
}
