/* orbit: Anmelden, Einladung, Setup, Eintritt und Willkommen im Liquid-Glass-Look.
   Eigene Schleier-Palette, weil vor dem Anmelden noch kein Cover leuchtet. */
.gate {
  --veil-a: #0f8a4a;   /* tiefes Grün, Nähe zum Akzent */
  --veil-b: #3a34c9;   /* Indigo */
  --veil-c: #c9822c;   /* warmes Amber */
  --g-text: #fff; --g-sub: rgba(255,255,255,.66); --g-dim: rgba(255,255,255,.42);
  --g-line: rgba(255,255,255,.12); --g-field: rgba(0,0,0,.32);
  position: fixed; inset: 0; z-index: 200; isolation: isolate;
  display: grid; place-items: center; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 16px calc(var(--safe-b) + 28px);
  background-color: #000;
}

/* Farbschleier: weiche Verläufe, sehr langsam (40 bis 60 s), kein Filter nötig */
.aura { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aura i { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; will-change: transform; }
.aura i:nth-child(1) { left: -30vmax; top: -36vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--veil-a) 80%, transparent), transparent); animation: veil-a 44s ease-in-out infinite alternate; }
.aura i:nth-child(2) { right: -36vmax; top: 0; background: radial-gradient(closest-side, color-mix(in srgb, var(--veil-b) 58%, transparent), transparent); animation: veil-b 52s ease-in-out infinite alternate; }
.aura i:nth-child(3) { width: 56vmax; height: 56vmax; left: 4vmax; bottom: -30vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--veil-c) 58%, transparent), transparent); animation: veil-c 60s ease-in-out infinite alternate; }
.tab-hidden .aura i { animation-play-state: paused; }   /* Tab im Hintergrund: Schleier stehen still, spart GPU */
.aura::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 40%, rgba(0,0,0,.6)); }
@keyframes veil-a { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes veil-b { to { transform: translate(-12vmax, 14vmax) scale(.92); } }
@keyframes veil-c { to { transform: translate(18vmax, -10vmax) scale(1.1); } }

/* Glaskarte: durchsichtig, Hintergrund verschwimmt, Lichtkante oben links */
.gate .glass {
  position: relative; contain: paint; width: min(392px, 100%); padding: 34px 26px 22px; border-radius: 32px;
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center;
  background: linear-gradient(170deg, rgba(255,255,255,.085), rgba(255,255,255,.025) 55%, rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 40px 90px -30px rgba(0,0,0,.85);
}
.gate .glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.5), rgba(255,255,255,.08) 30%, rgba(255,255,255,.03) 62%, rgba(255,255,255,.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.gate .glass > * { position: relative; }

/* Logo mit Lichthof */
.gate .mark { width: 104px; height: 104px; margin: 0 auto 2px; position: relative; }
.gate .mark::before { content: ""; position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(closest-side, rgba(30,215,96,.22), rgba(58,52,201,.08) 60%, transparent); }
.orbit-mark { position: relative; width: 100%; height: 100%; display: block; overflow: visible; }

.gate h2 { font-weight: 800; letter-spacing: -.035em; line-height: 1.08; color: var(--g-text); text-wrap: balance; }
.gate .login-card h2 { font-size: 54px; letter-spacing: -.055em; line-height: .95; margin-top: 2px; }
.gate .lede { font-size: 18px; font-weight: 500; color: var(--g-sub); margin: -2px 0 18px; }
.gate .sub { color: var(--g-sub); font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.gate .foot { color: var(--g-dim); font-size: 12.5px; font-weight: 500; margin-top: 4px; }
.gate .hint { color: var(--g-sub); }
.gate .err { min-height: 0; }
.gate .err:empty { display: none; }

/* Knöpfe */
.gate .pill.big {
  height: 54px; border-radius: 999px; font-size: 16px; font-weight: 700; gap: 10px;
  background: var(--accent); color: #000;
  box-shadow: 0 12px 32px -12px rgba(30,215,96,.75), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s;
}
.gate .pill.big:hover { transform: translateY(-1px); background: #3be477; box-shadow: 0 16px 36px -12px rgba(30,215,96,.85), inset 0 1px 0 rgba(255,255,255,.35); }
.gate .pill.big:active { transform: scale(.985); }
.gate .pill.big.ghost, .gate a.pill.ghost { background: rgba(255,255,255,.1); color: var(--g-text); box-shadow: inset 0 0 0 1px var(--g-line); }
.gate .pill.big.ghost:hover, .gate a.pill.ghost:hover { background: rgba(255,255,255,.16); }
.gate .text-link { align-self: center; color: var(--g-sub); font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; transition: color .15s, background-color .15s; }
.gate .text-link:hover { color: var(--g-text); background: rgba(255,255,255,.06); text-decoration: none; }
.gate.pw-open #li-pw-toggle { color: var(--g-text); }
.gate.pw-open #li-passkey { background: rgba(255,255,255,.1); color: var(--g-text); box-shadow: inset 0 0 0 1px var(--g-line); }   /* Passwort offen: nur ein grüner Knopf */
.gate :is(button, a, input, label):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Eingaben: dunkles Glas */
.gate form { display: flex; flex-direction: column; gap: 10px; }
.gate input[type=text], .gate input[type=password] {
  width: 100%; height: 52px; border-radius: 16px; padding: 0 16px; font-size: 16px; color: var(--g-text);
  background: var(--g-field); border: 1px solid var(--g-line); outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.gate input::placeholder { color: var(--g-dim); }
.gate input:focus, .gate input:focus-visible { outline: none; border-color: rgba(30,215,96,.7); box-shadow: 0 0 0 4px rgba(30,215,96,.16); background: rgba(0,0,0,.42); }
.gate #li-form:not([hidden]), .gate #inv-pw:not([hidden]) { animation: gate-unfold .32s cubic-bezier(.2,.7,.2,1) both; }
.gate #li-form { margin-top: 2px; }
@keyframes gate-unfold { from { opacity: 0; transform: translateY(-6px); } }

/* Einladung und Setup */
.gate .inv-card.glass { width: min(432px, 100%); gap: 12px; padding-top: 26px; }
.gate .inv-card h2 { font-size: 30px; }
.gate .inv-card .web-loading { justify-content: center; }
.brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -.04em; color: var(--g-text); margin-bottom: 4px; }
.brand .orbit-mark { width: 30px; height: 30px; }
.gate .inv-card form > h2 { margin-top: 6px; }
.gate .inv-card form > p.sub { margin: -4px 0 4px; }

/* Glas-Ring fürs Profilbild, mit einer Umlaufbahn und dem Einladenden als Mond */
.gate .avatar-pick { margin: 6px 0 0; gap: 12px; }
.gate .avatar-pick .avatar { box-shadow: none; }
.ring {
  --r: 136px; position: relative; width: var(--r); height: var(--r); margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 24%, rgba(255,255,255,.16), rgba(255,255,255,.035) 62%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 0 0 1px rgba(255,255,255,.1), 0 24px 50px -22px rgba(0,0,0,.9);
  transition: box-shadow .2s;
}
.ring::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); pointer-events: none; }
.ring .avatar { --s: 112px; }
.ring .avatar b svg { width: 34px; height: 34px; color: var(--g-sub); }
.gate .avatar-pick:hover .ring { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 0 0 2px rgba(30,215,96,.7), 0 24px 50px -22px rgba(0,0,0,.9); }
.ring .moon {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff;
  transform: rotate(-42deg) translate(calc(var(--r) / 2 + 16px)) rotate(42deg) translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(0,0,0,.55), 0 6px 16px rgba(0,0,0,.5);
}
.ring-badge {
  position: absolute; right: 4px; bottom: 4px; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #000; box-shadow: 0 6px 14px rgba(0,0,0,.45);
}
.ring-badge svg { width: 18px; height: 18px; }
.ring-badge.key { background: var(--accent); }
.gate .inv-card > .ring { margin: 8px auto 6px; }

/* Fortschritt Konto, Bild, Passkey */
.gate .steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 6px; justify-content: stretch; }
.gate .steps li { display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--g-dim); transition: color .2s; }
.gate .steps li i { width: auto; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); transition: background-color .3s; }
.gate .steps li.on { color: var(--g-text); }
.gate .steps li.on i { background: linear-gradient(90deg, #fff, rgba(255,255,255,.4)); }
.gate .steps li.done { color: var(--g-sub); }
.gate .steps li.done i { background: var(--accent); }
.gate .steps li.skip i { background: rgba(255,255,255,.22); }

.gate .field .at { color: var(--g-dim); left: 16px; }
.gate .field input { padding-left: 34px !important; }
.gate .inv-card .hint { text-align: left; padding: 0 4px; margin-top: -2px; }
.gate #inv-pw .sub { margin-top: 4px; }

/* Eintritt nach der Anmeldung: Karte löst sich auf, Schleier treten in die App über, «Hallo» blendet ein und aus */
.gate.leaving { pointer-events: auto; cursor: default; animation: gate-out .34s ease forwards; }
.gate.leaving .glass { animation: card-out .42s cubic-bezier(.4,0,.2,1) forwards; }
.gate.leaving .aura { animation: aura-out 1.2s cubic-bezier(.3,0,.2,1) forwards; }
.gate.leaving.with-hello { animation: gate-out .4s .8s ease forwards; }
.gate .hello { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; padding: 24px; text-align: center; }
.gate .hello span { font-size: clamp(36px, 9vw, 64px); font-weight: 800; letter-spacing: -.045em; line-height: 1; text-shadow: 0 8px 40px rgba(0,0,0,.45);
  animation: hello-in .55s .18s cubic-bezier(.2,.7,.2,1) both; }
@keyframes card-out { to { opacity: 0; transform: scale(1.06); filter: blur(14px); } }
@keyframes aura-out { to { transform: scale(1.35); opacity: .75; } }
@keyframes gate-out { to { opacity: 0; } }
@keyframes hello-in { from { opacity: 0; transform: translateY(12px); filter: blur(8px); } }

/* Willkommen auf der Startseite (erster Start des Tages) */
.welcome {
  --tint: #1ed760; position: relative; max-width: 720px; margin: 4px 0 26px; padding: 26px 26px 22px; border-radius: 28px; overflow: hidden;
  background: linear-gradient(125deg, color-mix(in srgb, var(--tint) 34%, transparent), rgba(58,52,201,.14) 55%, rgba(255,255,255,.03));
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.06);
  animation: welcome-in .7s .1s cubic-bezier(.2,.7,.2,1) both; transition: opacity .2s, transform .2s;
}
.entering .welcome { animation-delay: .95s; }
.welcome-light { position: absolute; inset: -30%; z-index: -1; background: center/cover no-repeat; filter: blur(60px) saturate(1.6); opacity: .5; pointer-events: none; }
.welcome { isolation: isolate; }
.welcome.bye { opacity: 0; transform: scale(.98); }
@keyframes welcome-in { from { opacity: 0; transform: translateY(14px); } }
.welcome-hi { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; padding-right: 40px; text-wrap: balance; }
.welcome-date { color: rgba(255,255,255,.62); font-size: 14px; font-weight: 500; margin-top: 6px; }
.welcome-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: rgba(255,255,255,.62); }
.welcome-x:hover { color: #fff; background: rgba(255,255,255,.08); }
.welcome-x svg { width: 20px; height: 20px; }
.resume {
  margin-top: 20px; max-width: 520px; display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 18px; cursor: pointer;
  background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); transition: background-color .15s, transform .15s;
}
.resume:hover { background: rgba(0,0,0,.42); }
.resume:active { transform: scale(.99); }
.resume:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.resume .resume-cov { width: 72px; height: 72px; border-radius: 12px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.7); }
.resume .resume-cov svg { width: 28px; height: 28px; }
.resume-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.resume-k { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.resume-txt b { font-size: 17px; font-weight: 700; }
.resume-bar { display: block; height: 3px; margin-top: 8px; border-radius: 2px; background: rgba(255,255,255,.16); overflow: hidden; max-width: 260px; }
.resume-bar i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.resume .play-btn.green { width: 48px; height: 48px; flex: none; }
.resume .play-btn.green svg { width: 22px; height: 22px; }

@media (max-width: 760px) {
  .gate .glass { padding: 30px 22px 20px; border-radius: 30px; }
  .gate .login-card h2 { font-size: 48px; }
  .gate .inv-card h2 { font-size: 26px; }
  .welcome { margin: 0 0 20px; padding: 20px 18px 16px; border-radius: 24px; }
  .welcome-hi { font-size: 30px; }
  .resume { margin-top: 16px; }
  .resume .resume-cov { width: 60px; height: 60px; }
}
@media (min-width: 761px) and (min-height: 700px) {
  .gate .login-card { padding: 42px 34px 26px; }
}

/* Weniger Bewegung: Schleier stehen still, kein Auflösen und keine Begrüssungsanimation */
@media (prefers-reduced-motion: reduce) {
  .aura i, .gate #li-form:not([hidden]), .gate #inv-pw:not([hidden]), .welcome { animation: none !important; }
}
