:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --navy: #0f2247;
  --purple: #7c3aed;
  --background: #f6f8fc;
  --white: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: #e4e9f2;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 10px 35px rgba(15,34,71,.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.6;
}

.container {
  width: min(1100px, calc(100% - 36px));
  margin: auto;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg,var(--primary),var(--purple));
  color: white;
  font-size: 22px;
}

.header-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

main {
  padding-top: 42px;
  padding-bottom: 65px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 38px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

h1 {
  margin: 10px 0 15px;
  font-size: clamp(26px,4vw,38px);
  line-height: 1.25;
  color: var(--navy);
}

h2 {
  margin: 12px 0 7px;
  font-size: 18px;
  color: var(--navy);
}

.subtitle {
  color: var(--muted);
  max-width: 760px;
  font-size: 16px;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 18px;
  margin: 32px 0;
}

.exam-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fcfdff;
  transition: transform .2s,border-color .2s;
}

.exam-card:hover {
  transform: translateY(-3px);
  border-color: #b6c8ff;
}

.exam-icon {
  font-size: 30px;
}

.exam-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.exam-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 10px;
  background: #eaf1ff;
  color: var(--primary-dark);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.notice {
  padding: 18px 20px;
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  color: #294266;
  font-size: 14px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 13px 22px;
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s,transform .2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-primary {
  color: white;
  background: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--navy);
  background: #edf2fb;
}

.btn-danger {
  color: white;
  background: var(--red);
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.exam-heading,
.progress-meta,
.exam-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.save-status {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.progress-meta {
  margin: 25px 0 9px;
  font-size: 13px;
  color: var(--muted);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: #e9eff8;
  border-radius: 20px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg,var(--primary),var(--purple));
  transition: width .3s;
}

.question-content {
  min-height: 240px;
  padding: 28px 0;
}

.question-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border-radius: 10px;
}

.question-content audio {
  width: 100%;
  margin: 15px 0;
}

.question-content textarea {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

.exam-actions {
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.exam-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.finish-area {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: right;
}

#results-content {
  margin: 25px 0;
}

footer {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media(max-width:700px) {
  .container {
    width: min(100% - 24px,1100px);
  }

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

  .exam-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .header-label {
    display: none;
  }

  .exam-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .exam-actions .btn {
    flex: 1;
  }

  .finish-area .btn {
    width: 100%;
  }
}

/* Navigation directe entre les questions */
.question-navigation {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.question-nav-btn {
  min-height: 42px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
}

.question-nav-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #2563eb;
}

.question-nav-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.question-nav-btn:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.question-nav-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Interface harmonisée avec le simulateur TCF Le Plan B */
:root {
  --primary: #1456c0;
  --primary-dark: #10295c;
  --navy: #172b4d;
  --background: #f3f6fb;
  --text: #172b4d;
  --muted: #63748d;
  --border: #dce4ef;
  --shadow: 0 5px 22px #10295c12;
}

body {
  background: #f3f6fb;
  color: #172b4d;
  font-family: Arial, sans-serif;
}

.topbar {
  background: #10295c;
  color: white;
  border-bottom: none;
}

.header-inner {
  min-height: 90px;
  justify-content: center;
}

.brand, .header-label {
  color: white;
}

.brand-icon {
  background: #1456c0;
}

main.container {
  width: min(850px, calc(100% - 36px));
  padding-top: 35px;
}

.panel {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 5px 22px #10295c12;
}

.exam-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.exam-card {
  background: white;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  padding: 18px;
  box-shadow: none;
}

.exam-card:hover {
  transform: none;
  border-color: #1456c0;
}

.exam-card h2 {
  color: #172b4d;
}

.btn-primary {
  background: #1456c0;
  color: white;
}

.btn-primary:hover {
  background: #10295c;
}

@media (max-width: 600px) {
  .exam-grid {
    grid-template-columns: 1fr;
  }
}
