/* Ki Ka Raison ? — l'entrée de l'app : connexion, inscription, code reçu par e-mail, nouveau mot de passe. Une affiche en aplat et le formulaire à côté, dans l'univers de la landing (assets/landing.css). */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: italic; font-weight: 200 800; font-display: swap; src: url('fonts/plus-jakarta-sans-latin-wght-italic.woff2') format('woff2'); }

/* Le code et le mot de passe arrivent dans un <main class="page"> : l'affiche va jusqu'aux bords. */
.page:has(> .gate) { max-width: none; padding: 0; gap: 0; }

:root { --pink: #f6a6cf; --note: #bf421d; }
.gate {
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh;
  background: var(--cream); color: var(--ink); font-size: 17px; overflow-x: clip;
}
/* Une couleur par moment, comme les sections de la landing. Ces teintes servent aussi aux en-têtes des écrans de l'app (assets/pop.css). */
.t-lime { --bg: var(--lime); --fg: var(--ink); --line-c: var(--ink); --m: var(--ink); --m-fg: var(--lime); --r1: var(--ink); --r1-fg: var(--lime); --r2: var(--peri); --r2-fg: var(--ink); }
.t-ink { --bg: var(--ink); --fg: var(--cream); --line-c: var(--lime); --m: var(--lime); --m-fg: var(--ink); --r1: var(--lime); --r1-fg: var(--ink); --r2: var(--peri); --r2-fg: var(--ink); }
.t-peri { --bg: var(--peri); --fg: var(--ink); --line-c: var(--ink); --m: var(--lime); --m-fg: var(--ink); --r1: var(--lime); --r1-fg: var(--ink); --r2: var(--ink); --r2-fg: var(--cream); }
.t-lav { --bg: var(--lav); --fg: var(--ink); --line-c: var(--ink); --m: var(--lime); --m-fg: var(--ink); --r1: var(--ink); --r1-fg: var(--cream); --r2: var(--lime); --r2-fg: var(--ink); }
.t-pink { --bg: var(--pink); --fg: var(--ink); --line-c: var(--ink); --m: var(--lime); --m-fg: var(--ink); --r1: var(--ink); --r1-fg: var(--cream); --r2: var(--lime); --r2-fg: var(--ink); }

/* Affiche */
.gate-poster { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--bg); color: var(--fg); }
.gate-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: max(12px, env(safe-area-inset-top, 0px)) 20px 0 var(--gutter); }
.gate-brand { display: inline-flex; align-items: center; gap: 9px; flex: none; font-weight: 800; font-size: 18px; letter-spacing: -.03em; text-decoration: none; }
.gate-tag { padding: 4px 10px; border-radius: 8px; background: var(--m); color: var(--m-fg); font-size: 13px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; transform: rotate(-1.5deg); }
.gate-kika { display: inline-block; flex: none; width: 30px; aspect-ratio: 120 / 140; }
.gate-kika svg { display: block; width: 100%; height: auto; }
/* La moitié citron de Kika se perdrait sur le citron, sa moitié pervenche sur la pervenche : elle passe sur une pastille. */
.t-lime .gate-kika, .t-peri .gate-kika { display: inline-grid; place-items: center; aspect-ratio: 1; width: 38px; border-radius: 50%; background: var(--cream); }
.t-lime .gate-kika svg, .t-peri .gate-kika svg { width: 70%; }
.gate-tl { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; min-width: 0; margin-top: 10px; padding: 18px 20px 20px var(--gutter); }
.gate-tl::before { content: ''; position: absolute; left: calc(var(--gutter) + 5px); top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--line-c); opacity: .9; }
.gate-tl > * { margin-left: 26px; }
.gate-stamp { position: relative; align-self: flex-start; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; padding: 6px 14px; border-radius: 99px; background: var(--ink); color: var(--cream); font-size: 14px; font-weight: 600; }
.gate-stamp b { font-weight: 800; color: var(--lime); }
.gate-stamp::before { content: ''; position: absolute; left: -27px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; border-radius: 50%; background: var(--lime); border: 3px solid var(--ink); }
.t-ink .gate-poster .gate-stamp { background: var(--cream); color: var(--ink); }
.t-ink .gate-poster .gate-stamp b { color: var(--ink); }
.t-ink .gate-poster .gate-stamp::before { background: var(--ink); border-color: var(--cream); }
.gate h1 { font-size: clamp(44px, 12.6vw, 72px); font-weight: 800; letter-spacing: -.045em; line-height: 1.12; overflow-wrap: anywhere; text-wrap: balance; }
/* En bloc, le surlignage garde les jambages et ne mord pas sur ses propres lignes, même avec un long nom de bande sur l'encre. */
.gate mark, .pop mark { display: inline-block; padding: 0 .14em .07em; background: linear-gradient(transparent .09em, var(--m) .09em); color: var(--m-fg); }
.gate h1 s { text-decoration: line-through var(--brick) .1em; }
.gate-lead { max-width: 34em; font-size: clamp(17px, 2vw, 20px); font-weight: 500; line-height: 1.5; opacity: .9; }
.gate-lead b { font-weight: 800; overflow-wrap: anywhere; }
.gate-fine { color: var(--grey-2); font-size: 14px; text-align: center; }
.gate-done { padding: 18px; border-radius: 18px; background: var(--lime); text-align: center; }
.gate-done b { display: block; font-size: 20px; font-weight: 800; }
.gate-says { display: flex; align-items: flex-end; gap: 6px; }
.gate-says .gate-kika { width: 54px; }
.t-lime .gate-says .gate-kika, .t-peri .gate-says .gate-kika { width: 62px; }
.gate-says p { max-width: 230px; margin-bottom: 18px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 16px 16px 16px 4px; background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.t-ink .gate-says p { border-color: var(--paper); }

/* Rubans */
.gate-ribbons { position: relative; flex: none; height: 104px; overflow: hidden; background: linear-gradient(var(--bg) 50%, var(--cream) 50%); pointer-events: none; }
.gate-ribbon { position: absolute; left: -6%; width: 112%; padding: 8px 0; overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--r1); color: var(--r1-fg); top: 14px; transform: rotate(-1.6deg); }
.gate-ribbon.two { top: 54px; background: var(--r2); color: var(--r2-fg); transform: rotate(1.3deg); }
.gate-track { display: inline-flex; width: max-content; animation: gate-slide 46s linear infinite; }
.gate-ribbon.two .gate-track { animation-direction: reverse; }
.gate-track span { padding-inline: 18px; }
.gate-track span::after { content: '✦'; margin-left: 36px; opacity: .6; }
@keyframes gate-slide { to { transform: translateX(-50%); } }

/* Formulaire */
.gate-main { display: flex; flex-direction: column; min-width: 0; padding: 22px 20px max(28px, env(safe-area-inset-bottom, 0px)) var(--gutter); }
.gate-in { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 480px; margin-inline: auto; }
.gate-form { display: flex; flex-direction: column; gap: 16px; }
.gate-main label, .gate-main .field-l { gap: 8px; color: var(--ink); font-size: 14px; font-weight: 700; }
.gate-main input:not([type=checkbox]):not([type=radio]) { min-height: 56px; padding: 14px 18px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); color: var(--ink); font: 600 17px var(--f); }
.gate-main input::placeholder { color: var(--grey); font-weight: 500; opacity: 1; }
.gate-main input:not([type=checkbox]):not([type=radio]):focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--lime); }
.gate-code input:not([type=checkbox]):not([type=radio]) { min-height: 76px; text-align: center; font: 800 36px var(--f); letter-spacing: .22em; padding-left: calc(18px + .22em); font-variant-numeric: tabular-nums; }
.gate-code input::placeholder { color: var(--line-2); font-weight: 800; }

.gate .btn { min-height: 56px; padding: 8px 8px 8px 24px; font: 700 17px var(--f); gap: 14px; }
.gate .btn .go { width: 40px; height: 40px; }
.gate .btn .go svg { width: 20px; height: 20px; }
.gate .btn.line { box-shadow: inset 0 0 0 2px var(--ink); padding: 8px 20px; min-height: 48px; font-size: 15px; }
.gate-link { align-self: center; padding: 0; border: 0; background: none; color: var(--ink); font: 700 15px var(--f); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.gate-seg { display: flex; gap: 2px; padding: 4px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); }
.gate-seg button { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 99px; background: none; color: var(--ink); font: 700 16px var(--f); cursor: pointer; }
.gate-seg button.on { background: var(--lime); }
.gate-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 4px; }
.gate-foot .legal-links { font-size: 13px; color: var(--grey-2); text-align: center; }
.gate-sub { color: var(--grey-2); font-size: 15px; text-align: center; }
.gate-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* Google et Apple : leurs boutons à leurs couleurs, comme ils le demandent, puis « ou avec ton e-mail » */
.gate-social { display: flex; flex-direction: column; gap: 10px; }
.gate .btn.social { width: 100%; justify-content: center; padding: 8px 20px; min-height: 52px; font-size: 16px; }
.gate .btn.social.google { background: #FFFFFF; color: #1F1F1F; box-shadow: inset 0 0 0 1px #747775; }
.gate .btn.social.apple { background: #000000; color: #FFFFFF; }
.gate-or-line { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 13.5px; font-weight: 700; }
.gate-or-line::before, .gate-or-line::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: currentColor; opacity: .2; }
.gate-or { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 2px solid var(--ink); }
.gate-inline { display: flex; align-items: center; gap: 8px; }
.gate-inline input { flex: 1; min-width: 0; }
.gate .fold-in { gap: 12px; border-top: 2px solid var(--ink); }
.gate .fold-in > summary { color: var(--ink); font-size: 15px; font-weight: 800; }

/* L'inscription se déroule le long de sa ligne de temps. */
.gate-steps { position: relative; display: flex; flex-direction: column; gap: 30px; padding-left: 26px; }
.gate-steps::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 28px; width: 3px; border-radius: 2px; background: var(--ink); opacity: .9; }
.gate-step { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gate-note { display: flex; align-items: center; gap: 8px; color: var(--note); font-size: 15px; font-style: italic; font-weight: 700; line-height: 1.25; }
.gate-note svg { flex: none; width: 34px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Les prénoms de la bande, en autocollants */
.gate .chips.wrap { gap: 8px; }
.gate .chip { padding: 8px 14px 8px 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); font: 800 15px var(--f); letter-spacing: -.01em; transition: transform .15s; }
.gate .chip:nth-child(odd) { transform: rotate(-1.5deg); }
.gate .chip:nth-child(even) { transform: rotate(1.2deg); }
.gate .chip:hover { transform: rotate(0deg) scale(1.03); }
.gate .chip.on { background: var(--lime); border-color: var(--ink); }
.gate .note.lime { background: var(--lime); color: var(--ink); font-weight: 700; font-size: 15px; border-radius: 16px; }

/* Le personnage, scotché comme les téléphones de la landing */
.gate .creator { gap: 18px; padding: 18px; border-radius: 28px; background: var(--paper); box-shadow: 0 30px 50px -36px rgba(29, 29, 31, .55); }
.gate .cr-preview { position: relative; gap: 14px; padding-top: 6px; }
.gate .cr-preview::before { content: ''; position: absolute; z-index: 1; top: -5px; left: 50%; width: 62px; height: 20px; margin-left: -31px; border-radius: 3px; background: var(--lime); opacity: .92; transform: rotate(-3deg); }
.gate .cr-ava { --s: 124px !important; border: 5px solid var(--ink); transform: rotate(-3deg); box-sizing: content-box; }
.gate .cr-fields { gap: 12px; }
.gate .cr-fields .field-l { font-size: 13px; }
.gate .stc span { padding: 5px 2px 4px; background: var(--cream); border: 2px solid transparent; }
.gate .stc input:checked + span { background: var(--lime); border-color: var(--ink); }
.gate .stc small { color: var(--ink); font-size: 10px; }
.gate .swatch-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.gate .swc span { width: 100%; max-width: 28px; height: auto; aspect-ratio: 1; }
.gate .swc input:checked + span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4.5px var(--ink); }

/* La case des conditions : citron une fois cochée */
.gate .check.terms { align-items: flex-start; gap: 12px; font-size: 14px; font-weight: 500; line-height: 1.45; }
.gate .check.terms input { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper) center / 16px no-repeat; cursor: pointer; }
.gate .check.terms input:checked { background-color: var(--lime); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }

@media (min-width: 620px) {
  .gate-tl { padding-right: 40px; }
  .gate-main { padding-top: 34px; padding-bottom: 44px; }
}
/* Sur ordi, l'affiche reste en place pendant que le formulaire défile. */
@media (min-width: 920px) {
  .gate { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
  .gate-poster { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow: hidden; }
  .gate-top { margin: 22px 32px 0; }
  .gate-tl { gap: 24px; padding: 28px 44px 28px 32px; }
  .gate-tl::before { left: 37px; }
  .gate-tl > * { margin-left: 44px; }
  .gate-tl .gate-stamp::before { left: -45px; }
  .gate h1 { font-size: clamp(48px, min(5.7vw, 11vh), 92px); }
  .gate-says .gate-kika { width: 74px; }
  .t-lime .gate-says .gate-kika, .t-peri .gate-says .gate-kika { width: 92px; }
  .gate-ribbons { background: var(--bg); }
  .gate-main { justify-content: center; padding: 48px clamp(28px, 5vw, 72px); }
}
@media (max-height: 700px) and (min-width: 920px) { .gate-says { display: none; } }
/* Sur téléphone et tablette, l'affiche est un en-tête : il reste court, pour que le formulaire tienne sur l'écran. */
@media (max-width: 919px) {
  .gate-tl { gap: 6px; margin-top: 0; padding: 20px 20px 12px var(--gutter); }
  .gate { grid-template-rows: auto 1fr; }
  .gate-tl::before, .gate-tl .gate-stamp, .gate-tl .gate-says { display: none; }
  .gate-tl > * { margin-left: 0; }
  .gate h1 { font-size: clamp(36px, 10.6vw, 56px); line-height: 1.08; }
  .gate-lead { font-size: 15.5px; line-height: 1.4; }
  .gate-ribbons { height: 42px; }
  .gate-ribbon { top: 6px; padding: 6px 0; font-size: 12px; }
  .gate-ribbon.two { display: none; }
  .gate-main { padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .gate-in { gap: 14px; }
  .gate-form { gap: 12px; }
  .gate-main label, .gate-main .field-l { gap: 6px; }
  .gate-main input:not([type=checkbox]):not([type=radio]) { min-height: 50px; padding: 11px 16px; }
  .gate-code input:not([type=checkbox]):not([type=radio]) { min-height: 64px; }
  .gate-seg button { min-height: 38px; padding: 6px 10px; }
  .gate .btn { min-height: 52px; padding: 6px 6px 6px 22px; }
  .gate .btn.line { min-height: 44px; padding: 6px 18px; }
  .gate-foot { gap: 8px; padding-top: 0; }
}
@media (max-width: 619px) { .t-peri h1 { font-size: clamp(32px, 9.4vw, 50px); } }
@media (max-width: 340px) { .gate-tag { display: none; } }
/* Sur un petit téléphone, le formulaire d'abord. */
@media (max-width: 919px) and (max-height: 620px) { .t-ink .gate-ribbons, .t-ink .gate-lead { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .gate-track { animation: none; }
  .gate .chip { transition: none; }
}

/* Dans l'app, après l'arrivée dans une bande : la barre de navigation est là */
body:has(.tabbar) .gate-main { padding-bottom: 112px; }
@media (min-width: 900px) {
  body:has(.deskbar) .gate-main { padding-bottom: 48px; }
  body:has(.deskbar) .gate-top { display: none; }
  body:has(.deskbar) .gate-poster { top: 62px; height: calc(100vh - 62px); }
}
.gate .how li { background: var(--paper); font-size: 15px; }
