/* ════════════════════════════════════════════════════════════
   assets/quiz.css — design system partagé des quiz Eneko
   (positionnement-ia-generative + positionnement-ia-automatisation)
   Toute retouche visuelle des quiz se fait ICI, une seule fois.
   ════════════════════════════════════════════════════════════ */

    /* ── VARIABLES ── */
    :root {
      --paper:      #FAFAF8;
      --ink:        #1A1A1A;
      --ink-mid:    #555;
      --ink-soft:   #767676; /* min 4.5:1 WCAG AA sur fond clair */
      --line:       #E8E6E1;
      --accent:     #8037EE;
      --pink:       #C45AE4;
      --accent-bg:  rgba(128,55,238,0.08);
      --r-lg: 16px;
      --r-md: 12px;
      --r-sm: 8px;
    }

    /* ── RESET ── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: 'Outfit', sans-serif;
      background: var(--paper);
      color: var(--ink);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
    }

    h1, h2, h3, h4, h5, h6 { font-family: 'Fraunces', serif; }

    /* ── APP ── */
    #app {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* ── HEADER ── */
    .header {
      padding: 18px 24px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 10;
      background: rgba(250,250,248,0.92);
      backdrop-filter: blur(8px);
      border-bottom: 1px solid var(--line);
    }
    .header--quiz {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      padding-bottom: 14px;
    }
    .header-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .logo { display: flex; align-items: center; }
    .logo img { height: 32px; width: auto; display: block; }

    .header-meta {
      font-size: 13px;
      color: var(--ink-soft);
      font-family: 'Outfit', sans-serif;
    }

    /* ── PROGRESS ── */
    .progress-wrap {
      padding: 12px 24px 0;
    }
    .progress-row {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--ink-soft);
      margin-bottom: 7px;
    }
    .progress-bar {
      height: 5px;
      background: var(--line);
      border-radius: 99px;
      overflow: hidden;
    }
    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent), var(--pink));
      border-radius: 99px;
      transition: width 0.35s ease;
    }

    /* ── SCREEN ── */
    .screen {
      flex: 1;
      padding: 28px 24px 48px;
      max-width: 620px;
      width: 100%;
      margin: 0 auto;
      animation: fadeUp 0.28s ease both;
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── CARD ── */
    .card {
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-lg);
      padding: 28px;
    }

    /* ── WELCOME ── */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      background: var(--accent-bg);
      border: 1px solid rgba(128,55,238,0.25);
      border-radius: 99px;
      padding: 5px 14px;
      font-size: 12px;
      color: var(--accent);
      font-weight: 500;
      margin-bottom: 22px;
    }

    .welcome-title {
      font-size: clamp(30px, 8vw, 42px);
      font-weight: 300;
      line-height: 1.18;
      margin-bottom: 16px;
    }
    .welcome-title .accent {
      background: linear-gradient(130deg, var(--accent), var(--pink));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      font-style: italic;
    }

    .welcome-desc {
      font-size: 15px;
      color: var(--ink-mid);
      line-height: 1.65;
      margin-bottom: 32px;
    }

    .stats-row {
      display: grid;
      grid-template-columns: repeat(3,1fr);
      gap: 12px;
      margin-bottom: 40px;
    }
    .stat {
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-md);
      padding: 16px 8px;
      text-align: center;
    }
    .stat-n {
      font-family: 'Outfit', sans-serif;
      font-size: 30px;
      font-weight: 700;
      color: var(--accent);
      line-height: 1;
    }
    .stat-l {
      font-size: 12px;
      color: var(--ink-soft);
      margin-top: 5px;
    }

    /* ── BUTTONS ── */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 13px 26px;
      border-radius: var(--r-md);
      font-family: 'Outfit', sans-serif;
      font-weight: 600;
      font-size: 14px;
      cursor: pointer;
      border: none;
      transition: background 0.18s ease, transform 0.15s ease, opacity 0.15s;
      white-space: nowrap;
    }
    .btn:active { transform: scale(0.97); }

    .btn-primary {
      background: var(--accent);
      color: #fff;
    }
    .btn-primary:hover:not(:disabled) { background: #6d28d9; }
    .btn-primary:disabled { background: rgba(128,55,238,0.3); cursor: not-allowed; }

    .btn-ghost {
      background: #fff;
      color: var(--ink-mid);
      border: 1.5px solid var(--line);
    }
    .btn-ghost:hover:not(:disabled) {
      background: var(--paper);
      border-color: #ccc;
    }
    .btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

    .btn-outline-purple {
      background: transparent;
      color: var(--accent);
      border: 1.5px solid var(--accent);
    }
    .btn-outline-purple:hover { background: var(--accent-bg); }

    .btn-full { width: 100%; }

    /* ── FORM ── */
    .section-tag {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--accent);
      font-weight: 600;
      margin-bottom: 10px;
    }
    .screen-title {
      font-size: 22px;
      font-weight: 600;
      margin-bottom: 6px;
    }
    .screen-sub {
      font-size: 14px;
      color: var(--ink-mid);
      line-height: 1.6;
      margin-bottom: 24px;
    }
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }
    @media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

    .form-group { margin-bottom: 18px; }
    .form-label {
      display: block;
      font-size: 13px;
      font-weight: 500;
      color: var(--ink);
      margin-bottom: 7px;
    }
    .form-label .req { color: var(--pink); margin-left: 3px; }
    .form-label .opt { font-size: 11px; color: var(--ink-soft); margin-left: 5px; }

    .form-input {
      width: 100%;
      padding: 13px 15px;
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-sm);
      color: var(--ink);
      font-family: 'Outfit', sans-serif;
      font-size: 14px;
      outline: none;
      transition: border-color 0.2s, background 0.2s;
    }
    .form-input::placeholder { color: var(--ink-soft); }
    .form-input:focus {
      border-color: var(--accent);
      background: var(--accent-bg);
    }
    .form-input.err { border-color: #e05252; }
    .form-err { font-size: 12px; color: #c0392b; margin-top: 5px; display: none; }
    .form-err.show { display: block; }

    /* ── NAV BUTTONS ── */
    .nav-row {
      display: flex;
      gap: 10px;
      margin-top: 24px;
    }
    .nav-row .btn-ghost { min-width: 110px; }
    .nav-row .btn-primary { flex: 1; }

    /* ── OBJECTIVES ── */
    .obj-counter {
      font-size: 13px;
      color: var(--ink-soft);
      margin-bottom: 14px;
    }
    .obj-counter strong { color: var(--accent); }

    .obj-grid { display: flex; flex-direction: column; gap: 9px; margin-bottom: 24px; }

    .obj-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 13px 15px;
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-md);
      cursor: pointer;
      text-align: left;
      font-family: 'Outfit', sans-serif;
      font-size: 14px;
      color: var(--ink);
      line-height: 1.45;
      transition: border-color 0.2s, background 0.2s;
    }
    .obj-item:hover { border-color: var(--accent); background: var(--accent-bg); }
    .obj-item.selected { border-color: var(--accent); background: var(--accent-bg); }
    .obj-item.locked:not(.selected) { opacity: 0.38; cursor: not-allowed; }

    .obj-box {
      width: 20px; height: 20px; min-width: 20px;
      border-radius: 6px;
      border: 2px solid var(--line);
      display: flex; align-items: center; justify-content: center;
      margin-top: 1px;
      transition: all 0.18s;
    }
    .obj-item.selected .obj-box {
      background: var(--accent);
      border-color: var(--accent);
    }
    .obj-box svg { display: none; }
    .obj-item.selected .obj-box svg { display: block; }

    /* ── QUESTION ── */
    .q-theme {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--accent);
      font-weight: 600;
      margin-bottom: 10px;
    }
    .q-text {
      font-family: 'Fraunces', serif;
      font-size: clamp(17px, 4.5vw, 21px);
      font-weight: 300;
      line-height: 1.4;
      margin-bottom: 22px;
    }
    .q-hint {
      font-size: 12px;
      color: var(--ink-soft);
      margin-bottom: 14px;
    }

    .options { display: flex; flex-direction: column; gap: 9px; }

    .opt {
      display: flex;
      align-items: flex-start;
      gap: 13px;
      padding: 14px 15px;
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-md);
      cursor: pointer;
      text-align: left;
      font-family: 'Outfit', sans-serif;
      font-size: 14px;
      color: var(--ink);
      line-height: 1.5;
      transition: border-color 0.18s, background 0.18s;
      width: 100%;
    }
    .opt:hover { border-color: var(--accent); background: var(--accent-bg); }
    .opt.selected { border-color: var(--accent); background: var(--accent-bg); }

    .opt-marker {
      width: 26px; height: 26px; min-width: 26px;
      border-radius: 50%;
      border: 2px solid var(--line);
      display: flex; align-items: center; justify-content: center;
      font-size: 11px;
      font-weight: 700;
      font-family: 'Outfit', sans-serif;
      color: var(--ink-soft);
      transition: all 0.18s;
      margin-top: 1px;
    }
    .opt.selected .opt-marker {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }
    .opt.multi .opt-marker { border-radius: 7px; }

    /* ── IDK option ── */
    .idk-separator {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 6px 0 2px;
      color: var(--ink-soft);
      font-size: 11px;
    }
    .idk-separator::before, .idk-separator::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--line);
    }

    /* ── COUNTDOWN BUTTON ── */
    .btn-cd {
      background-image: linear-gradient(rgba(255,255,255,0.18), rgba(255,255,255,0.18));
      background-repeat: no-repeat;
      background-position: left center;
      background-size: 100% 100%;
    }
    .btn-cd.cd-urgent { background-color: #c0392b !important; }
    .cd-secs { font-variant-numeric: tabular-nums; opacity: 0.82; font-size: 13px; }
    .cd-secs.urgent { opacity: 1; color: #fde68a; }

    .opt.idk-opt { border-style: dashed; }
    .opt.idk-opt.selected { border-style: solid; }
    .opt.idk-opt .opt-marker {
      font-size: 13px;
      font-style: normal;
    }
    .opt.idk-opt span { font-style: italic; color: var(--ink-mid); }
    .opt.idk-opt.selected span { color: var(--ink); font-style: italic; }

    /* ── RESULTS ── */
    .result-hero { text-align: center; padding: 24px 0 20px; }
    .result-emoji { font-size: 54px; margin-bottom: 14px; line-height: 1; }
    .result-name {
      font-size: clamp(22px, 6vw, 30px);
      font-weight: 300;
      font-style: italic;
      margin-bottom: 16px;
    }

    .score-pill {
      display: inline-flex;
      align-items: baseline;
      gap: 5px;
      background: var(--accent-bg);
      border: 1px solid rgba(128,55,238,0.25);
      border-radius: 99px;
      padding: 10px 24px;
      margin-bottom: 28px;
    }
    .score-n {
      font-family: 'Outfit', sans-serif;
      font-size: 38px;
      font-weight: 700;
      color: var(--accent);
      line-height: 1;
    }
    .score-max { font-size: 17px; color: var(--ink-soft); }

    .profile-text {
      font-size: 14.5px;
      color: var(--ink-mid);
      line-height: 1.75;
    }
    .profile-text + .profile-text { margin-top: 14px; }

    /* ── GAUGE ── */
    .level-gauge { margin: 28px 0 24px; }

    .gauge-wrap {
      position: relative;
      height: 16px;
      margin-bottom: 14px;
    }
    .gauge-track {
      position: absolute;
      inset: 0;
      background: var(--line);
      border-radius: 99px;
      overflow: hidden;
    }
    .gauge-fill {
      height: 100%;
      width: 0;
      background: linear-gradient(90deg, var(--accent), var(--pink));
      border-radius: 99px;
      animation: gaugeIn 0.9s cubic-bezier(.4,0,.2,1) forwards;
    }
    @keyframes gaugeIn {
      from { width: 0; }
      to   { width: var(--gauge-w); }
    }
    .gauge-div {
      position: absolute;
      top: -3px; bottom: -3px;
      width: 3px;
      background: var(--paper);
      transform: translateX(-50%);
      border-radius: 99px;
      z-index: 1;
    }
    .gauge-dot {
      position: absolute;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 22px; height: 22px;
      background: #fff;
      border-radius: 50%;
      border: 3px solid var(--accent);
      box-shadow: 0 0 0 5px rgba(128,55,238,0.18);
      z-index: 2;
    }
    .gauge-levels {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 7px;
    }
    .gauge-level {
      text-align: center;
      padding: 10px 5px;
      border-radius: var(--r-md);
      border: 1.5px solid var(--line);
      background: #fff;
    }
    .gauge-level.active {
      background: var(--accent-bg);
      border-color: var(--accent);
    }
    .gauge-level-emoji { font-size: 18px; display: block; margin-bottom: 4px; }
    .gauge-level-name  { font-size: 10px; font-weight: 600; color: var(--ink-soft); display: block; line-height: 1.3; }
    .gauge-level.active .gauge-level-name { color: var(--accent); }
    .gauge-level-range { font-size: 10px; color: var(--ink-soft); display: block; margin-top: 2px; }
    .gauge-level.active .gauge-level-range { color: var(--ink-mid); }

    /* ── CORRECTIONS ── */
    .corrections-title {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 18px;
    }

    .corr-card {
      margin-bottom: 12px;
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-md);
      overflow: hidden;
    }

    .corr-head {
      padding: 14px 16px;
      cursor: pointer;
      display: flex;
      align-items: flex-start;
      gap: 12px;
      user-select: none;
    }

    .score-badge {
      min-width: 36px;
      height: 26px;
      border-radius: 7px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
      font-family: 'Outfit', sans-serif;
      flex-shrink: 0;
    }
    .sb-full    { background: rgba(39,174,96,0.12);  color: #16a34a; }
    .sb-partial { background: rgba(243,156,18,0.12); color: #d97706; }
    .sb-zero    { background: rgba(225,75,75,0.12);  color: #dc2626; }

    .corr-q {
      font-size: 13.5px;
      font-weight: 500;
      line-height: 1.45;
      flex: 1;
      color: var(--ink);
    }

    .chevron {
      margin-left: auto;
      flex-shrink: 0;
      color: var(--ink-soft);
      transition: transform 0.2s;
      margin-top: 2px;
    }
    .corr-card.open .chevron { transform: rotate(180deg); }

    .corr-body {
      padding: 0 16px 16px;
      display: none;
    }
    .corr-card.open .corr-body { display: block; }

    .corr-your {
      font-size: 13px;
      color: var(--ink-soft);
      margin-bottom: 8px;
    }
    .corr-your strong { color: var(--ink); }

    .corr-expl {
      font-size: 13px;
      line-height: 1.65;
      color: var(--ink-mid);
      background: var(--accent-bg);
      border-left: 3px solid var(--accent);
      padding: 11px 13px;
      border-radius: 0 8px 8px 0;
    }

    /* ── TOAST ── */
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: #fff;
      border: 1.5px solid var(--line);
      border-radius: var(--r-md);
      padding: 13px 18px;
      font-size: 13.5px;
      color: var(--ink);
      z-index: 100;
      opacity: 0;
      transform: translateY(6px);
      transition: opacity 0.25s, transform 0.25s;
      max-width: 280px;
      pointer-events: none;
      box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }
    .toast.show { opacity: 1; transform: translateY(0); }
    .toast.ok   { border-color: rgba(39,174,96,0.5); }
    .toast.fail { border-color: rgba(225,75,75,0.5); }
  
    /* ── CAPPED NOTE ── */
    .capped-note {
      margin-bottom: 22px;
      padding: 13px 15px;
      background: var(--accent-bg);
      border: 1px solid rgba(128,55,238,0.25);
      border-radius: var(--r-md);
      font-size: 13px;
      line-height: 1.6;
      color: var(--ink-mid);
    }
    .capped-note strong { color: var(--accent); }
