/* ==========================================================
   STEN — Analyse des stéréotypes
   CSS autonome pour analyse-stereotypes.html
   Créé pour une interface sombre, épurée et cohérente.
   ========================================================== */

:root {
  --bg: #0b1220;
  --bg-2: #101a2f;
  --bg-3: #14213a;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #c7d2fe;
  --muted-2: #64748b;
  --text-light: #f8fafc;
  --text-soft: #cbd5e1;
  --line: rgba(148, 163, 184, 0.22);
  --line-dark: #e2e8f0;
  --primary: #7c3aed;
  --primary-2: #2563eb;
  --cyan: #22c7f2;
  --good: #16a34a;
  --bad: #dc2626;
  --warning: #f59e0b;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.24);
  --shadow-soft: 0 14px 38px rgba(15, 23, 42, 0.12);
  --wrap: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.16), transparent 32rem),
    radial-gradient(circle at 85% 12%, rgba(34, 199, 242, 0.10), transparent 26rem),
    linear-gradient(180deg, var(--bg) 0%, #101828 48%, #f8fafc 48%, #eef2f7 100%);
  color: var(--text-light);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrap {
  width: min(var(--wrap), calc(100% - 80px));
  margin-inline: auto;
}

/* Accessibilité */
.skip-link {
  position: absolute;
  left: 18px;
  top: 14px;
  z-index: 1000;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid rgba(34, 199, 242, 0.45);
}

/* Header comme la capture */
.top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 15, 29, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.logo {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, #7667ff 0%, #21c5f3 100%);
  box-shadow: 0 12px 30px rgba(34, 199, 242, 0.22);
}

.links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.76);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 820;
  border: 1px solid transparent;
  transition: 160ms ease;
}

.links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(203, 213, 225, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Structure page */
.page-shell {
  padding-bottom: 72px;
}

.hero {
  width: min(var(--wrap), calc(100% - 80px));
  margin-inline: auto;
  padding: 56px 0 70px;
  color: #fff;
}

.hero h1 {
  max-width: 980px;
  margin: 18px 0 14px;
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  line-height: 0.98;
  font-weight: 950;
}

.hero p:not(.eyebrow) {
  max-width: 820px;
  margin: 0;
  color: #c7d2fe;
  font-size: clamp(1.05rem, 1.6vw, 1.24rem);
  line-height: 1.65;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.28);
  border: 1px solid rgba(167, 139, 250, 0.52);
  color: #f5f3ff;
  font-size: 0.82rem;
  font-weight: 900;
}

.panel {
  width: min(var(--wrap), calc(100% - 80px));
  margin: 0 auto 24px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--shadow-soft);
}

.panel.dark {
  background: linear-gradient(180deg, #0f172a 0%, #101a2f 100%);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.28);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading.compact {
  max-width: 840px;
}

.section-heading h2 {
  margin: 13px 0 8px;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.03;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted-2);
  font-size: 1.02rem;
}

.panel.dark .section-heading p:not(.eyebrow),
.panel.dark .muted {
  color: #cbd5e1;
}

.muted {
  color: var(--muted-2);
}

.hidden {
  display: none !important;
}

/* Table typologie */
.type-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.type-table th,
.type-table td {
  padding: 15px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
}

.type-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.type-table tr:last-child td {
  border-bottom: 0;
}

.type-table td:first-child {
  width: 22%;
}

/* Elocutio */
.elocutio-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 13px;
}

.elocutio-item {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid #e2e8f0;
}

.elocutio-item strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 1rem;
}

.elocutio-item span {
  color: #475569;
}

/* Méthode */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.method-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-dark);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.method-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.method-card p {
  margin: 0;
  color: var(--muted-2);
}

/* Formulaires et boutons */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.input,
.select {
  min-height: 44px;
  border: 1px solid #dbe2ef;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
  transition: 150ms ease;
}

.input:focus,
.select:focus {
  border-color: rgba(124, 58, 237, 0.70);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.panel.dark .input,
.panel.dark .select {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.96);
}

textarea.input {
  resize: vertical;
  line-height: 1.55;
}

.btn {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid #dbe2ef;
  box-shadow: none;
}

.btn.secondary:hover {
  border-color: rgba(124, 58, 237, 0.45);
}

/* Analyse interactive */
.analysis-layout {
  display: grid;
  grid-template-columns: minmax(280px, 350px) 1fr;
  gap: 18px;
  align-items: start;
}

.case-list {
  display: grid;
  gap: 10px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.case-list::-webkit-scrollbar {
  width: 8px;
}

.case-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
}

.case-button {
  width: 100%;
  text-align: left;
  border: 1px solid #dbe2ef;
  background: #fff;
  border-radius: 16px;
  padding: 13px;
  color: var(--ink);
  transition: 150ms ease;
}

.case-button:hover,
.case-button.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.case-button strong {
  display: block;
}

.case-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
}

.analysis-box {
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-dark);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.analysis-box h3 {
  margin: 10px 0 14px;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.08;
}

.case-text {
  margin: 14px 0;
  padding: 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  white-space: pre-wrap;
}

.tag {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.80rem;
  font-weight: 850;
}

.axis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.axis {
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.axis strong {
  display: block;
  margin-bottom: 5px;
  color: #111827;
}

.axis p {
  margin: 0;
  color: #475569;
}

.reveal {
  display: none;
  margin-top: 18px;
}

.reveal.show {
  display: block;
}

.feedback {
  margin-top: 14px;
  padding: 15px;
  border-radius: 18px;
  background: #fefce8;
  color: #713f12;
  border: 1px solid #fde68a;
}

/* Mini-quiz */
.quiz-mini {
  display: grid;
  gap: 12px;
}

.answers {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.answer-btn {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 15px;
  border: 1px solid #dbe2ef;
  background: #fff;
  color: var(--ink);
  font-weight: 720;
  transition: 150ms ease;
}

.answer-btn:hover {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}

.answer-btn.correct {
  border-color: rgba(22, 163, 74, 0.7);
  background: #f0fdf4;
  color: #14532d;
}

.answer-btn.wrong {
  border-color: rgba(220, 38, 38, 0.65);
  background: #fef2f2;
  color: #7f1d1d;
}

.exam-template {
  margin: 0;
  padding: 20px;
  border-radius: 20px;
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.22);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Footer éventuel */
.footer,
.site-footer {
  width: min(var(--wrap), calc(100% - 80px));
  margin: 56px auto 0;
  padding: 24px 0 34px;
  color: #64748b;
  text-align: center;
}

.footer a,
.site-footer a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}

.footer a:hover,
.site-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1100px) {
  .wrap,
  .hero,
  .panel,
  .footer,
  .site-footer {
    width: min(100% - 48px, var(--wrap));
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px 0;
    gap: 12px;
  }

  .links {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(124, 58, 237, 0.16), transparent 28rem),
      linear-gradient(180deg, var(--bg) 0%, #101828 42%, #f8fafc 42%, #eef2f7 100%);
  }

  .method-grid,
  .analysis-layout,
  .axis-grid {
    grid-template-columns: 1fr;
  }

  .case-list {
    max-height: 420px;
  }

  .type-table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .wrap,
  .hero,
  .panel,
  .footer,
  .site-footer {
    width: min(100% - 28px, var(--wrap));
  }

  .hero {
    padding: 38px 0 48px;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 13vw, 3.4rem);
  }

  .panel {
    border-radius: 22px;
    padding: 18px;
  }

  .brand {
    font-size: 0.98rem;
  }

  .logo {
    width: 36px;
    height: 36px;
  }

  .links a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.88rem;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .input,
  .toolbar .select,
  .toolbar .btn {
    width: 100%;
  }

  .type-table th,
  .type-table td {
    min-width: 210px;
    padding: 12px;
  }
}
