/* auth.css -- login, setup and forgot-password pages: the Lichtteilchen scene, glass card, logo, button sweep, shake.
   Split out of style.css on 2026-10-30 (one stylesheet per area).
   Order on a page: base.css, then app.css (chat and admin), then the page's own. */

/* ---------- Login pages: "Lichtteilchen" (2026-10-30) ---------- */
/* Since 2026-10-31 a bright daylight scene (Bert: "heller, freundlicher"),
   whatever the device setting -- before it was a dark night scene. Only
   colours changed; the card does not move (Bert's rule). lichtteilchen.js
   draws the canvas and sets --gx/--gy. */

@property --rim {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

body.auth {
  color-scheme: light;
  --text: #1b2233;
  --muted: #59627a;
  --border: rgba(27, 34, 51, 0.13);
  --surface-2: rgba(255, 255, 255, 0.75);
  --accent: #2e6be6;
  --accent-strong: #2258c7;
  --accent-soft: rgba(46, 107, 230, 0.14);
  --accent-text: #ffffff;
  --error-bg: #fdecec;
  --error-text: #9b1c1c;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 10% 6%, rgba(255, 190, 130, 0.55), transparent 60%),
    radial-gradient(700px 520px at 88% 10%, rgba(255, 175, 205, 0.35), transparent 60%),
    radial-gradient(900px 700px at 90% 95%, rgba(140, 175, 255, 0.5), transparent 60%),
    linear-gradient(160deg, #fff8ef, #f5f2ff 55%, #eaf1ff);
  overflow-x: hidden;
}

.light-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body.auth .card {
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 26px;
  box-shadow:
    0 30px 80px rgba(60, 70, 120, 0.18),
    0 0 0 1px rgba(27, 34, 51, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* Sheen that follows the pointer. */
body.auth .card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 200, 140, 0.22), transparent 45%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s;
}

/* A thin rim of light running around the card. */
body.auth .card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--rim), transparent 0 62%, rgba(255, 170, 90, 0.95) 74%, rgba(46, 107, 230, 0.8) 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rim 7s linear infinite;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.4s;
}

body.auth .card:hover::after,
body.auth .card:focus-within::after {
  opacity: 1;
  animation-duration: 2.8s;
}

@keyframes rim {
  to {
    --rim: 360deg;
  }
}

body.auth .logo {
  display: inline-block;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 10px 30px rgba(46, 107, 230, 0.3);
}

body.auth .logo svg {
  display: block;
  border-radius: 18px;
}

/* The three dots "type" while you hover the card or fill in a field. */
body.auth .logo .dot {
  transform-box: fill-box;
  transform-origin: center;
}

body.auth .card:hover .logo .dot,
body.auth .card:focus-within .logo .dot {
  animation: typing 1.1s ease-in-out infinite;
}

body.auth .logo .dot:nth-of-type(2) {
  animation-delay: 0.15s;
}

body.auth .logo .dot:nth-of-type(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

body.auth .brand {
  color: #a0560f;
  letter-spacing: 0.22em;
  font-size: 12px;
}

body.auth h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #1b2233 20%, #d9771f 40%, #1b2233 55%, #2e6be6 80%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background-position 1.2s ease;
}

body.auth .card:hover h1,
body.auth .card:focus-within h1 {
  background-position: 0% 0;
}

body.auth input,
body.auth textarea {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(27, 34, 51, 0.14);
  color: var(--text);
}

body.auth input:focus,
body.auth textarea:focus {
  border-color: #2e6be6;
  box-shadow: 0 0 0 4px rgba(46, 107, 230, 0.14), 0 0 24px rgba(255, 170, 90, 0.25);
  background: #ffffff;
}

body.auth button[type="submit"] {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3d7bf0, #2e6be6 50%, #7a5cf0);
  background-size: 160% 160%;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(46, 107, 230, 0.3);
  transition: background-position 0.6s ease, transform 0.08s, box-shadow 0.3s;
}

body.auth button[type="submit"]:hover {
  background-position: 100% 100%;
  box-shadow: 0 14px 40px rgba(122, 92, 240, 0.35);
}

/* A streak of light sweeps across the button on hover. */
body.auth button[type="submit"]::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
}

body.auth button[type="submit"]:hover::after {
  left: 120%;
}

body.auth .below a {
  color: #2258c7;
}

body.auth .below .sep {
  margin: 0 0.5em;
  opacity: 0.5;
}

/* Lure for form robots on /registrieren: moved off screen rather than
   display:none, because some robots skip fields that are not displayed.
   People never see or reach it (aria-hidden, tabindex -1). */
body.auth .trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body.auth .message.info {
  background: rgba(46, 107, 230, 0.1);
}

.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  body.auth .card,
  body.auth .card::after,
  body.auth .logo,
  body.auth .logo .dot,
  body.auth h1 {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

