/* ══════════════════════════════════════════
   PolitiScale — Styles
   Hérite de global.css : --f-display, --f-body, --f-mono,
   --bg, --surface, --surface2, --border, --border2,
   --text, --text2, --muted, --accent, --gold, --teal, --blue,
   --r, --r-sm, --r-lg, --r-xl, --t, --ease, --shadow
   ══════════════════════════════════════════ */

/* ── Screens ── */
.ps-screen { display: none; }
.ps-screen.active { display: block; animation: fadeUp .4s var(--ease) both; }

/* ══════════════════════════════════════════
   INTRO
   ══════════════════════════════════════════ */
#screen-intro.active {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

.intro-center {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  width: 100%;
}

.glow-ring {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    #e05a5a, #a0d080, #60c8a0, #6090e0, #60d090,
    #c060e0, #5ab4e0, #e05060, #e08040, #e0b060, #e05a5a);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
  animation: ps-spin 24s linear infinite;
  filter: drop-shadow(0 0 32px rgba(200,180,255,.35));
}
@keyframes ps-spin { to { transform: rotate(360deg); } }

.glow-ring-inner {
  width: 114px; height: 114px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
}

.intro-h1 {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -.03em;
  color: var(--text);
}
.intro-h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.intro-tagline {
  font-size: 1rem;
  color: var(--text2);
  max-width: 500px;
  margin-bottom: 32px;
  font-weight: 400;
  line-height: 1.7;
}

.axes-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 600px;
  margin-bottom: 36px;
}
.axe-tag {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid;
  font-family: var(--f-mono);
  opacity: .85;
}

.intro-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 16px;
  font-family: var(--f-mono);
  letter-spacing: .04em;
}

/* ══════════════════════════════════════════
   QUIZ
   ══════════════════════════════════════════ */
#screen-quiz.active { display: block; }

.quiz-top {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
}
.quiz-logo {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  font-style: italic;
}
.progress-wrap {
  flex: 1;
  background: var(--surface2);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 100px;
  width: 0;
  transition: width .4s var(--ease);
}
.progress-label {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.quiz-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 24px 100px;
}

.domaine-chip {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 22px;
  border: 1px solid currentColor;
  font-family: var(--f-mono);
  opacity: .85;
}

.question-text {
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -.02em;
}
.question-detail {
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 36px;
  font-weight: 400;
  max-width: 580px;
  line-height: 1.6;
}

.answers {
  display: grid;
  gap: 9px;
  margin-bottom: 32px;
}
.answer-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--f-body);
  font-size: .9rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background var(--t), border-color var(--t), transform var(--t) var(--ease);
  position: relative;
  overflow: hidden;
}
.answer-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.answer-btn.sd::before { background: #4caf50; }
.answer-btn.d::before  { background: #8bc34a; }
.answer-btn.n::before  { background: var(--muted); }
.answer-btn.c::before  { background: #ff9800; }
.answer-btn.sc::before { background: #f44336; }

.answer-btn:hover {
  background: var(--surface2);
  border-color: var(--border2);
  transform: translateX(4px);
}
.answer-btn.selected {
  background: var(--surface2);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}

.answer-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--muted);
  font-family: var(--f-mono);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.answer-btn.selected .answer-letter {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.nav-btns {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-sm { padding: 10px 22px; font-size: .85rem; }

.skip-link {
  font-size: .78rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--f-body);
  margin-left: auto;
  transition: color var(--t);
}
.skip-link:hover { color: var(--text2); }

/* ══════════════════════════════════════════
   RÉSULTATS
   ══════════════════════════════════════════ */
#screen-result.active { display: block; }

.result-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 60px 24px 52px;
  text-align: center;
}
.result-hero h2 {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 12px;
  color: var(--text);
}
.profile-label {
  display: inline-block;
  padding: 5px 18px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid;
  margin-bottom: 18px;
  font-family: var(--f-mono);
}
.profile-desc {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text2);
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.8;
}

.result-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 52px 24px 80px;
}

/* Section titles — distinct de .section-title global */
.ps-section-title {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  margin-top: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  letter-spacing: -.01em;
}
.ps-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.ps-section-title:first-child { margin-top: 0; }

/* ── Boussole ── */
.compass-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}
.compass-grid {
  position: relative;
  width: min(300px, 88vw);
  height: min(300px, 88vw);
  margin: 0 auto 12px;
}
.compass-svg { width: 100%; height: 100%; }
.compass-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  text-align: center;
  width: min(300px, 88vw);
  gap: 4px;
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: var(--f-mono);
  margin-bottom: 8px;
}
.compass-labels .top    { grid-column: 2; font-weight: 700; color: #e05060; }
.compass-labels .bottom { grid-column: 2; font-weight: 700; color: #60c8a0; }
.compass-labels .left   { grid-column: 1; font-weight: 700; color: #e05a5a; text-align: left; }
.compass-labels .right  { grid-column: 3; font-weight: 700; color: #5ab4e0; text-align: right; }

/* ── Axes ── */
.axes-grid { display: grid; gap: 22px; margin-bottom: 16px; }
.axe-row { display: grid; gap: 6px; }
.axe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  font-weight: 600;
  gap: 8px;
  color: var(--text2);
}
.axe-bar-wrap {
  position: relative;
  height: 10px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: visible;
}
.axe-bar-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 100px;
  transition: width .8s cubic-bezier(.4,0,.2,1), left .8s cubic-bezier(.4,0,.2,1);
}
.axe-cursor {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  transition: left .8s cubic-bezier(.4,0,.2,1);
  z-index: 2;
  box-shadow: 0 0 8px rgba(0,0,0,.4);
}
.axe-labels {
  display: flex;
  justify-content: space-between;
  font-size: .64rem;
  color: var(--muted);
  margin-top: 3px;
  font-family: var(--f-mono);
}

/* ── Partis ── */
.partis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.parti-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: border-color var(--t), box-shadow var(--t);
}
.parti-card:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.parti-name {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.parti-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.compat-bar-wrap {
  background: var(--surface2);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}
.compat-bar { height: 100%; border-radius: 100px; transition: width .6s var(--ease); }
.compat-pct { font-size: .68rem; color: var(--muted); margin-top: 5px; font-family: var(--f-mono); }

/* ── Penseurs ── */
.penseurs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.penseur-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  text-align: center;
  transition: border-color var(--t), transform var(--t) var(--ease), box-shadow var(--t);
}
.penseur-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}
.penseur-emoji { font-size: 2rem; margin-bottom: 10px; }
.penseur-name { font-weight: 700; font-size: .88rem; margin-bottom: 5px; color: var(--text); }
.penseur-desc { font-size: .72rem; color: var(--muted); line-height: 1.5; }

/* ── Actions ── */
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   CACHE BANNER
   ══════════════════════════════════════════ */
#cache-banner {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 12px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 999;
  box-shadow: var(--shadow);
  font-size: .82rem;
  white-space: nowrap;
  max-width: 90vw;
  animation: fadeUp .3s var(--ease) both;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 600px) {
  .quiz-body    { padding: 28px 16px 80px; }
  .result-body  { padding: 32px 16px 60px; }
  .result-hero  { padding: 40px 16px 36px; }
  .nav-btns     { flex-direction: column; align-items: stretch; }
  .skip-link    { margin-left: 0; text-align: center; }
  .quiz-top     { padding: 12px 16px; gap: 10px; }
  .quiz-logo    { display: none; }
}
