/* ======================================
   RESET & BASE
====================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #7c3aed;
  --teal:    #a855f7;
  --light:   #f5eeff;
  --dark:    #c17be2;
  --mid:     #d9adf0;
  --accent:  #6d28d9;
  --danger:  #dc2626;
  --warning: #d97706;
  --white:   #2d1054;
  --text:    #2d1054;
  --card-bg: rgba(255,255,255,0.30);
  --radius:  18px;
  font-size: 16px;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--dark);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
}

/* ======================================
   PAGE D'ACCUEIL
====================================== */
.landing {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #c882e8 0%, #ddb8f5 60%, #c07cdf 100%);
  z-index: 100;
  transition: opacity 0.6s, transform 0.6s;
}
.landing.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}
.landing.hidden { display: none; }

.landing-bg-circles {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.circle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(192,132,252,0.15), transparent 70%);
}
.c1 { width: 600px; height: 600px; top: -150px; left: -150px; background: radial-gradient(circle, rgba(216,180,254,0.25), transparent 70%); animation: blob1 8s ease-in-out infinite; }
.c2 { width: 400px; height: 400px; bottom: -100px; right: -80px; background: radial-gradient(circle, rgba(192,132,252,0.30), transparent 70%); animation: blob2 10s ease-in-out infinite; }
.c3 { width: 200px; height: 200px; top: 40%; left: 60%; background: radial-gradient(circle, rgba(232,121,249,0.20), transparent 70%); animation: blob3 6s ease-in-out infinite; }

@keyframes blob1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(60px, 40px) scale(1.1); }
  66%       { transform: translate(-30px, 70px) scale(0.95); }
}
@keyframes blob2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-70px, -50px) scale(1.15); }
  70%       { transform: translate(40px, -30px) scale(0.9); }
}
@keyframes blob3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-50px, 60px) scale(1.2); }
}

.landing-card {
  position: relative; z-index: 2;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(109,40,217,0.25);
  border-radius: 28px;
  padding: 52px 64px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(100,30,180,0.20);
}

.landing-badge {
  display: inline-block;
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.4);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 50px;
  margin-bottom: 24px;
}

.landing-ribbon svg {
  width: 56px; height: 56px;
  margin-bottom: 16px;
}

.landing-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 8px;
}
.landing-title span {
  color: var(--accent);
  font-size: 2rem;
}

.landing-info {
  margin: 28px 0 36px;
  display: flex; flex-direction: column; gap: 10px;
}
.info-line {
  font-size: 1rem;
  color: var(--text);
  display: flex; align-items: center; gap: 10px; justify-content: center;
}
.info-line strong { color: var(--white); }
.info-icon { font-size: 1.1rem; }

.btn-start {
  display: inline-flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #6d28d9, #9333ea, #a855f7);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 16px 36px;
  border: none; border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 30px rgba(109,40,217,0.45);
}
.btn-start svg { width: 22px; height: 22px; }
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(109,40,217,0.60); }
.btn-start:active { transform: scale(0.97); }

/* ======================================
   SLIDESHOW
====================================== */
.slideshow {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--dark);
  overflow: hidden;
}
.slideshow.hidden { display: none; }

/* Barre du haut */
.top-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 56px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(185,112,220,0.80);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(109,40,217,0.22);
}

.icon-btn {
  background: rgba(255,255,255,0.30);
  border: 1px solid rgba(109,40,217,0.20);
  color: #2d1054;
  border-radius: 10px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(109,40,217,0.18); }
.icon-btn.active { background: rgba(109,40,217,0.22); color: var(--accent); border-color: var(--accent); }

.progress-dots {
  display: flex; gap: 6px; align-items: center;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(45,16,84,0.28);
  transition: background 0.3s, transform 0.3s, width 0.3s;
  cursor: pointer;
}
.dot.active {
  background: var(--accent);
  width: 22px;
  border-radius: 4px;
  transform: scaleY(1.1);
}

/* Compteur */
.slide-counter {
  position: absolute; bottom: 20px; right: 24px;
  font-size: 0.8rem; color: rgba(45,16,84,0.50);
  z-index: 20;
}

/* ====== SLIDES WRAPPER ====== */
.slides-wrapper {
  display: flex;
  width: 100%; height: 100%;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.18, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 60px 60px;
  position: relative;
  overflow: visible;
}

/* ====== FONDS PAR SLIDE ====== */
.slide-intro     { background: linear-gradient(135deg, #ddb8f0 0%, #c07cdf 100%); }
.slide-definition{ background: linear-gradient(135deg, #d4aeed 0%, #bf74e0 100%); }
.slide-insuline  { background: linear-gradient(135deg, #e0c3f5 0%, #b868dc 100%); }
.slide-symptomes { background: linear-gradient(135deg, #d8b0ef 0%, #c278e2 100%); }
.slide-quotidien { background: linear-gradient(135deg, #dbb5f0 0%, #b96cda 100%); }
.slide-hypo      { background: linear-gradient(135deg, #e2c8f5 0%, #c580e8 100%); }
.slide-hyper     { background: linear-gradient(135deg, #d5aef0 0%, #bd73e5 100%); }
.slide-consequences { background: linear-gradient(135deg, #d8b5f0 0%, #b870dc 100%); }
.slide-emotions  { background: linear-gradient(135deg, #ddbef2 0%, #c07fe0 100%); }
.slide-organisation { background: linear-gradient(135deg, #d6b0ef 0%, #b86dde 100%); }
.slide-conclusion{ background: linear-gradient(135deg, #e5caf8 0%, #c888e8 100%); }

/* Décor fond */
.slide::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.22), transparent 65%);
  pointer-events: none;
}

/* ====== CONTENU SLIDE ====== */
.slide-content {
  max-width: 1100px;
  width: 100%;
  animation: slide-in 0.5s ease both;
}
.slide-content.center { text-align: center; }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tag {
  display: inline-block;
  background: rgba(109,40,217,0.12);
  border: 1px solid rgba(109,40,217,0.30);
  color: #6d28d9;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 50px;
  margin-bottom: 14px;
}
.tag-danger  { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.35); color: #dc2626; }
.tag-warning { background: rgba(217,119,6,0.12); border-color: rgba(217,119,6,0.35); color: #d97706; }

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 800;
  color: #2d1054;
  margin-bottom: 24px;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.1rem;
  color: rgba(45,16,84,0.75);
  margin-bottom: 28px;
}

p { line-height: 1.7; color: var(--text); }
p strong { color: #1a0a3e; }

/* ====== DEUX COLONNES ====== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.col-text { display: flex; flex-direction: column; gap: 16px; }
.col-img {
  display: flex; align-items: center; justify-content: center;
}
.col-img img {
  max-width: 100%; max-height: 360px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(80,20,150,0.22);
  border: 1px solid rgba(109,40,217,0.18);
}

/* ====== INTRO IMAGE ====== */
.slide-img-wrap {
  margin-top: 24px;
  display: flex; justify-content: center;
}
.slide-img-wrap img {
  max-height: 200px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 16px 50px rgba(80,20,150,0.22);
  border: 1px solid rgba(109,40,217,0.18);
}

/* ====== TEXTE INTRO ====== */
.intro-text {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 700px; margin: 0 auto;
}

/* ====== CARDS ROW ====== */
.cards-row {
  display: flex; gap: 20px; justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.info-card {
  background: rgba(255,255,255,0.38);
  border: 1px solid rgba(109,40,217,0.15);
  border-radius: var(--radius);
  padding: 28px 24px;
  flex: 1; min-width: 200px; max-width: 280px;
  text-align: center;
  transition: transform 0.2s;
}
.info-card:hover { transform: translateY(-4px); }
.info-card.highlight {
  background: rgba(109,40,217,0.14);
  border-color: rgba(109,40,217,0.35);
}
.card-icon { font-size: 2.2rem; margin-bottom: 12px; }
.info-card h3 { font-size: 1rem; color: #2d1054; margin-bottom: 10px; }
.info-card p { font-size: 0.9rem; color: var(--text); }

/* ====== SYMPTÔMES ====== */
.symptom-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 14px;
}
.symptom-list li {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.05rem;
  background: rgba(255,255,255,0.38);
  border: 1px solid rgba(109,40,217,0.12);
  border-radius: 12px;
  padding: 12px 16px;
}
.symptom-list li span { font-size: 1.3rem; }
.quote {
  font-style: italic;
  color: #6d28d9;
  font-size: 0.95rem;
  border-left: 3px solid #9333ea;
  padding-left: 14px;
  margin-top: 8px;
}

/* ====== DISPOSITIFS ====== */
.devices-grid {
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
  margin: 20px 0;
}
.device-card {
  flex: 1; min-width: 160px; max-width: 240px;
  background: rgba(255,255,255,0.40);
  border: 1px solid rgba(109,40,217,0.15);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.device-card img {
  width: 100%; height: 160px; object-fit: contain;
  background: #f0e8fa;
  border-bottom: 1px solid rgba(109,40,217,0.10);
}
.device-card p {
  padding: 10px; font-size: 0.85rem; color: var(--text);
}
.note {
  font-size: 0.9rem;
  color: rgba(45,16,84,0.65);
  text-align: center;
  margin-top: 8px;
}

/* ====== SOLUTION BOX ====== */
.solution-box {
  background: rgba(109,40,217,0.10);
  border: 1px solid rgba(109,40,217,0.25);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.95rem;
  margin-top: 12px;
}
.solution-box.warning {
  background: rgba(217,119,6,0.10);
  border-color: rgba(217,119,6,0.28);
}

/* ====== CHECKLIST ====== */
.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 24px auto 0;
  max-width: 700px;
  text-align: left;
}
.check-item {
  background: rgba(255,255,255,0.38);
  border: 1px solid rgba(109,40,217,0.12);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.95rem;
  color: var(--text);
}

/* ====== CONCLUSION ====== */
.conclusion-text {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 700px; margin: 0 auto 24px;
}
.quote-final {
  font-style: italic;
  font-size: 1.2rem;
  color: #2d1054;
  text-align: center;
  padding: 18px;
  border: 1px solid rgba(109,40,217,0.30);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.30);
  margin-top: 8px;
}
.final-info {
  font-size: 0.9rem;
  color: rgba(45,16,84,0.50);
  margin-bottom: 20px;
}

.btn-restart {
  background: rgba(255,255,255,0.30);
  border: 1px solid rgba(109,40,217,0.40);
  color: #6d28d9;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-restart:hover { background: rgba(109,40,217,0.12); }

/* ====== NAVIGATION FLÈCHES ====== */
.nav-btn {
  position: absolute; top: 50%; z-index: 20;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.40);
  border: 1px solid rgba(109,40,217,0.20);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #2d1054;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn:hover { background: rgba(109,40,217,0.18); transform: translateY(-50%) scale(1.08); }
.nav-btn.prev { left: 16px; }
.nav-btn.next { right: 16px; }

/* ====== ZOOM INDICATEUR ====== */
#zoom-hint {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(168,85,247,0.85);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 50px;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
#zoom-hint.visible { opacity: 1; }

/* Cacher titre/tag/sous-titre quand zoomé */
.slide.is-zoomed .tag,
.slide.is-zoomed h2,
.slide.is-zoomed .subtitle,
.slide.is-zoomed .note {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.slide .tag,
.slide h2,
.slide .subtitle,
.slide .note {
  transition: opacity 0.3s, transform 0.3s;
}

/* Transition douce sur les conteneurs d'images pour le zoom */
.devices-grid, .cards-row, .checklist, .col-img, .slide-img-wrap {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
}

/* ====== OVERLAY CRÉDITS ====== */
#credits-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, #0a0516 0%, #1a0a2e 50%, #0a0516 100%);
  z-index: 9998;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s;
  cursor: pointer;
}
#credits-overlay.show {
  opacity: 1;
  pointer-events: all;
}
#credits-inner {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: min(680px, 90vw);
  text-align: center;
  padding: 40px 20px 80px;
  animation: credits-scroll 22s linear forwards;
}
@keyframes credits-scroll {
  from { top: 100vh; }
  to   { top: -2000px; }
}
.credits-logo {
  font-size: 3.5rem;
  margin-bottom: 16px;
}
.credits-title {
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.credits-subtitle {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(192,132,252,0.7);
  margin-bottom: 6px;
}
.credits-divider {
  width: 80px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 32px auto;
}
.credits-section-title {
  font-size: 0.8rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}
.credits-name {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}
.credits-detail {
  font-size: 0.95rem;
  color: rgba(233,213,255,0.7);
  margin-bottom: 6px;
  line-height: 1.6;
}
.credits-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(168,85,247,0.15);
  font-size: 0.9rem;
  color: rgba(233,213,255,0.85);
  gap: 16px;
}
.credits-item span:last-child {
  color: var(--accent);
  font-style: italic;
  white-space: nowrap;
}
.credits-fin {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(192,132,252,0.8);
  padding: 20px 0;
}
#credits-skip-hint {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s;
}
#credits-skip-hint.show { opacity: 1; }

/* ====== OVERLAY MERCI + CONFETTIS ====== */
#merci-overlay {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(15, 10, 30, 0.92);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
#merci-overlay.show {
  opacity: 1;
  pointer-events: all;
}
#confetti-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#merci-text {
  position: relative; z-index: 2;
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 40px rgba(192,132,252,0.9), 0 0 80px rgba(168,85,247,0.6);
  animation: merci-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  letter-spacing: 2px;
}
#merci-sub {
  position: relative; z-index: 2;
  margin-top: 18px;
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--accent);
  opacity: 0;
  animation: merci-fade 0.6s 0.4s ease both;
}
@keyframes merci-pop {
  from { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}
@keyframes merci-fade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .slide { padding: 70px 20px 50px; }
  .two-col { grid-template-columns: 1fr; gap: 20px; }
  .col-img img { max-height: 200px; }
  .cards-row { gap: 12px; }
  .info-card { min-width: 140px; padding: 20px 16px; }
  .devices-grid { gap: 12px; }
  .device-card img { height: 110px; }
  .checklist { grid-template-columns: 1fr; }
  .landing-card { padding: 36px 28px; }
  .landing-title { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .nav-btn { width: 42px; height: 42px; }
}
