:root {
  --navy: #2c4a63;
  --navy-soft: rgba(44, 74, 99, 0.6);
  --powder: #a9cbdc;
  --slate: #6f9db5;
  --bg: #eef1f3;
  --card: #f4f7f8;
  --white: #ffffff;
  --border: #e2e8ec;
  --amber: #c97b3f;
  --green: #3fa563;
  --danger: #b00020;

  /* Élévation : mêmes tons navy que le pitch deck, en beaucoup plus doux,
     pour donner de la profondeur sans jamais alourdir l'écran. */
  --shadow-sm: 0 2px 8px rgba(44, 74, 99, 0.08);
  --shadow-md: 0 8px 24px rgba(44, 74, 99, 0.12);
  --shadow-lg: 0 16px 40px rgba(44, 74, 99, 0.16);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(120% 100% at 18% -10%, #f7f2fb 0%, #eef1f3 55%, #e7ebef 100%);
  font-family: 'Inter', sans-serif;
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}

#root { height: 100%; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--slate); }

button { font-family: inherit; }

.touja-app {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow-x: hidden;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  box-sizing: border-box;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  animation: screen-enter 0.42s var(--ease-out) both;
}

.screen.no-pad-top { padding-top: env(safe-area-inset-top, 0px); }
.screen.scroll { overflow-y: auto; }

/* Transition d'entrée à chaque changement d'écran : c'est ce qui fait
   passer le prototype de "page web qui se recharge" à "appli qui navigue". */
@keyframes screen-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

.font-serif { font-family: 'Fraunces', serif; }

.back-btn {
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  padding: 0;
  transition: transform .15s var(--ease-out), background .15s ease;
}
.back-btn:hover { background: var(--border); }
.back-btn:active { transform: scale(0.88); }

.pill-btn {
  cursor: pointer;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  background: var(--navy);
  border: none;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), opacity .15s ease;
}
.pill-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pill-btn:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }
.pill-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
.pill-btn.secondary { background: var(--slate); }
.pill-btn.powder { background: var(--powder); color: var(--navy); }

.list-card {
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.list-row {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  position: relative;
  font-size: 15px;
  cursor: pointer;
}
.list-row:hover { background: var(--card); }
.list-row + .list-row::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 0;
  height: 0.5px;
  background: rgba(60,60,67,0.12);
}

.choice-card {
  cursor: pointer;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--card);
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  border: 1.5px solid transparent;
  line-height: 1.4;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s ease;
}
.choice-card:hover { background: #eef3f6; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.choice-card:active { transform: translateY(0) scale(0.98); }
.choice-card.selected {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
}

.live-banner {
  box-shadow: 0 6px 20px rgba(44, 74, 99, 0.28);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.live-banner:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(44, 74, 99, 0.34); }
.live-banner:active { transform: translateY(0) scale(0.98); }

.home-card {
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.home-card[data-clickable="true"]:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.home-card[data-clickable="true"]:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.quiz-progress-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--slate);
  border-radius: 10px;
  transition: width .2s ease;
}
.quiz-progress-label {
  font-size: 11.5px;
  color: var(--navy-soft);
  flex-shrink: 0;
}

.field-input {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--navy);
  width: 100%;
  font-family: inherit;
  background: #fff;
}
.field-input:focus { outline: 2px solid var(--slate); outline-offset: 1px; }
.field-label {
  font-size: 12px;
  color: rgba(44,74,99,0.6);
  margin-bottom: 6px;
  font-weight: 600;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,30,40,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet-panel {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 26px 24px calc(env(safe-area-inset-bottom, 0px) + 30px);
  box-sizing: border-box;
}

.toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background .15s ease;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left .15s ease;
}

@keyframes touja-halo { 0%, 100% { transform: scale(0.94); opacity: 0.7; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes touja-breathe { 0%, 100% { transform: scale(1); opacity: 0.92; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes touja-blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.8; } }

.no-scrollbar::-webkit-scrollbar { display: none; }

.dev-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px;
  font-size: 12px;
  z-index: 999;
  display: none;
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .dev-nav { display: block; }
  body.dev-nav-open .touja-app { margin-right: 240px; }
}
.dev-nav-item {
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--navy);
}
.dev-nav-item:hover { background: var(--bg); }
.dev-nav-item.active { background: var(--navy); color: #fff; }
.dev-nav-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(44,74,99,0.45);
  margin: 14px 0 4px;
  padding: 0 10px;
}

.time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 84px;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  cursor: grab;
  margin: 0;
}
.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: grab;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.time-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: grab;
}
.time-slider::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--border);
}
