/* =============================================================
   VARIABLES — Charte graphique Timed
   ============================================================= */
:root {
  /* Couleurs Timed (charte officielle) */
  --color-primary:        #010A3E;   /* Dark navy — texte et titres */
  --color-primary-soft:   #1a2455;
  --color-accent:         #44A1AA;   /* Bleu canard — CTA principaux */
  --color-accent-dark:    #357f87;
  --color-accent-soft:    #eaf4f5;
  --color-secondary:      #AABD39;   /* Vert pomme — accents secondaires */
  --color-success:        #10b981;

  /* Neutres */
  --color-bg:             #f4f6f9;   /* Fond pastel doux */
  --color-surface:        #ffffff;
  --color-border:         #e5e7eb;
  --color-text:           #1f2937;
  --color-text-muted:     #6b7280;

  /* Typographies (charte) */
  --font-headings: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:     'Poppins',    -apple-system, BlinkMacSystemFont, sans-serif;

  /* Rayons & ombres */
  --radius-card:  24px;   /* radius demandé pour la carte */
  --radius-sm: 10px;
  --radius-md: 16px;
  --shadow-sm: 0 1px 2px rgba(1, 10, 62, .04);
  --shadow-md: 0 8px 24px rgba(1, 10, 62, .08);
  --shadow-lg: 0 16px 40px rgba(1, 10, 62, .12);

  --container-max: 580px;
}

/* =============================================================
   RESET DOUX
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: var(--color-accent-dark); }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-primary);
  background: var(--color-bg);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* =============================================================
   TOPBAR
   ============================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 11;
}
.topbar__logo img { height: 28px; }
.topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.topbar__back:hover { background: var(--color-bg); color: var(--color-primary); }

/* =============================================================
   LAYOUT GÉNÉRAL
   ============================================================= */
.app {
  flex: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.screen { animation: fadeIn .25s ease-out; }
.screen[hidden] { display: none; }
.screen--center { text-align: center; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   CARTE BLANCHE (welcome, success, contact, fallback)
   ============================================================= */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(1, 10, 62, .04);
}
.card--welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;            /* espacement vertical entre mascotte / titre / desc / bouton */
  padding: 36px 28px;
  text-align: center;
}
.card--center { text-align: center; }

/* =============================================================
   ÉCRAN ACCUEIL
   ============================================================= */
.welcome__visual {
  display: flex;
  justify-content: center;
  margin: 0;
}
.welcome__visual--small .mascot { max-width: 140px; }
.mascot {
  max-width: 200px;
  width: 100%;
}
.welcome__title {
  font-family: var(--font-headings);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}
.welcome__subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  margin: 0;
}
.welcome__subtitle strong { color: var(--color-primary); font-weight: 600; }

/* Le bouton dans la carte welcome est en pleine largeur */
.card--welcome .btn--xl { margin-top: 4px; }

/* =============================================================
   QUESTIONS / PROGRESS
   ============================================================= */
.progress {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin: 0 0 10px;
}
.question {
  font-family: var(--font-headings);
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 24px;
}

/* =============================================================
   CHOIX (boutons d'options)
   ============================================================= */
.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.choices--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  transition: all .15s;
  min-height: 120px;
  text-align: center;
}
.choice:hover,
.choice:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.choice:focus-visible { outline: 3px solid rgba(68, 161, 170, .35); outline-offset: 2px; }
.choice svg { color: var(--color-primary); }

.choice--row {
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  padding: 20px;
  min-height: 0;
}
.choice__icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}
.choice__body { display: flex; flex-direction: column; gap: 4px; }
.choice__title { font-size: 17px; font-weight: 600; color: var(--color-primary); }
.choice__desc { font-size: 14px; font-weight: 400; color: var(--color-text-muted); }

/* =============================================================
   ÉTAPES DE DÉPANNAGE
   ============================================================= */
.step {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(1, 10, 62, .04);
  margin-bottom: 20px;
}
.step__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
}
.step__title {
  font-family: var(--font-headings);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 12px;
}
.step__instructions {
  margin: 0 0 18px;
  color: var(--color-text);
}
.step__instructions p { margin: 0 0 10px; }
.step__instructions ol,
.step__instructions ul {
  padding-left: 22px;
  margin: 8px 0 0;
}
.step__instructions ul { list-style: disc; }
.step__instructions li { margin-bottom: 8px; line-height: 1.5; }
.step__instructions strong { color: var(--color-primary); font-weight: 600; }

/* Quand 2 captures se suivent dans la même étape, on les rapproche visuellement */
.step__screenshot + .step__screenshot { margin-top: -6px; }

/* Sous-titres dans les étapes complexes (ex. désinstaller + réinstaller) */
.substep {
  font-family: var(--font-headings);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin: 20px 0 4px;
}
.step__instructions > *:first-child.substep { margin-top: 0; }

/* Note d'aide (ex. chemin différent selon version d'iOS) */
.note {
  font-size: 14px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 4px;
  margin-left: 4px;
}

.step__screenshot {
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
}
.step__screenshot img { max-width: 320px; width: 100%; }
.step__screenshot--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-style: italic;
  padding: 24px;
  text-align: center;
}

.step__tip {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(170, 189, 57, .12);
  border-left: 4px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 15px;
  color: var(--color-primary);
}
.step__tip::before { content: '💡'; flex-shrink: 0; }

.step-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =============================================================
   BOUTONS
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all .15s;
  text-align: center;
  line-height: 1.2;
}
.btn--lg  { padding: 16px 24px; font-size: 16px; min-height: 54px; }
.btn--xl  { padding: 20px 28px; font-size: 18px; min-height: 62px; width: 100%; }

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(68, 161, 170, .28);
}
.btn--primary:hover { background: var(--color-accent-dark); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-primary); background: var(--color-surface); }

.btn--link {
  background: none;
  color: var(--color-text-muted);
  padding: 12px;
  font-size: 15px;
  text-decoration: underline;
  margin-top: 8px;
}
.btn--link:hover { color: var(--color-primary); }

/* Boutons de branche (choix oui/non au sein d'une étape de diagnostic) */
.btn--branch {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-border);
  justify-content: flex-start;
  text-align: left;
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.35;
}
.btn--branch .branch__icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.btn--branch:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--branch--yes:hover { border-color: var(--color-success); background: #f0fdf6; }
.btn--branch--no:hover  { border-color: #dc2626; background: #fef2f2; }

/* =============================================================
   ÉCRAN SUCCÈS / CONTACT / FALLBACK
   ============================================================= */
.success__title, .fallback__title {
  font-family: var(--font-headings);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 14px;
}
.success__subtitle, .fallback__subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  margin: 0 0 28px;
}
.success__subtitle strong, .fallback__subtitle strong { color: var(--color-primary); font-weight: 600; }

.fallback__icon {
  font-size: 56px;
  margin: 8px 0 16px;
}
.fallback__info {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
  margin: 0 0 24px;
  font-size: 15px;
}
.fallback__info p { margin: 0 0 10px; }
.fallback__info ul { margin: 0; padding-left: 22px; color: var(--color-text); }
.fallback__info li { margin-bottom: 6px; line-height: 1.5; }
.fallback__info strong { color: var(--color-primary); font-weight: 600; }

/* =============================================================
   FOOTER
   ============================================================= */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.footer a { color: var(--color-accent-dark); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }

/* =============================================================
   RESPONSIVE — TABLETTE / DESKTOP
   ============================================================= */
@media (min-width: 720px) {
  .app { padding: 48px 24px 60px; }
  .welcome__title { font-size: 36px; }
  .question { font-size: 28px; }
  .topbar { padding: 16px 32px; }
  .card--welcome { padding: 44px 36px; gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .btn, .choice { transition: none; }
}
