/* TipTupp — identité « Pop » partagée par toutes les pages publiques.
   Jetons, composants (sticker, carte, pastille, stepper, tupp, barre), animations.
   Spec : docs/superpowers/specs/2026-10-27-tiptupp-design-pop.md */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --creme:   #FFFBEE;
  --blanc:   #FFFFFF;
  --noir:    #121212;
  --gris:    #4a4a4a;
  --gris-2:  #8a8a8a;
  --ligne:   #E6E0CC;
  --vert:    #2BD17E;
  --rose:    #FF5C8A;
  --jaune:   #FFD23F;
  --bleu:    #3D7BFF;
  --orange:  #FF8A3D;
  --erreur:  #D7263D;
  --bord:    2.5px;
  --ombre:   6px 6px 0 var(--noir);
  --ombre-s: 3px 3px 0 var(--noir);
  --rayon:   18px;
  --display: 'Unbounded', 'Arial Black', sans-serif;
  --texte:   'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --col:     560px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--texte);
  background: var(--creme);
  color: var(--noir);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; }

/* ── Mise en page ─────────────────────────────────────────────────────── */
.tt-page { max-width: var(--col); margin: 0 auto; padding: 0 20px 150px; }
.tt-page.no-bar { padding-bottom: 60px; }

/* ── En-tête ──────────────────────────────────────────────────────────── */
.tt-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 0; }
.tt-logo { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.04em; text-decoration: none; }
.tt-logo i { font-style: normal; color: var(--rose); }

/* ── Stickers ─────────────────────────────────────────────────────────── */
.tt-sticker {
  display: inline-block;
  font-family: var(--display); font-weight: 700; font-size: 11px; line-height: 1.2;
  background: var(--jaune); color: var(--noir);
  border: var(--bord) solid var(--noir); border-radius: 999px;
  padding: 7px 12px;
  transform: rotate(-5deg);
  box-shadow: var(--ombre-s);
  white-space: nowrap;
}
.tt-sticker.rose   { background: var(--rose); }
.tt-sticker.vert   { background: var(--vert); }
.tt-sticker.bleu   { background: var(--bleu); color: #fff; }
.tt-sticker.orange { background: var(--orange); }
.tt-sticker.blanc  { background: var(--blanc); }
.tt-sticker.droite { transform: rotate(4deg); }
.tt-sticker.plat   { transform: none; }
.tt-sticker.grand  {
  font-size: 40px; font-weight: 800; letter-spacing: -.04em;
  border-width: 3px; border-radius: 18px; padding: 10px 22px;
  transform: rotate(-4deg); box-shadow: 7px 7px 0 var(--noir);
}
.tt-sticker.moyen { font-size: 18px; font-weight: 800; letter-spacing: -.03em; border-radius: 14px; padding: 9px 16px; transform: rotate(-3deg); box-shadow: 4px 4px 0 var(--noir); }

/* ── Hero / titres ────────────────────────────────────────────────────── */
.tt-hero { padding: 26px 0 10px; }
.tt-h1 { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.02; letter-spacing: -.04em; }
.tt-h1 .mark { display: inline-block; background: var(--vert); padding: 0 8px; border-radius: 8px; transform: rotate(-2deg); }
.tt-h1 .mark.rose { background: var(--rose); }
.tt-h1 .mark.jaune { background: var(--jaune); }
.tt-h2 .mark { display: inline-block; background: var(--vert); padding: 0 6px; border-radius: 6px; transform: rotate(-2deg); }
.tt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 380px) { .tt-grid2 { grid-template-columns: 1fr; } }
.tt-h2 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; line-height: 1.15; }
.tt-lead { margin-top: 14px; color: var(--gris); max-width: 34ch; }
.tt-lead b { color: var(--noir); }
.tt-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
.tt-muted { color: var(--gris); font-size: 13.5px; }
.tt-center { text-align: center; }

/* ── Cartes ───────────────────────────────────────────────────────────── */
.tt-card {
  background: var(--blanc);
  border: var(--bord) solid var(--noir); border-radius: 20px;
  box-shadow: var(--ombre);
  padding: 18px 16px 16px;
  position: relative;
}
.tt-card + .tt-card { margin-top: 22px; }
.tt-card.plate { box-shadow: var(--ombre-s); }
.tt-card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* Liste de plats */
.tt-list { display: grid; gap: 22px; padding-top: 16px; }
.tt-plat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.tt-plat .tt-img { width: calc(100% + 32px); margin: -18px -16px 12px; height: 150px; object-fit: cover; border-bottom: var(--bord) solid var(--noir); border-radius: 17px 17px 0 0; }
.tt-plat h3 { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.03em; line-height: 1.15; padding-right: 62px; min-width: 0; overflow-wrap: anywhere; }
.tt-plat p { color: var(--gris); font-size: 13.5px; }
.tt-plat .tt-step { margin-top: 10px; justify-self: start; }

/* Point de couleur devant un nom */
.tt-dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: var(--bord) solid var(--noir); vertical-align: -2px; margin-right: 8px; background: var(--c, var(--jaune)); flex-shrink: 0; }

/* Tag végé */
.tt-tag { display: inline-block; font-family: var(--texte); font-size: 11px; font-weight: 700; background: var(--vert); border: 2px solid var(--noir); border-radius: 6px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; transform: rotate(-3deg); }

/* Kcal par portion (calculées depuis la recette, admin) */
.tt-kcal { justify-self: start; margin-top: 6px; font-family: var(--texte); font-size: 12px; font-weight: 700; background: var(--blanc); border: 2px solid var(--noir); border-radius: 6px; padding: 2px 8px; }
.tt-kcal small { font-size: 11px; font-weight: 500; color: var(--gris); }

/* Pastille de prix */
.tt-badge {
  position: absolute; top: -16px; right: 14px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--c, var(--jaune)); color: var(--ct, var(--noir));
  border: var(--bord) solid var(--noir);
  display: grid; place-items: center; align-content: center;
  font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1;
  transform: rotate(var(--rot, 8deg));
  box-shadow: var(--ombre-s);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.tt-badge small { font-size: 8px; font-weight: 700; margin-top: 2px; }
.tt-plat:hover .tt-badge { transform: rotate(calc(var(--rot, 8deg) * -1)) scale(1.08); }

/* ── Stepper ──────────────────────────────────────────────────────────── */
.tt-step { display: inline-flex; align-items: center; border: var(--bord) solid var(--noir); border-radius: 14px; overflow: hidden; background: var(--blanc); }
.tt-step button { width: 44px; height: 40px; display: grid; place-items: center; font-size: 22px; font-weight: 700; background: var(--noir); color: #fff; transition: transform .08s; }
.tt-step button:active { transform: scale(.9); }
.tt-step button:disabled { background: #9a9a9a; cursor: not-allowed; }
.tt-step output { width: 44px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 16px; }

/* ── Tes tupp (5 boîtes) ──────────────────────────────────────────────── */
.tt-tupp { display: flex; gap: 8px; align-items: center; }
.tt-tupp .lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin-right: 4px; }
.tt-tupp .box { width: 30px; height: 24px; border: var(--bord) solid var(--noir); border-radius: 7px 7px 5px 5px; position: relative; background: var(--blanc); transition: background .2s; }
.tt-tupp .box::before { content: ""; position: absolute; left: -3px; right: -3px; top: -3px; height: 6px; border: var(--bord) solid var(--noir); border-radius: 4px; background: var(--blanc); }
.tt-tupp .box.full { background: var(--c, var(--jaune)); }
.tt-tupp .box.pop  { animation: tt-pop .45s cubic-bezier(.34,1.56,.64,1); }
.tt-tupp.grand .box { width: 44px; height: 34px; border-radius: 10px 10px 7px 7px; }
.tt-tupp.grand .box::before { height: 8px; left: -4px; right: -4px; top: -4px; }
.tt-tupp.grand { gap: 12px; }

/* ── Barre basse ──────────────────────────────────────────────────────── */
.tt-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--blanc); border-top: var(--bord) solid var(--noir); z-index: 20; }
.tt-bar .in { max-width: var(--col); margin: 0 auto; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
.tt-bar .tt-tupp { margin-bottom: 10px; }
.tt-bar .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tt-total { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.tt-total small { display: block; font-family: var(--texte); font-weight: 500; font-size: 12px; color: var(--gris); letter-spacing: 0; }
.tt-total.shake { animation: tt-shake .4s; }

/* ── Boutons ──────────────────────────────────────────────────────────── */
.tt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--rose); color: var(--noir);
  border: var(--bord) solid var(--noir); border-radius: 14px;
  padding: 12px 20px;
  font-family: var(--display); font-weight: 700; font-size: 14px;
  box-shadow: 4px 4px 0 var(--noir);
  text-decoration: none;
  transition: transform .1s, box-shadow .1s;
  white-space: nowrap;
}
.tt-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--noir); }
.tt-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--noir); }
.tt-btn:disabled { background: #e8e4d6; color: #9a9a9a; box-shadow: none; transform: none; cursor: not-allowed; }
.tt-btn.jaune { background: var(--jaune); }
.tt-btn.vert  { background: var(--vert); }
.tt-btn.blanc { background: var(--blanc); }
.tt-btn.noir  { background: var(--noir); color: #fff; }
.tt-btn.large { width: 100%; padding: 15px 20px; font-size: 15px; }
.tt-link { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.tt-back { display: inline-block; margin-top: 16px; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--noir); }

/* ── Formulaires ──────────────────────────────────────────────────────── */
.tt-field { margin-bottom: 14px; }
.tt-field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.tt-field label i { font-style: normal; color: var(--rose); }
.tt-input {
  width: 100%; height: 48px; padding: 0 14px;
  font: inherit; font-size: 15px;
  background: var(--blanc); color: var(--noir);
  border: var(--bord) solid var(--noir); border-radius: 12px;
  transition: box-shadow .12s, transform .12s;
}
textarea.tt-input { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.tt-restant { margin-top: 14px; font-size: 14px; font-weight: 600; }
.tt-restant .tt-sticker { margin-right: 6px; vertical-align: -2px; }
.tt-input:focus { outline: none; box-shadow: var(--ombre-s); transform: translate(-1px, -1px); }
.tt-input.invalid { border-color: var(--erreur); }
.tt-hint { font-size: 12px; color: var(--gris); margin-top: 5px; }
.tt-err { display: none; font-size: 12px; font-weight: 700; color: var(--erreur); margin-top: 5px; }
.tt-err.show { display: block; }
.tt-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; margin: 6px 0 18px; }
.tt-check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--noir); flex-shrink: 0; }
.tt-combo { display: flex; border: var(--bord) solid var(--noir); border-radius: 14px; overflow: hidden; background: var(--blanc); box-shadow: 4px 4px 0 var(--noir); }
.tt-combo input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; font: inherit; font-size: 15px; border: 0; background: transparent; }
.tt-combo input:focus { outline: none; }
.tt-combo button { background: var(--jaune); padding: 0 16px; border-left: var(--bord) solid var(--noir); font-family: var(--display); font-weight: 700; font-size: 12px; white-space: nowrap; }

/* ── Récap de commande ────────────────────────────────────────────────── */
.tt-lines { display: grid; }
.tt-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px dashed var(--ligne); }
.tt-line:last-child { border-bottom: 0; }
.tt-line .nom { flex: 1; min-width: 0; font-weight: 700; }
.tt-line .nom small { display: block; font-weight: 400; color: var(--gris); font-size: 12.5px; }
.tt-line .prix { font-family: var(--display); font-weight: 800; font-size: 14px; white-space: nowrap; }
.tt-sum { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: var(--bord) solid var(--noir); }
.tt-sum .lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* ── Sticker d'état (succès / erreur) ─────────────────────────────────── */
.tt-state { text-align: center; padding: 28px 0 10px; }
.tt-state .tt-sticker { margin-bottom: 26px; }
.tt-state h1 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; line-height: 1.15; }
.tt-state p { margin-top: 10px; color: var(--gris); }
.tt-ref { display: inline-block; margin-top: 14px; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .04em; background: var(--blanc); border: var(--bord) solid var(--noir); border-radius: 12px; padding: 8px 14px; box-shadow: var(--ombre-s); text-decoration: none; }

/* Infos clé/valeur */
.tt-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.tt-kv .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); }
.tt-kv .v { font-weight: 600; overflow-wrap: anywhere; }
.tt-kv .wide { grid-column: 1 / -1; }

/* Overlay d'envoi */
.tt-overlay { position: fixed; inset: 0; background: rgba(255,251,238,.9); display: none; place-items: center; z-index: 50; font-family: var(--display); font-weight: 700; }
.tt-overlay.show { display: grid; }
.tt-overlay .tt-sticker { font-size: 16px; animation: tt-wobble 1s ease-in-out infinite; }

/* Toast */
.tt-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--noir); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 60; display: none; }
.tt-toast.show { display: block; animation: tt-rise .3s; }

/* ── Animations ───────────────────────────────────────────────────────── */
@keyframes tt-pop    { 0% { transform: scale(.6) rotate(-8deg); } 60% { transform: scale(1.25) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes tt-shake  { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-4px) rotate(-1deg); } 40% { transform: translateX(4px) rotate(1deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes tt-rise   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tt-drop   { 0% { opacity: 0; transform: translateY(-60px) rotate(-14deg) scale(1.1); } 70% { transform: translateY(6px) rotate(-3deg); } 100% { opacity: 1; transform: translateY(0) rotate(-4deg); } }
@keyframes tt-wobble { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes tt-sweep  { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

.tt-rise { animation: tt-rise .5s both; }
.tt-list > * { animation: tt-rise .5s both; }
.tt-list > *:nth-child(1) { animation-delay: .05s; }
.tt-list > *:nth-child(2) { animation-delay: .12s; }
.tt-list > *:nth-child(3) { animation-delay: .19s; }
.tt-list > *:nth-child(4) { animation-delay: .26s; }
.tt-list > *:nth-child(5) { animation-delay: .33s; }
.tt-list > *:nth-child(n+6) { animation-delay: .4s; }
.tt-sticker.drop { animation: tt-drop .7s cubic-bezier(.34,1.3,.64,1) both; }
.tt-sticker.grand.drop { animation-name: tt-drop; }
.tt-h1 .mark.sweep { background-image: linear-gradient(var(--vert), var(--vert)); background-color: transparent; background-repeat: no-repeat; background-position: 0 0; animation: tt-sweep .6s .3s both; }

/* ── Petits écrans ────────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .tt-h1 { font-size: 26px; }
  .tt-kv { grid-template-columns: 1fr; }
  .tt-sticker.grand { font-size: 32px; }
}
