#lg-bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--black);
  transition: background-color 0.3s ease;
}
#lg-disc.err #lg-bg {
  background: var(--red);
  transition: none;
}
@keyframes lg-pulse {
  0%,
  100% {
    background-color: #000;
  }
  50% {
    background-color: #333;
  }
}
#lg-disc.checking #lg-bg {
  animation: lg-pulse 1.15s ease-in-out infinite;
}
#lg-disc.err {
  animation: lg-shake 0.32s ease-in-out;
}
@keyframes lg-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

#lg-in {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#lg-disc.ready #lg-in {
  opacity: 1;
}
#lg-wrap.leaving #lg-in {
  opacity: 0;
  transition: opacity 0.25s ease;
}

#lg-form,
#lg-sent {
  position: absolute;
  inset: 0;
}
#lg-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
#lg-wrap.pending #lg-form {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#lg-sent {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
#lg-wrap.pending #lg-sent {
  opacity: 1;
  pointer-events: auto;
  animation: lg-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Registrierung und Tarifwahl: Die Anmeldezeile ist unsichtbar, darf also
   auch keine Klicks fangen. #lg-sent behielte sonst aus dem Ziffernschritt
   pointer-events:auto — und im vergrößerten Kreis läge die Fläche über dem
   Knopf in der Fußleiste. Eine ID mehr als die Regel oben, ohne !important. */
body.lg-regmodus #lg-wrap #lg-sent,
body.lg-regmodus #lg-wrap #lg-form,
body.lg-abo #lg-wrap #lg-sent,
body.lg-abo #lg-wrap #lg-form {
  pointer-events: none;
}
@keyframes lg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Der Text nimmt nur einen Teil des Durchmessers ein — an den Seiten
   bleibt Luft bis zur Kreiskante. Wird die Adresse laenger, waechst
   der Kreis; kleiner gesetzt wird die Schrift nicht.               */
#lg-line {
  position: relative;
  width: 62%;
  height: 34px;
  cursor: text;
  display: block;
}
#lg-inp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  text-align: center;
  font-family: var(--sans);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 1;
  color: var(--white);
  caret-color: transparent;
  padding: 0;
}
#lg-inp::placeholder {
  color: transparent;
}
#lg-inp:not(:placeholder-shown) {
  caret-color: var(--white);
}
#lg-line.checking #lg-inp {
  color: rgba(255, 255, 255, 0.4);
}
#lg-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.18s ease;
  font-family: var(--sans);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.015em;
  line-height: 1;
  color: var(--white);
  white-space: pre;
  transform: skewX(-7deg);
} /* der Hinweis liegt staerker als die Eingabe */
#lg-ghost::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--white);
  margin-left: 2px;
  transform: translateY(0.06em);
  opacity: 0;
}
#lg-line.caret #lg-ghost::after {
  opacity: 1;
  animation: lg-blink 1.05s step-end infinite;
}
@keyframes lg-blink {
  50% {
    opacity: 0;
  }
}
#lg-inp:not(:placeholder-shown) ~ #lg-ghost {
  opacity: 0;
}
#lg-line.checking #lg-ghost {
  opacity: 0;
}

#lg-trace {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 100%;
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
#lg-wrap.step-name #lg-trace {
  opacity: 1;
  transform: translateY(0);
}
#lg-under {
  position: absolute;
  left: -14%;
  right: -14%;
  top: 100%;
  margin-top: 12px;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
#lg-wrap.step-name #lg-under {
  opacity: 1;
  pointer-events: auto;
}
#lg-under a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
#lg-under a:hover {
  color: var(--white);
}
#lg-err {
  position: absolute;
  left: -14%;
  right: -14%;
  top: 100%;
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 3;
}
#lg-wrap.err #lg-err {
  opacity: 1;
}

/* Die Ziffern sitzen mittig auf der Kreisachse, Umschlag und Aktionen gleich weit weg */
#lg-code {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
  justify-content: center;
}
/* Sechs Felder: 230 px — passt auch in den kleinsten Kreis (0,8 × Fensterbreite) */
#lg-code input {
  width: 30px;
  height: 40px;
  background: none;
  border: none;
  outline: none;
  text-align: center;
  padding: 0;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 400;
  color: var(--white);
  caret-color: var(--white);
  transition: color 0.2s;
}
#lg-code.checking input {
  color: rgba(255, 255, 255, 0.4);
}
#lg-env {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(50% + 20px + 22px);
  display: block;
}
/* Untereinander statt nebeneinander: nebeneinander ergaeben die beiden
   Aufschriften rund 240 px, und auf dieser Hoehe ist die Kreissehne bei
   engen Kreisen schmaler — die Enden wurden beschnitten.              */
#lg-acts {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 20px + 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#lg-acts button {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
#lg-acts button:hover {
  color: var(--white);
}
#lg-ok {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  display: none;
}

/* ── Verwaltungszugang: das Passwort steht wie die Ziffern auf der Kreisachse ── */
#lg-pass {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
#lg-wrap.password #lg-form {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#lg-wrap.password #lg-pass {
  opacity: 1;
  pointer-events: auto;
  animation: lg-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
#lg-lock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(50% + 20px + 22px);
  display: block;
}
#lg-pw {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: 40px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  outline: none;
  text-align: center;
  padding: 0;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--white);
  caret-color: var(--white);
  transition: color 0.2s;
}
#lg-pass.checking #lg-pw {
  color: rgba(255, 255, 255, 0.4);
}
#lg-pw-acts {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 20px + 22px);
  display: flex;
  justify-content: center;
}
#lg-pw-acts button {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
#lg-pw-acts button:hover {
  color: var(--white);
}

/* Meldungen im Kreis (Code abgelaufen, Passwort falsch, keine Verbindung …) */
#lg-msg {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 15%;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
#lg-wrap.msg #lg-msg {
  opacity: 1;
}
