/* Copie de core/web/join-flow.css, faite par build-pages.js : modifier l'original, puis regenerer le site. */
/* « Rejoindre une session » — styles partages par app.lobaka.com et www.lobaka.com.
   Les couleurs viennent des jetons de chaque site (memes noms pour l'encre, les lignes et le lime ;
   surface et alerte ont un nom par site, d'ou les replis). Mouvement : ouverture courte, rien en boucle. */
html.jf-locked { overflow: hidden; }
/* L'attribut hidden l'emporte toujours (le site ne le force pas globalement, l'application si). */
.jf-dialog [hidden] { display: none !important; }
.jf-dialog {
  --jf-surface: var(--surface, var(--paper, #fff));
  --jf-surface-2: var(--surface-2, var(--paper-2, #F1F4EA));
  --jf-bad: var(--bad, var(--danger, #B3261E));
  --jf-warn: var(--warn, var(--st-prep, #8A5A00));
  width: min(460px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px);
  margin: auto; padding: 0; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--jf-surface); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .45);
  overflow: auto; overscroll-behavior: contain;
  transition: opacity 180ms var(--ease-out, ease-out), transform 180ms var(--ease-out, ease-out), overlay 180ms allow-discrete, display 180ms allow-discrete;
}
.jf-dialog::backdrop { background: rgba(10, 12, 9, .55); }
@starting-style { .jf-dialog[open] { opacity: 0; transform: scale(.97) translateY(6px); } }
/* Telephone : la fenetre occupe l'ecran et part du haut ; le clavier ne cache ni champ ni bouton. */
@media (max-width: 520px), (max-height: 560px) {
  .jf-dialog { inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; border-radius: 0; }
  @starting-style { .jf-dialog[open] { opacity: 0; transform: translateY(12px); } }
}
@media (prefers-reduced-motion: reduce) {
  .jf-dialog { transition: opacity 120ms ease; }
  @starting-style { .jf-dialog[open] { transform: none; } }
}
.jf-panel { display: grid; gap: 16px; padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.jf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jf-title { margin: 0; padding: 0; font-family: var(--sans); font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; text-transform: none; color: var(--ink); display: block; }
.jf-title::before { display: none; }
.jf-dialog button { font-family: inherit; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.jf-close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--ink-3); cursor: pointer; }

/* Deux facons de rejoindre : segments */
.jf-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--jf-surface-2); }
.jf-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.jf-tab[aria-selected="true"] { background: var(--jf-surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }

.jf-pane { display: grid; gap: 10px; }
.jf-form { display: grid; gap: 8px; margin: 0; }
.jf-label { display: block; margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.jf-row { display: flex; gap: 10px; }
.jf-input {
  flex: 1; min-width: 0; min-height: 52px; margin: 0; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--field, var(--jf-surface)); color: var(--ink);
  font-family: var(--mono); font-size: 18px; letter-spacing: .12em; text-transform: uppercase;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.jf-input::placeholder { color: var(--ink-3); opacity: .7; letter-spacing: .12em; }
.jf-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime-tint); }
.jf-input[aria-invalid="true"] { border-color: var(--jf-bad); }
.jf-primary, .jf-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 20px;
  border-radius: 8px; font-size: 16px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out, ease-out);
}
.jf-primary { border: 1px solid var(--lime); background: var(--lime); color: var(--on-accent, #1D201B); }
.jf-secondary { border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-weight: 500; }
.jf-primary:active, .jf-secondary:active, .jf-tab:active { transform: scale(.97); }
.jf-row .jf-primary { flex: none; min-width: 124px; }
.jf-primary:disabled { opacity: .75; cursor: progress; }
.jf-primary.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: jf-spin 700ms linear infinite; }
@keyframes jf-spin { to { transform: rotate(360deg); } }
.jf-hint { margin: 0; font-size: 14px; color: var(--ink-3); }
.jf-err { margin: 0; font-size: 14px; line-height: 1.45; color: var(--jf-bad); }
.jf-err:empty { display: none; }
.jf-link { display: inline; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; }
.jf-alt { margin: 0; text-align: center; }
.jf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.jf-actions > * { flex: 1 1 180px; }
.jf-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 380px) { .jf-row { flex-direction: column; } .jf-row .jf-primary { width: 100%; } }

/* Scanner : cadre carre, reticule aux quatre coins, aucune animation en boucle */
.jf-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 1; max-height: min(52dvh, 380px); margin: 0 auto; border-radius: 12px; background: #0E100D; }
.jf-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 200ms ease; }
.jf-frame.is-live .jf-video { opacity: 1; }
.jf-reticle { position: absolute; inset: 16%; border-radius: 10px;
  background:
    linear-gradient(var(--lime), var(--lime)) top left / 28px 4px no-repeat,
    linear-gradient(var(--lime), var(--lime)) top left / 4px 28px no-repeat,
    linear-gradient(var(--lime), var(--lime)) top right / 28px 4px no-repeat,
    linear-gradient(var(--lime), var(--lime)) top right / 4px 28px no-repeat,
    linear-gradient(var(--lime), var(--lime)) bottom left / 28px 4px no-repeat,
    linear-gradient(var(--lime), var(--lime)) bottom left / 4px 28px no-repeat,
    linear-gradient(var(--lime), var(--lime)) bottom right / 28px 4px no-repeat,
    linear-gradient(var(--lime), var(--lime)) bottom right / 4px 28px no-repeat;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); }
.jf-frame.is-off .jf-reticle { opacity: .35; box-shadow: none; }
.jf-scan-text { margin: 0; font-size: 15px; text-align: center; color: var(--ink-2); min-height: 1.5em; }

/* Resultat */
.jf-result { display: grid; gap: 8px; outline: none; }
.jf-kicker { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--lime-ink); }
.jf-kicker:empty { display: none; }
.jf-name { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.jf-res-text { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); }
.jf-btnlink { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .jf-close:hover { background: var(--jf-surface-2); color: var(--ink); }
  .jf-tab:hover:not([aria-selected="true"]) { color: var(--ink); }
  .jf-primary:hover:not(:disabled) { background: var(--lime-2); border-color: var(--lime-2); }
  .jf-secondary:hover { border-color: var(--ink-3); background: var(--jf-surface-2); }
  .jf-link:hover { color: var(--ink); text-decoration-color: var(--lime-2); }
}
.jf-dialog :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
