/* Louvex Anmeldung — hostleaf dark, Geist, brand green. CSP: self only. */

@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/geist-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/geist-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/geist-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --background: #0A0A0B;
  --card: #111112;
  --border: rgba(255, 255, 255, 0.10);
  --text-1: #FAFAFA;
  --foreground: #D4D4D8;
  --muted: #A1A1AA;
  /* #71717A fails AA on #0A0A0B (~4.09); keep quiet readable at ≥4.5:1 */
  --quiet: #A1A1AA;
  --accent: #1DB954;
  --accent-hover: #19A44A;
  --accent-pressed: #17A048;
  --accent-fg: #04170B;
  --accent-border: color-mix(in srgb, var(--accent) 72%, #000 28%);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --ring: color-mix(in srgb, var(--accent) 35%, transparent);
  --font: "Geist Sans", system-ui, sans-serif;
  --display: var(--font);
  --radius: 8px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; }
body.lx-auth {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-fg); }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
.lx-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px #1DB954;
}
.lx-field input:focus-visible,
.lx-code:focus-visible {
  outline: none;
  border-color: #1DB954;
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.30);
}

.lx-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* —— Brand panel (waves only here) —— */
.lx-brand {
  flex: 0 0 44%;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 56px;
  background: var(--card);
  color: var(--text-1);
  overflow: hidden;
  isolation: isolate;
  contain: paint;
}
.lx-brand__waves {
  position: absolute;
  inset: -10% -14% -20% -14%;
  pointer-events: none;
  z-index: 0;
  background-color: var(--accent);
  opacity: 0.2;
  -webkit-mask-image: url("/img/waves.svg");
  -webkit-mask-position: center 40%;
  -webkit-mask-size: min(1550px, 180%) auto;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("/img/waves.svg");
  mask-position: center 40%;
  mask-size: min(1550px, 180%) auto;
  mask-repeat: no-repeat;
  animation: lx-auth-wave 22s ease-in-out infinite alternate;
}
@keyframes lx-auth-wave {
  from { transform: translate3d(0, 0, 0); opacity: 0.14; }
  to { transform: translate3d(-8%, 2.5%, 0); opacity: 0.28; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-brand__waves {
    animation: none !important;
    opacity: 0.18 !important;
    transform: none !important;
  }
}
.lx-brand__bar,
.lx-mark,
.lx-statement,
.lx-mascot--auth,
.lx-domain {
  position: relative;
  z-index: 1;
}
.lx-brand__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lx-brand__site {
  display: none;
  flex: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.lx-brand__site:hover { color: var(--text-1); }
.lx-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.lx-mark img {
  display: block;
  width: 28px;
  height: 34px;
  object-fit: contain;
}
.lx-mark img.lx-lockup {
  width: 148px;
  height: 34px;
}
.lx-wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.lx-tag {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.lx-statement {
  margin: auto 0 0;
  padding-top: 80px;
  max-width: 18ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-wrap: balance;
}
.lx-statement__keep { white-space: nowrap; }
.lx-mascot--auth {
  width: min(100%, 360px);
  margin: 16px 0 8px -16px;
  aspect-ratio: 16 / 9;
  /* No CSS mask — alpha AVIF/WebP clears the plate */
}
.lx-mascot__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: transparent;
}
.lx-domain {
  font-size: 14px;
  font-weight: 500;
  color: var(--quiet);
}

/* —— Form panel —— */
.lx-main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  padding: 40px 56px 40px 96px;
  background: var(--background);
}
.lx-top {
  display: flex;
  justify-content: flex-end;
}
.lx-top a {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.lx-top a:hover { color: var(--accent); }

.lx-center {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: clamp(96px, 22vh, 220px);
}
.lx-form-panel {
  width: 100%;
  max-width: 400px;
}

.lx-form-panel > h1,
.lx-form-panel h1 {
  margin: 0 0 28px;
  max-width: 14ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-wrap: balance;
}

.lx-auth__lede {
  margin: -12px 0 20px;
  color: var(--muted);
  text-wrap: pretty;
}

.lx-auth__notice,
.alert-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #ef4444 35%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, #ef4444 12%, transparent);
  color: var(--text-1);
}
.lx-auth__notice--in-alt { margin: 12px 0 0; }

.lx-auth__actions { margin: 0; }
.lx-auth__fine {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--quiet);
}

.lx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font: 600 15px/20px var(--font);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.lx-btn svg { width: 18px; height: 18px; flex: none; }
.lx-btn--discord,
.lx-btn--primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-fg);
}
@media (hover: hover) {
  .lx-btn--discord:hover,
  .lx-btn--primary:hover {
    background: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent-hover) 72%, #000 28%);
    color: var(--accent-fg);
  }
}
.lx-btn--ink,
.lx-btn--quiet {
  width: auto;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 15px;
}
@media (hover: hover) {
  .lx-btn--ink:hover,
  .lx-btn--quiet:hover {
    background: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent-hover) 72%, #000 28%);
  }
}

.lx-alt {
  margin-top: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.lx-alt > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-1);
}
.lx-alt > summary::-webkit-details-marker { display: none; }
.lx-alt__body { padding: 0 16px 16px; }

.lx-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--quiet);
}
.lx-field { margin-top: 14px; }
.lx-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.lx-field input,
.lx-code {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--text-1);
  font: 500 15px/1.3 var(--font);
}
.lx-field input::placeholder,
.lx-code::placeholder {
  color: #8A8F98;
}
.lx-field input:focus,
.lx-code:focus {
  outline: none;
  border-color: #1DB954;
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.30);
}
.lx-field input[aria-invalid="true"],
.lx-code[aria-invalid="true"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}
input.lx-code.lx-code--totp,
.lx-code.lx-code--totp {
  height: 48px !important;
  min-height: 48px !important;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}
.lx-field__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--quiet);
}
.lx-btn:disabled,
.lx-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--card) !important;
  color: var(--muted) !important;
}

.lx-auth__cancel {
  display: inline-block;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
}
.lx-auth__cancel:hover { color: var(--accent); }
.lx-auth__cancel:focus-visible {
  outline: 2px solid #1DB954;
  outline-offset: 3px;
  border-radius: 4px;
}

.lx-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 32px;
  font-size: 13px;
  color: var(--quiet);
}
.lx-foot a,
.lx-brand__site,
.lx-top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  border-radius: 4px;
}
.lx-foot a:hover { color: var(--accent); }
.lx-foot a:focus-visible,
.lx-brand__site:focus-visible,
.lx-top a:focus-visible {
  outline: 2px solid #1DB954;
  outline-offset: 3px;
  border-radius: 4px;
}
.lx-foot__sep { opacity: 0.5; }

@media (max-width: 900px) {
  .lx-page {
    flex-direction: column;
    min-height: 100svh;
    display: flex;
  }
  .lx-brand {
    position: relative;
    flex: none;
    height: auto;
    max-height: 220px;
    min-height: 0;
    padding: 20px 24px;
    overflow: hidden;
  }
  .lx-brand__site { display: inline-flex; }
  .lx-statement {
    padding-top: 12px;
    font-size: 22px;
    max-width: none;
  }
  .lx-mascot--auth {
    display: none;
  }
  .lx-domain { margin-top: 8px; }
  .lx-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 28px 24px 32px;
  }
  .lx-top { display: none; }
  .lx-center {
    flex: 0 0 auto;
    padding-top: 24px;
  }
  .lx-form-panel > h1,
  .lx-form-panel h1 {
    font-size: 28px;
    max-width: 12ch;
  }
  .lx-foot { margin-top: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lx-btn { transition: none; }
  .lx-brand__waves { animation: none !important; }
}
