/* ============================================================
   Charte UI — Diagnostic Tuteur Fiteco
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

:root {
  --fiteco-red: #E4003A;
  --fiteco-anthracite: #3D3935;
  --bg-page: #FFFFFF;
  --bg-card: #F8F8F8;
  --border: #E2E8F0;
  --text-main: #0F172A;
  --text-secondary: #64748B;
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #DC2626;
}

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

html, body {
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  color: var(--text-main);
  background: var(--bg-page);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Layout ---- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-logo {
  height: 36px;
  width: auto;
}

.main-content {
  flex: 1;
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.footer {
  padding: 16px 40px;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* ---- Typography ---- */
h1 { font-size: 32px; font-weight: 600; color: var(--text-main); line-height: 1.2; }
h2 { font-size: 24px; font-weight: 600; color: var(--text-main); line-height: 1.3; }
h3 { font-size: 20px; font-weight: 500; color: var(--text-main); }
h4 { font-size: 18px; font-weight: 500; color: var(--text-main); }
p  { font-size: 16px; color: var(--text-secondary); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-primary {
  background: var(--fiteco-anthracite);
  color: #fff;
  border-color: var(--fiteco-anthracite);
}
.btn-primary:hover:not(:disabled) {
  background: #2a2825;
  border-color: #2a2825;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--fiteco-red);
}

/* ---- Card ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

/* ---- Progress bar ---- */
.progress-bar-wrapper {
  margin-bottom: 32px;
}
.progress-bar-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.progress-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--fiteco-red);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ---- Options ---- */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.5;
}
.option-item:hover {
  border-color: #c0c8d4;
}
.option-item.selected {
  border-color: var(--fiteco-red);
  box-shadow: 0 0 0 3px rgba(228, 0, 58, 0.1);
}
.option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-item.selected .option-radio {
  border-color: var(--fiteco-red);
  background: var(--fiteco-red);
}
.option-item.selected .option-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}

/* ---- Toast notification ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--fiteco-anthracite);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Question screen ---- */
.question-header {
  margin-bottom: 24px;
}
.question-enonce {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
}

/* Most/Least special */
.most-least-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.most-least-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.most-least-col-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.most-least-col-header.most { color: var(--success); }
.most-least-col-header.least { color: var(--error); }

.ml-option {
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.4;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
}
.ml-option:hover { border-color: #c0c8d4; }
.ml-option.selected-most {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
  background: #f0fdf4;
}
.ml-option.selected-least {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  background: #fff5f5;
}

.action-row {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

/* ---- Rapport ---- */
.rapport-section {
  margin-bottom: 40px;
}
.rapport-section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

/* Score global */
.score-global-block {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
}
.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--fiteco-anthracite);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-circle-number {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}
.score-circle-label {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.score-global-text {}
.score-niveau {
  font-size: 13px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}
.score-niveau.solide { background: #dcfce7; color: var(--success); }
.score-niveau.progression { background: #fef9c3; color: #854d0e; }
.score-niveau.developper { background: #fee2e2; color: var(--error); }
.score-phrase {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.6;
}

/* Axes scores table */
.axes-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.axe-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.axe-score-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-main);
}
.axe-score-bar-track {
  width: 140px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.axe-score-bar-fill {
  height: 100%;
  background: var(--fiteco-red);
  border-radius: 3px;
}
.axe-score-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  width: 40px;
  text-align: right;
}

/* Radar */
.radar-container {
  position: relative;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  justify-content: center;
}
#radarChart {
  max-width: 480px;
  max-height: 480px;
}

/* Recommandations */
.reco-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}
.reco-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.reco-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}
.reco-card-score {
  font-size: 13px;
  color: var(--text-secondary);
}
.reco-card-phrase {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}
.reco-card-cta {
  display: inline-block;
  padding: 9px 20px;
  background: var(--fiteco-anthracite);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.reco-card-cta:hover { background: #2a2825; }

/* Détail expandable */
.detail-axe {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.detail-axe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.detail-axe-header:hover { background: #f0f2f5; }
.detail-axe-arrow {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}
.detail-axe-header[aria-expanded="true"] .detail-axe-arrow {
  transform: rotate(180deg);
}
.detail-axe-body {
  display: none;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.detail-axe-body.open { display: block; }

.detail-situation {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.detail-situation:last-child { border-bottom: none; }
.detail-sit-enonce {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}
.detail-sit-chosen {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.detail-sit-chosen span { font-style: italic; }
.detail-sit-expected {
  font-size: 13px;
  color: var(--success);
  margin-bottom: 8px;
}
.detail-sit-retour {
  font-size: 13px;
  color: var(--text-main);
  background: #f8f8f8;
  border-left: 3px solid var(--fiteco-red);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}

/* Export button */
.export-row {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

/* ---- Accueil ---- */
.home-hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.home-hero h1 {
  margin-bottom: 16px;
}
.home-hero .subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
}
.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.home-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
.home-feature-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
}
.home-feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
}
.home-feature-number {
  font-size: 24px;
  font-weight: 600;
  color: var(--fiteco-red);
  margin-bottom: 8px;
}
.home-cta-wrapper {
  display: flex;
  justify-content: center;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .header { padding: 16px 20px; }
  .main-content { padding: 24px 20px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .home-features { grid-template-columns: 1fr; }
  .score-global-block { flex-direction: column; text-align: center; }
  .most-least-container { grid-template-columns: 1fr; }
  .axe-score-bar-track { width: 80px; }
  .question-enonce { font-size: 15px; }
  .option-item { font-size: 14px; }
}

/* ============================================================
   CSS Print
   ============================================================ */
@media print {
  .header { border-bottom: 1px solid #ccc; }
  .btn, .action-row, .export-row { display: none !important; }
  .detail-axe-body { display: block !important; }
  .detail-axe-header .detail-axe-arrow { display: none; }
  .page-wrapper { display: block; }
  .main-content { max-width: 100%; padding: 20px; }
  .radar-container { page-break-inside: avoid; }
  .reco-card { page-break-inside: avoid; }
  .detail-axe { page-break-inside: avoid; }
  #radarChart { max-width: 360px; max-height: 360px; }
  .footer { position: fixed; bottom: 0; left: 0; right: 0; }
}
