/* ============================================================
   QUESTION.MA — Système de design
   Concept : le tableau noir et le stylo rouge — l'expérience
              d'un examen corrigé sur-le-champ, pas un badge SaaS.
   Palette : Tableau (vert ardoise), Stylo Rouge, Craie, Encre Douce
   Typo     : Bricolage Grotesque (une seule famille, 2 graisses)
              + JetBrains Mono pour les données (scores, chrono, codes)
   Signature: "La Coche" — la coche au stylo rouge qui corrige une copie.
   ============================================================ */

@font-face { font-family: 'Bricolage'; src: url('fonts/BricolageGrotesque-Regular.ttf'); font-weight: 400; }
@font-face { font-family: 'Bricolage'; src: url('fonts/BricolageGrotesque-Bold.ttf'); font-weight: 700; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono-Regular.ttf'); font-weight: 400; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono-Bold.ttf'); font-weight: 700; }

:root {
  --ink:        #1B3A2F; /* Tableau — vert ardoise profond */
  --ink-soft:   #24493B; /* Tableau, variante légèrement plus claire */
  --coral:      #D64550; /* Stylo Rouge — action, prime, correction */
  --coral-deep: #B93544; /* Stylo Rouge, survol/pressé */
  --mint:       #3F7A5D; /* Vert tableau clair — gratuit / débloqué */
  --amber:      #C9954B; /* Craie ocre — en attente */
  --paper:      #F5F1E3; /* Craie — fond clair */
  --ink-mute:   #8B9A91; /* Encre douce — texte secondaire */
  --white:      #FFFFFF;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 4px 20px rgba(27,58,47,0.10);
}

* { box-sizing: border-box; }

body {
  font-family: 'Bricolage', Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Colle le pied de page en bas de l'écran même quand le contenu est court,
   au lieu de laisser un espace vide (fond de page) apparaître en dessous. */
.site-footer { margin-top: auto; }

a { color: var(--coral-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

/* ---------- Layout shells ---------- */

.shell { max-width: 640px; margin: 0 auto; padding: 0 20px 60px; }
.shell-wide { max-width: 820px; }
.shell-narrow { max-width: 420px; }

.ink-hero {
  background: var(--ink);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.app-header {
  background: var(--ink);
  color: var(--white);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.app-header nav {
  font-size: 14px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.app-header nav a { color: var(--white); text-decoration: none; }
.app-header nav a:hover { color: var(--coral); }
.app-body { padding: 32px 20px 60px; max-width: 640px; margin: 0 auto; }
.app-body.wide { max-width: 820px; }

/* ---------- Wordmark & signature tick ---------- */

.wordmark {
  font-family: 'Bricolage', sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
}
a.wordmark { color: inherit !important; text-decoration: none !important; }
.wordmark-hero { font-size: clamp(30px, 9vw, 52px); }
.wordmark-md { font-size: clamp(26px, 8vw, 44px); }
.wordmark-sm { font-size: clamp(22px, 7vw, 36px); }
.tick { display: inline-block; line-height: 0; }
.tick-svg { display: block; width: 100%; height: 100%; }
.tick-xs { width: 16px; height: 16px; }
.tick-sm { width: 22px; height: 22px; }
.tick-md { width: 34px; height: 34px; }
.tick-lg { width: 56px; height: 56px; }

.brand-lockup { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-lockup .wordmark { font-size: 44px; }

/* ---------- Typography helpers ---------- */

h1, h2, h3 { font-weight: 700; letter-spacing: -0.3px; margin: 0 0 8px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.mono { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--ink-mute); }
.big-score {
  font-family: 'Bricolage', sans-serif;
  font-weight: 700;
  font-size: 72px;
  color: var(--coral);
  line-height: 1;
  letter-spacing: -1px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.card-dark {
  background: var(--ink-soft);
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--coral);
  color: var(--white);
  border: none;
  padding: 13px 26px;
  border-radius: 10px;
  font-family: 'Bricolage', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--coral-deep); }
.btn:active { transform: scale(0.98); }
.btn-block { display: block; width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------- Forms ---------- */

label { display: block; margin: 14px 0 6px; font-weight: 700; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=file], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #E3DFCF;
  border-radius: var(--radius-sm);
  font-family: 'Bricolage', sans-serif;
  font-size: 15px;
  background: var(--white);
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { border-color: var(--coral); outline: none; }

/* ---------- Badges & status ---------- */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}
.badge-free { background: var(--mint); color: var(--white); }
.badge-locked { background: #C7C2AF; color: var(--ink); }
.badge-premium { background: var(--coral); color: var(--white); }
.badge-pending { background: var(--amber); color: var(--white); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #FBEAEA; color: #A8323D; }
.alert-success { background: #E7F0EA; color: #2C5240; }

/* ---------- Tables (admin) ---------- */

table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #E9E4D5; }
th { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-mute); }

/* ---------- Utility ---------- */

.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.divider { height: 3px; width: 60px; background: var(--coral); border-radius: 2px; margin: 20px auto; border: none; }

/* ---------- Share modal ---------- */

.share-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(27,58,47,0.55);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.share-overlay.open { display: flex; }
.share-sheet {
  background: var(--white);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px 32px;
  animation: share-slide-up 0.2s ease-out;
}
@media (min-width: 480px) {
  .share-overlay { align-items: center; }
  .share-sheet { border-radius: var(--radius); }
}
@keyframes share-slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.share-sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.share-sheet-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink-mute); line-height: 1; }
.share-options { display: flex; justify-content: space-between; gap: 10px; }
.share-option { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.share-option-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: white;
}
.share-option span { font-size: 12px; font-weight: 600; }
.share-btn-trigger { display: inline-flex; align-items: center; gap: 8px; }