/*
 * CJump Forms — zentrale Form-States + Satisfying Clicks
 * Verbindlich für jedes User-facing Formular auf cjump.training.
 * Spezifikation: .claude/rules/forms.md
 *
 * Brand-Tokens stammen aus Content/brand/brand_guidelines.html.
 * NICHT inline überschreiben - bei Brand-Änderungen hier zentral aktualisieren.
 */

:root {
  --cj-blue:        #1A8CFF;
  --cj-blue-dark:   #0D6DD6;
  --cj-anthrazit:   #262626;
  --cj-success:     #059669; /* Single Source: cjump_tokens.css --cj-success (Gruen-Konvention 23.06.) */
  --cj-on-success:  #0A1004; /* Text/Icon AUF gruenem Grund immer dunkel, nie weiss. Nachgezogen 05.09.2026 mit dem tieferen Gruen - #14210A kam dagegen nur noch auf 4,45:1. */
  --cj-success-soft:rgba(5, 150, 105,0.18);
  --cj-error:       #EB4E4E;
  --cj-error-soft:  rgba(235,78,78,0.18);
  --cj-border:      #E5E7EB;
  --cj-border-dark: #2A2A2A;
  --cj-radius:      8px;
  --cj-radius-sm:   6px;

  --cj-t-fast:      120ms;
  --cj-t-press:     60ms;
  --cj-t-confirm:   240ms;
  --cj-t-state:     300ms;
}

/* ===================================================
 * INPUT WRAPPER + STATES
 * Markup-Konvention:
 *   <div class="cj-field">
 *     <label>Label-Text</label>
 *     <div class="cj-input-wrap">
 *       <input class="cj-input" data-validate="email" />
 *     </div>
 *     <div class="cj-fieldmsg" aria-live="polite"></div>
 *   </div>
 * =================================================== */

.cj-field {
  margin-bottom: 18px;
}

.cj-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.cj-input-wrap {
  position: relative;
}

.cj-input,
.cj-input-wrap input,
.cj-input-wrap select,
.cj-input-wrap textarea {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: 1.5px solid var(--cj-border);
  border-radius: var(--cj-radius);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--cj-anthrazit);
  box-sizing: border-box;
  transition:
    border-color var(--cj-t-fast) ease,
    box-shadow var(--cj-t-fast) ease;
}

.cj-input-wrap textarea { padding-right: 14px; resize: vertical; min-height: 80px; }
.cj-input-wrap select { padding-right: 44px; }

.cj-input-wrap input:focus,
.cj-input-wrap select:focus,
.cj-input-wrap textarea:focus {
  outline: none;
  border-color: var(--cj-blue);
  box-shadow: 0 0 0 3px rgba(26,140,255,0.18);
}

/* Dunkel-Input-Standard (Baukasten, Carlo-Wahl 24.07.): EIN dunkler Input fuer die App.
   .cj-input (oben) ist hell = nur Landingpage. Auf dunklen Panels/Cards/Sheets diesen Standard:
   - wrapped (mit .cj-input-wrap):  <div class="cj-input-wrap is-dark"><input class="cj-input" ...>
   - standalone (ohne wrap):        <input class="cj-input--dark" ...>
   is-valid/is-invalid-Glow (unten) erbt weiter -> Live-Validation bleibt auf dunkel intakt. */
.cj-input--dark,
.cj-input-wrap.is-dark input,
.cj-input-wrap.is-dark select,
.cj-input-wrap.is-dark textarea {
  background: rgba(255,255,255,0.045);
  border: 1.5px solid rgba(255,255,255,0.10);
  color: var(--cj-white);
  /* Geometrie gehoert HIERHER (25.07., nach dem x-ten Drift). Vorher war --dark ein reiner
     Farb-Modifier ohne Radius/Padding - jeder Screen musste die Form selbst nachbauen und
     baute sie minimal anders. Ein halber Baustein erzeugt zwangslaeufig N Varianten; das war
     die Ursache, nicht fehlende Disziplin. Wer eine Ausnahme braucht, ueberschreibt bewusst
     eine einzelne Eigenschaft - er faengt nicht bei null an. */
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: var(--cj-r-input, 12px);
  font-family: var(--cj-font-body);
  font-size: 14px;
  line-height: 1.5;
}
/* Mehrzeilig: sinnvolle Grundhoehe + nur vertikal ziehbar (horizontal wuerde das Layout sprengen). */
textarea.cj-input--dark,
.cj-input-wrap.is-dark textarea { min-height: 96px; resize: vertical; }
.cj-input--dark::placeholder,
.cj-input-wrap.is-dark input::placeholder,
.cj-input-wrap.is-dark textarea::placeholder { color: var(--cj-white-30); }
.cj-input--dark:focus,
.cj-input-wrap.is-dark input:focus,
.cj-input-wrap.is-dark select:focus,
.cj-input-wrap.is-dark textarea:focus {
  outline: none;
  border-color: var(--cj-electric);
  box-shadow: 0 0 0 3px rgba(26,140,255,0.18);
}

/* Valid state — Carlo-Direktive 15.05.: praesenter, immer mit Glow, nicht erst bei focus. */
.cj-input-wrap.is-valid input,
.cj-input-wrap.is-valid select,
.cj-input-wrap.is-valid textarea {
  border-color: var(--cj-success);
  box-shadow: 0 0 0 3px var(--cj-success-soft), 0 0 16px rgba(5, 150, 105,0.18);
}
.cj-input-wrap.is-valid input:focus,
.cj-input-wrap.is-valid select:focus,
.cj-input-wrap.is-valid textarea:focus {
  box-shadow: 0 0 0 4px var(--cj-success-soft), 0 0 24px rgba(5, 150, 105,0.28);
}

/* Invalid state - erst nach erstem Blur sichtbar */
.cj-input-wrap.is-invalid input,
.cj-input-wrap.is-invalid select,
.cj-input-wrap.is-invalid textarea {
  border-color: var(--cj-error);
}
.cj-input-wrap.is-invalid input:focus,
.cj-input-wrap.is-invalid select:focus,
.cj-input-wrap.is-invalid textarea:focus {
  box-shadow: 0 0 0 3px var(--cj-error-soft);
}

/* Status-Icon (✓ oder ✕) am rechten Rand */
.cj-input-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition:
    opacity var(--cj-t-kurz, 160ms) ease,
    transform var(--cj-t-kurz, 160ms) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cj-input-wrap.is-valid::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310B981'><path d='M16.7 5.3a1 1 0 010 1.4l-8 8a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4L8 12.6l7.3-7.3a1 1 0 011.4 0z'/></svg>");
}
.cj-input-wrap.is-invalid::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23EB4E4E'><path d='M14.3 5.7a1 1 0 010 1.4L11.4 10l2.9 2.9a1 1 0 11-1.4 1.4L10 11.4l-2.9 2.9a1 1 0 01-1.4-1.4L8.6 10 5.7 7.1a1 1 0 011.4-1.4L10 8.6l2.9-2.9a1 1 0 011.4 0z'/></svg>");
}

/* Feldmeldung unter dem Eingabefeld (slide-down).
 * Hiess bis 27.07. .cj-confirm - denselben Namen traegt im Chat ein Vollbild-Dialog
 * (cj_chat_screen.css) mit display:none. Beide werden in der App-Huelle global geladen,
 * also gewann der Dialog: die Rueckmeldung im Code-Sheet war unsichtbar (gemessen Hoehe 0).
 * Ein Name, eine Rolle - deshalb heisst die Feldmeldung jetzt .cj-fieldmsg. */
.cj-fieldmsg {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--cj-success);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height var(--cj-t-confirm) ease,
    opacity var(--cj-t-confirm) ease,
    transform var(--cj-t-confirm) ease;
}
.cj-fieldmsg.is-shown {
  max-height: 32px;
  opacity: 1;
  transform: translateY(0);
}
.cj-fieldmsg.is-error {
  color: var(--cj-error);
}

/* ===================================================
 * CHECKBOX + RADIO
 * Markup:
 *   <label class="cj-checkbox">
 *     <input type="checkbox" data-validate="checkbox-required">
 *     <span class="cj-checkbox-box"></span>
 *     <span class="cj-checkbox-text">Text</span>
 *   </label>
 * =================================================== */

.cj-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  border: 1.5px solid var(--cj-border);
  border-radius: var(--cj-radius);
  margin-bottom: 8px;
  transition: border-color var(--cj-t-fast), background var(--cj-t-fast);
}
.cj-checkbox:hover { border-color: var(--cj-blue); }
.cj-checkbox input[type="checkbox"],
.cj-checkbox input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.cj-checkbox-box {
  flex: 0 0 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--cj-border);
  border-radius: 4px;
  background: #fff;
  position: relative;
  pointer-events: none;
  transition: all var(--cj-t-fast);
}
.cj-checkbox-box::after {
  content: '';
  position: absolute;
  inset: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%230A1004'><path d='M16.7 5.3a1 1 0 010 1.4l-8 8a1 1 0 01-1.4 0l-4-4a1 1 0 011.4-1.4L8 12.6l7.3-7.3a1 1 0 011.4 0z'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--cj-t-kurz, 160ms), transform var(--cj-t-mittel, 280ms) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cj-checkbox input:checked ~ .cj-checkbox-box {
  background: var(--cj-success);
  border-color: var(--cj-success);
}
.cj-checkbox input:checked ~ .cj-checkbox-box::after {
  opacity: 1;
  transform: scale(1);
}
.cj-checkbox input:checked ~ .cj-checkbox-text {
  color: var(--cj-anthrazit);
}
.cj-checkbox.is-invalid {
  border-color: var(--cj-error);
}

.cj-checkbox-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--cj-anthrazit);
  /* Kein Wort allein in der letzten Zeile (Carlo 31.10.2026: "Datenschutzerklaerung" stand bei 360 px allein).
     Test: athlete/tests/gratis_onboarding/gratis_recht_haken.spec.cjs, 5 Masse. */
  text-wrap: pretty;
}

/* ===================================================
 * SATISFYING CLICK BUTTON
 * Markup:
 *   <button class="cj-btn cj-btn-primary" type="submit">Label</button>
 *   <button class="cj-btn cj-btn-secondary" type="button">Label</button>
 * =================================================== */

.cj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cj-space-1, 8px);
  padding: var(--cj-space-3, 24px) var(--cj-space-5, 40px);
  border-radius: var(--cj-r-pill, 50px);
  font-family: var(--cj-font-body, 'Nunito Sans', -apple-system, sans-serif);
  font-size: var(--cj-text-body-xl, 18px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  border: 0;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition:
    background var(--cj-t-fast) ease,
    transform var(--cj-t-press) ease,
    box-shadow var(--cj-t-fast) ease,
    color var(--cj-t-state) ease;
}

.cj-btn:focus-visible {
  outline: 2px solid var(--cj-blue);
  outline-offset: 2px;
}

/* Ein Link, der als Knopf auftritt, bringt seinen Unterstrich mit — auf dem Vollbild-CTA
   „Mein Fortschritt" stand er quer durch den Knopf (Carlo 01.08.2026). Einmal hier statt in
   jedem Screen: dasselbe Muster wie `a.lp-btn--primary` in cjump_components.css. */
a.cj-btn { text-decoration: none; }

.cj-btn-primary {
  /* Monogramm-Doppellinie 1:1, kraeftig (Konvention 2026-06-23): Haupt-CTA 4px Anthrazit + 4px Weiss.
     Box-Shadow-Doppelring (kein Layout-Border) — konsistent mit der LP (.lp-btn--primary). */
  background: var(--cj-grad-primary);
  color: #fff;
  text-shadow: var(--cj-btn-text-shadow, 0 1px 2px rgba(4,18,42,0.55));
  border: 0;
  box-shadow: var(--cj-btn-primary-ring);
}
.cj-btn-primary:hover:not(:disabled) {
  background: var(--cj-grad-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--cj-btn-glass), 0 0 0 4px var(--cj-anthrazit, #262626), 0 0 0 8px #fff, 0 4px 14px rgba(26,140,255,0.35);
}
/* klick-lint: ok nur ohne cj_tippen (Landing-Page) */
html:not([data-cj-tippen]) .cj-btn-primary:active:not(:disabled) {
  background: var(--cj-grad-primary);
  filter: brightness(0.92);
  transform: scale(0.97);
  box-shadow: var(--cj-btn-glass), 0 0 0 4px var(--cj-anthrazit, #262626), 0 0 0 8px #fff, 0 1px 3px rgba(26,140,255,0.2);
}

/* ── Groessen-/Akzent-Modifier ───────────────────────────────────────────────
   WARUM ES DIESE GIBT (25.07.): ein Screen, der .cj-btn pauschal umdefiniert, verstellt
   stumm JEDEN Knopf seiner Route - wer spaeter einen Knopf dazusetzt, bekommt ungefragt
   die fremde Groesse. Genau das tat profile.css. Wer eine Variante braucht, nimmt einen
   Modifier von hier; die Basis bleibt unangetastet. 0-2-0, damit der Modifier gewinnt. */

/* Kompakt: Modal-Footer + Push-View-CTAs, wo der Solo-CTA (24/40px) zu wuchtig waere. */
.cj-btn.cj-btn--kompakt { padding: 13px; font-size: 15px; }

/* Screen: DIE Groesse des Primaer-Knopfs INNERHALB der App (Carlo 03.08.2026, "nicht so viele
   verschiedene Versionen von dem einen Knopf"). 50px hoch, 16px, Pille, keine Versalien.
   Vorher trug jede Stelle ihre eigene: 45/50/50/53px, 15/15/16/17px, zwei Radien.
   `line-height: normal` ist Pflicht - .cj-btn bringt 1 mit, sonst faellt der Knopf flach. */
:root { --cj-knopf-screen-hoehe: 50px; }
.cj-btn.cj-btn--screen {
  min-height: max(44px, calc(var(--cj-knopf-screen-hoehe) * var(--cj-knopf-skala, 1)));
  padding: 0 calc(24px * var(--cj-knopf-skala, 1));
  font-size: calc(16px * var(--cj-knopf-skala, 1));
  line-height: normal;
  border-radius: var(--cj-r-pill, 50px);
  text-transform: none;
  letter-spacing: 0;
}

/* Halo statt Doppelring: fuer CTAs, die neben anderen Knoepfen stehen - der weisse
   8px-Aussenring ragt sonst in den Nachbarn (branding.md: Doppelring nur an Solo-CTAs). */
.cj-btn.cj-btn--glow { box-shadow: 0 4px 14px rgba(26,140,255,0.28); }
/* ⚠ Ohne diese Zeile holt der Druck den Doppelring zurueck: `.cj-btn-primary:active`
   setzt ihn ausdruecklich (0-3-0) und schlaegt damit den Modifier (0-2-0). Der Ring
   blitzt dann genau in dem Moment auf, in dem der Finger auf dem Knopf steht - neben
   dem Nachbarn, den der Modifier freihalten soll. 0-4-0 gewinnt in beide Richtungen.
   Gefunden 15.08.2026 am Pausen-Timer, behoben an der Quelle statt am Screen. */
.cj-btn.cj-btn--glow:hover:not(:disabled),
/* klick-lint: ok nur ohne cj_tippen (Landing-Page) */
html:not([data-cj-tippen]) .cj-btn.cj-btn--glow:active:not(:disabled) { box-shadow: 0 6px 20px rgba(26,140,255,0.42); }

.cj-btn.cj-btn-secondary,
.cj-btn.cj-btn-ghost {
  /* V2 Outline-Pill (Carlo 2026-07-15): transparent + 1px Border, Pill-Radius von .cj-btn.
     Geschwister-Form zum gefuellten Primaer-Pill. EINE Quelle fuer beide Namen.
     Doppel-Spezifitaet (0-2-0), damit seiten-lokale `.cj-btn{border:none}` die Border
     nicht verschluckt (profile.html Modal-Cancel-Regression 2026-07-15). */
  background: transparent;
  color: var(--cj-white);
  border: 1px solid rgba(255,255,255,0.16);
}
.cj-btn-secondary:hover:not(:disabled),
.cj-btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
}
html:not([data-cj-tippen]) .cj-btn-secondary:active:not(:disabled),
/* klick-lint: ok nur ohne cj_tippen (Landing-Page) */
html:not([data-cj-tippen]) .cj-btn-ghost:active:not(:disabled) {
  transform: scale(0.97);
}

/* Betonter Sekundaer (electric) - Modifier auf .cj-btn-secondary/-ghost.
   0-2-0, damit die electric border-color die 0-2-0-Ghost/Secondary-Border ueberstimmt. */
.cj-btn.cj-btn-accent {
  color: var(--cj-electric-light, #67B8FF);
  border-color: rgba(26,140,255,0.6);
}
.cj-btn-accent:hover:not(:disabled) {
  background: rgba(26,140,255,0.10);
  border-color: rgba(26,140,255,0.85);
}

/* Danger (destruktiv) - Signal-Rot #EB4E4E, brand-konform NUR als Gefahr-Signal, nie Akzent/Marke. */
.cj-btn-danger {
  background: transparent;
  color: #EB4E4E;
  border: 1px solid rgba(235,78,78,0.55);
}
.cj-btn-danger:hover:not(:disabled) {
  background: rgba(235,78,78,0.10);
  border-color: rgba(235,78,78,0.85);
}
/* klick-lint: ok nur ohne cj_tippen (Landing-Page) */
html:not([data-cj-tippen]) .cj-btn-danger:active:not(:disabled) {
  transform: scale(0.97);
}

.cj-btn:disabled,
.cj-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}
/* Gesperrter Hauptknopf: flach und gedimmt wie im Onboarding (cjump_ob_shell.css), statt
   halb durchsichtigem Blau, das klickbar aussieht (Carlo 16.09.2026, Werkbank
   werkbank_satz_speichern.html, Variante A). Nur Satz- und Auslass-Ansicht: app-weit haette
   die Regel auch Profil- und Check-in-Knoepfe umgefaerbt, die Carlo nicht gewaehlt hat.
   0-4-0 schlaegt .cj-btn.cj-btn--glow (0-2-0), sonst bliebe der blaue Schein. */
.cj-btn.cj-btn-primary.cj-auslass__speichern:disabled {
  background: rgba(255,255,255,0.07);
  color: var(--cj-white);
  box-shadow: inset 0 0 0 1px var(--cj-white-10);
  text-shadow: none;
  opacity: 1;
}

/* Submit-Lifecycle States */
.cj-btn.is-loading {
  pointer-events: none;
  background: var(--cj-blue-dark);
}
.cj-btn.is-loading .cj-btn-label { visibility: hidden; }
.cj-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cj-spin 700ms linear infinite;
}

/* Erfolg/Fehler faerben den Knopf NICHT mehr (Carlo 25.07.: "Erfolg meldet nur der
   Toast"). Die gruene bzw. rote Vollflaeche stand live auf anmelden/kuendigen/widerrufen/
   partner und meldete dasselbe ein zweites Mal, was die Statuszeile darunter schon sagte.
   Geblieben ist .is-fertig: ein reiner Merker ohne eigenes Aussehen - er sperrt den Knopf
   gegen ein zweites Absenden und loest den Konfetti-Burst aus.
   Fehler ruettelt kurz (Signal), faerbt aber nichts. */
.cj-btn.is-fertig {
  pointer-events: none;
}
.cj-btn.is-fehler {
  animation: cj-shake var(--cj-t-auftritt, 420ms) cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes cj-spin {
  to { transform: rotate(360deg); }
}
@keyframes cj-shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* Confetti-Burst beim Erfolg (kein extra Asset) */
.cj-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.cj-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cj-success);
  opacity: 0;
}
.cj-btn.is-fertig .cj-burst span {
  animation: cj-burst-fly var(--cj-t-feier, 700ms) ease-out forwards;
}
/* CJump-Confetti-Konvention: nur Brand-Farben (Electric-Blue-Familie + Weiss) */
.cj-burst span:nth-child(1)  { --dx: -42px; --dy: -28px; background: #1A8CFF; animation-delay: 0ms; }
.cj-burst span:nth-child(2)  { --dx:  38px; --dy: -32px; background: #5FB3FF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 0.5); }
.cj-burst span:nth-child(3)  { --dx: -22px; --dy:  34px; background: #FFFFFF; animation-delay: var(--cj-t-staffel, 60ms); }
.cj-burst span:nth-child(4)  { --dx:  44px; --dy:  18px; background: #1A8CFF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 1.25); }
.cj-burst span:nth-child(5)  { --dx: -50px; --dy:   6px; background: #A6D4FF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 0.75); }
.cj-burst span:nth-child(6)  { --dx:  20px; --dy: -42px; background: #5FB3FF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 1.75); }
.cj-burst span:nth-child(7)  { --dx: -10px; --dy:  44px; background: #FFFFFF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 0.25); }
.cj-burst span:nth-child(8)  { --dx:  52px; --dy:  -8px; background: #1A8CFF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 1.25); }
.cj-burst span:nth-child(9)  { --dx: -36px; --dy: -16px; background: #5FB3FF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 0.75); }
.cj-burst span:nth-child(10) { --dx:  14px; --dy:  36px; background: #A6D4FF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 1.5); }
.cj-burst span:nth-child(11) { --dx: -28px; --dy:  20px; background: #FFFFFF; animation-delay: calc(var(--cj-t-staffel, 60ms) * 1.75); }
.cj-burst span:nth-child(12) { --dx:  30px; --dy:   2px; background: #1A8CFF; animation-delay: 0ms; }

@keyframes cj-burst-fly {
  0%   { transform: translate(0, 0) scale(0.3); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2); opacity: 0; }
}

/* ===================================================
 * FORM-LEVEL SUCCESS GLOW
 * Wenn Submit erfolgreich war: Form-Container kurz grün outlinen.
 * =================================================== */

.cj-form.is-submitted {
  /* klick-lint: ok Funktionsdauer: Submit-Erfolg bis zur Weiterleitung nach 900ms (forms.js) */
  animation: cj-form-glow 900ms ease-out;
}
@keyframes cj-form-glow {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
  30%  { box-shadow: 0 0 0 5px rgba(76,175,80,0.22); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

/* ===================================================
 * STATUS-MELDUNG (Form-übergreifend)
 * =================================================== */

.cj-status {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--cj-radius);
  font-size: 0.95rem;
  line-height: 1.5;
  display: none;
}
.cj-status.is-shown { display: block; }
.cj-status.is-success {
  background: rgba(76,175,80,0.10);
  border: 1px solid rgba(76,175,80,0.4);
  color: #1e6c3d;
}
.cj-status.is-error {
  background: rgba(235,78,78,0.10);
  border: 1px solid rgba(235,78,78,0.4);
  color: #8a1f1f;
}
.cj-status.is-pending {
  background: rgba(26,140,255,0.10);
  border: 1px solid rgba(26,140,255,0.4);
  color: #14457a;
}

/* ===================================================
 * DARK-MODE-VARIANTE (LP-Newsletter etc.)
 * Aktiviert via .cj-form--dark auf Form-Container.
 * =================================================== */

.cj-form--dark .cj-input,
.cj-form--dark .cj-input-wrap input,
.cj-form--dark .cj-input-wrap select,
.cj-form--dark .cj-input-wrap textarea {
  background: #111;
  color: #E8E8E8;
  border-color: var(--cj-border-dark);
}
.cj-form--dark .cj-checkbox {
  background: #1A1A1A;
  border-color: var(--cj-border-dark);
}
.cj-form--dark .cj-checkbox-text { color: #E8E8E8; }
.cj-form--dark .cj-checkbox-box  { background: #111; border-color: var(--cj-border-dark); }
.cj-form--dark label             { color: #E8E8E8; }
/* Chrome-Autofill nicht grell weiss werden lassen - dunklen BG erzwingen (Carlo 07.07.) */
.cj-form--dark input:-webkit-autofill,
.cj-form--dark input:-webkit-autofill:hover,
.cj-form--dark input:-webkit-autofill:focus,
.cj-form--dark textarea:-webkit-autofill,
.cj-form--dark select:-webkit-autofill {
  -webkit-text-fill-color: #E8E8E8;
  -webkit-box-shadow: 0 0 0 1000px #111 inset;
  box-shadow: 0 0 0 1000px #111 inset;
  caret-color: #E8E8E8;
  /* klick-lint: ok Autofill: 9999s unterdruecken den hellen Browser-Hintergrund */
  transition: background-color 9999s ease-in-out 0s;
}

/* ===================================================
 * PHOTO SLOTS - Mobility-Foto-Upload (Onboarding-Baseline)
 * Markup:
 *   <div class="cj-photo-grid">
 *     <div class="cj-photo-slot" data-slot="goblet_front">
 *       <div class="cj-photo-slot-head">
 *         <h3>Goblet Squat - Front</h3>
 *         <p>Anweisungs-Text</p>
 *       </div>
 *       <label class="cj-photo-dropzone">
 *         <input type="file" accept="image/*" capture="environment" hidden>
 *         <span class="cj-photo-prompt">Foto wählen / Drag-Drop</span>
 *         <img class="cj-photo-preview" alt="" hidden>
 *       </label>
 *       <div class="cj-photo-status">Noch nicht hochgeladen</div>
 *     </div>
 *   </div>
 * =================================================== */

.cj-photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 24px 0;
}

@media (min-width: 720px) {
  .cj-photo-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

.cj-photo-slot {
  background: #ffffff;
  border: 2px dashed rgba(38, 38, 38, 0.18);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--cj-t-state) ease, background var(--cj-t-state) ease;
}

.cj-photo-slot:hover { border-color: var(--cj-blue); }

.cj-photo-slot.is-loading {
  border-color: var(--cj-blue);
  border-style: solid;
}

.cj-photo-slot.is-done {
  border-color: var(--cj-success);
  border-style: solid;
  background: rgba(76, 175, 80, 0.04);
}

.cj-photo-slot.is-error {
  border-color: var(--cj-error);
  border-style: solid;
  background: rgba(235, 78, 78, 0.04);
}

.cj-photo-slot-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--cj-anthrazit);
}

.cj-photo-slot-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(38, 38, 38, 0.72);
}

.cj-photo-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border-radius: 12px;
  background: rgba(26, 140, 255, 0.04);
  border: 1px solid rgba(26, 140, 255, 0.18);
  cursor: pointer;
  overflow: hidden;
  transition: background var(--cj-t-fast) ease;
}

.cj-photo-dropzone:hover { background: rgba(26, 140, 255, 0.08); }

.cj-photo-dropzone.is-drag-over {
  background: rgba(26, 140, 255, 0.14);
  border-color: var(--cj-blue);
}

.cj-photo-prompt {
  font-size: 14px;
  color: var(--cj-blue);
  font-weight: 600;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}

.cj-photo-preview {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  border-radius: 12px;
}

.cj-photo-status {
  font-size: 13px;
  font-weight: 600;
  color: rgba(38, 38, 38, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

.cj-photo-slot.is-done .cj-photo-status { color: var(--cj-success); }
.cj-photo-slot.is-error .cj-photo-status { color: var(--cj-error); }

.cj-photo-slot.is-loading .cj-photo-prompt::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid var(--cj-blue);
  border-top-color: transparent;
  animation: cj-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes cj-spin {
  to { transform: rotate(360deg); }
}

/* ===================================================
 * ACCESSIBILITY: prefers-reduced-motion
 * Alle Bewegungs-Animationen kollabieren auf Minimum.
 * =================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cj-input-wrap::after { transform: translateY(-50%) scale(1); }
  .cj-fieldmsg.is-shown { transform: none; }
  /* klick-lint: ok nur ohne cj_tippen (Landing-Page) */
  .cj-btn:hover:not(:disabled), html:not([data-cj-tippen]) .cj-btn:active:not(:disabled) { transform: none !important; }
  .cj-burst span { display: none; }
}
