/* ==========================================================================
   Auto-Évaluation du Burn-out - Cabinet de Psychologie
   CSS Pur Moderne | Mobile-First | Palette Santé & Bien-être
   ========================================================================== */

:root {
  /* Nuances apaisantes & naturelles */
  --primary: #2D6A4F;
  --primary-hover: #1B4332;
  --primary-subtle: #D8F3DC;
  --primary-light: #EBF8EE;

  --accent: #D4A373;
  --accent-light: #FAF0E6;

  --bg-app: #F7FAF8;
  --bg-card: #FFFFFF;
  --bg-subtle: #F0F5F2;

  --text-main: #1D2D24;
  --text-muted: #526E60;
  --text-light: #839D90;

  --border: #E1ECE5;
  --border-focus: #52B788;

  /* Niveaux de risque */
  --level-1: #2E7D32;
  --level-1-bg: #E8F5E9;
  --level-2: #D48B00;
  --level-2-bg: #FFF8E1;
  --level-3: #E07A5F;
  --level-3-bg: #FBEAE5;
  --level-4: #C9184A;
  --level-4-bg: #FFE5EC;

  /* Rayons & Ombres */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 6px rgba(29, 45, 36, 0.04);
  --shadow-md: 0 8px 24px rgba(29, 45, 36, 0.08);
  --shadow-lg: 0 16px 36px rgba(29, 45, 36, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 0;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.96);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #1B4332);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-anonymous {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Main Layout */
.app-main {
  flex: 1;
  padding: 2rem 0 3.5rem;
}

/* Card Module */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

@media (max-width: 600px) {
  .card {
    padding: 1.5rem 1.15rem;
  }
}

/* Screen Management */
.screen {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.screen.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   ÉCRAN 1 : ACCUEIL
   ========================================================================== */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.65rem;
  }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.intro-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.meta-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.meta-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.meta-box strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
}

.meta-box span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.disclaimer-box {
  display: flex;
  gap: 0.75rem;
  background: #FFFBF0;
  border: 1px solid #F6E2B3;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: #7D5D18;
  line-height: 1.5;
}

.disclaimer-box svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(45, 106, 79, 0.35);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-large {
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
  width: 100%;
}

@media (min-width: 600px) {
  .btn-large {
    width: auto;
  }
}

/* ==========================================================================
   ÉCRAN 2 : QUESTIONNAIRE (STEP-BY-STEP)
   ========================================================================== */
.wizard-header {
  margin-bottom: 1.75rem;
}

.progress-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.progress-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
  width: 10%;
}

.question-card-inner {
  margin-bottom: 2rem;
}

.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .question-text {
    font-size: 1.55rem;
  }
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
  text-align: left;
  outline: none;
  font-family: inherit;
}

.option-item:hover {
  border-color: var(--border-focus);
  background: var(--bg-subtle);
  transform: translateX(3px);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-item-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.option-item.selected .option-item-label {
  color: var(--primary-hover);
}

.option-item-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.option-item.selected .option-item-radio {
  border-color: var(--primary);
  background: var(--primary);
}

.option-item-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.option-item.selected .option-item-radio-dot {
  transform: scale(1);
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

/* ==========================================================================
   ÉCRAN 3 : RÉSULTATS
   ========================================================================== */
.results-summary-card {
  text-align: center;
  border-radius: var(--radius-xl);
  padding: 2.25rem 1.75rem;
  margin-bottom: 1.75rem;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.score-display-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.score-big-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.score-max-number {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
}

.level-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.level-desc-text {
  font-size: 1.05rem;
  color: var(--text-main);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}

/* Badge de dimension du wizard */
.dimension-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Grille des 3 sous-échelles CBI dans le bilan */
.cbi-subscales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 1.5rem;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.cbi-subscale-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.cbi-subscale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.cbi-subscale-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.cbi-subscale-score {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cbi-subscale-track {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.cbi-subscale-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* AI Advice Block */
.ai-advice-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.ai-advice-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ai-advice-header svg {
  color: var(--primary);
  flex-shrink: 0;
}

.ai-advice-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.ai-advice-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-main);
}

.ai-advice-content ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.ai-advice-content li {
  margin-bottom: 0.75rem;
}

.ai-advice-content strong {
  color: var(--primary-hover);
}

/* Skeleton Loader */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #EDF2EF 25%, #E1ECE5 50%, #EDF2EF 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: var(--radius-pill);
}

.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.full { width: 100%; }

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Contextual CTA for Levels 3 & 4 (Compact & Sleek) */
.cta-consultation-card {
  display: none;
  background: linear-gradient(135deg, var(--primary), #1B4332);
  color: white;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.cta-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .cta-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.cta-text h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.cta-text p {
  font-size: 0.825rem;
  opacity: 0.92;
  line-height: 1.35;
  margin: 0;
}

.btn-cta {
  background: white;
  color: var(--primary-hover);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn-cta:hover {
  background: var(--primary-subtle);
  transform: translateY(-1px);
}

/* Results Actions Bar */
.results-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Footer */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Print Stylesheet */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .app-header, .wizard-footer, .results-actions-bar, .app-footer, #screen-intro, #screen-wizard {
    display: none !important;
  }
  #screen-results {
    display: block !important;
    opacity: 1 !important;
  }
  .card, .results-summary-card, .ai-advice-section, .cta-consultation-card {
    box-shadow: none !important;
    border: 1px solid #bbb !important;
    break-inside: avoid;
  }
}
