:root {
  color-scheme: light;
  --theme: #2f6f9f;
  --theme-rgb: 47, 111, 159;
  --theme-deep: #1e4e73;
  --theme-deep-rgb: 30, 78, 115;
  --theme-light: #9bc7de;
  --theme-light-rgb: 155, 199, 222;
  --theme-mist: #e4f0f6;
  --theme-mist-rgb: 228, 240, 246;
  --theme-paper: #fff7e4;
  --theme-paper-rgb: 255, 247, 228;
  --theme-button-start: #3f86b5;
  --theme-button-end: #256b9b;
  --theme-link: #a8ddf8;
  --glass-line: rgba(255, 255, 255, 0.62);
  --white: #fff;
  --text: rgba(255, 255, 255, 0.98);
  --text-soft: rgba(255, 255, 255, 0.86);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--theme-mist);
}

a {
  color: var(--theme-link);
  text-decoration: none;
}

.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 72px);
}

.scene__image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene__veil {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      circle at 66% 24%,
      rgba(255, 255, 255, 0.28),
      transparent 27%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(var(--theme-deep-rgb), 0.08)
    );
  pointer-events: none;
}

.theme-dock {
  position: fixed;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 30px);
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(var(--theme-mist-rgb), 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 12px 30px rgba(var(--theme-deep-rgb), 0.16);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.theme-swatch {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.theme-swatch[aria-pressed="true"] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 0 3px rgba(var(--theme-light-rgb), 0.42),
    0 4px 12px rgba(var(--theme-deep-rgb), 0.2);
}

.glass-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.1fr);
  width: min(780px, calc(100vw - 36px));
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 36px;
  background:
    linear-gradient(
      90deg,
      rgba(var(--theme-rgb), 0.82) 0 47%,
      rgba(var(--theme-mist-rgb), 0.3) 47% 100%
    ),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    inset 0 20px 38px rgba(255, 255, 255, 0.28),
    inset 0 -22px 48px rgba(var(--theme-deep-rgb), 0.24),
    0 28px 68px rgba(var(--theme-deep-rgb), 0.22);
  backdrop-filter: blur(12px) saturate(1.3) brightness(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.3) brightness(1.05);
}

.glass-surface__filter {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.glass-surface--svg {
  background:
    linear-gradient(
      90deg,
      rgba(var(--theme-rgb), 0.8) 0 47%,
      rgba(var(--theme-mist-rgb), 0.24) 47% 100%
    ),
    rgba(255, 255, 255, var(--glass-frost, 0.12));
  backdrop-filter: var(--filter-id, url("#glass-filter"))
    saturate(var(--glass-saturation, 1.3)) brightness(1.05);
  -webkit-backdrop-filter: var(--filter-id, url("#glass-filter"))
    saturate(var(--glass-saturation, 1.3)) brightness(1.05);
}

.glass-surface--fallback {
  background:
    linear-gradient(
      90deg,
      rgba(var(--theme-rgb), 0.82) 0 47%,
      rgba(var(--theme-mist-rgb), 0.3) 47% 100%
    ),
    rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(1.3) brightness(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.3) brightness(1.05);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    inset 0 0 24px rgba(255, 255, 255, 0.78),
    inset 0 0 3px rgba(255, 255, 255, 0.98);
  pointer-events: none;
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 34px;
  background:
    linear-gradient(
      100deg,
      transparent 0 49%,
      rgba(255, 255, 255, 0.34) 49.4% 50.1%,
      transparent 50.7%
    ),
    radial-gradient(
      circle at 78% 20%,
      rgba(255, 255, 255, 0.42),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 46%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.glass-filter {
  position: absolute;
  inset: -18px;
  background:
    radial-gradient(
      circle at 8% 10%,
      rgba(255, 255, 255, 0.54),
      transparent 20%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(255, 255, 255, 0.42),
      transparent 24%
    ),
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.22),
      transparent 38%,
      rgba(255, 255, 255, 0.22)
    );
  filter: blur(8px);
  opacity: 0.94;
  pointer-events: none;
}

.monster-panel,
.signin-panel {
  position: relative;
  z-index: 1;
}

.monster-panel {
  min-height: 610px;
  padding: 28px;
  color: #080b0c;
  background: rgba(var(--theme-paper-rgb), 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.24);
}

.monster-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.18),
      transparent 16%,
      transparent 84%,
      rgba(var(--theme-deep-rgb), 0.12)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 52%);
  pointer-events: none;
}

.monster-art {
  position: relative;
  min-height: 360px;
  background:
    radial-gradient(
      circle at 34% 18%,
      rgba(255, 255, 255, 0.2),
      transparent 22%
    ),
    radial-gradient(
      circle at 78% 10%,
      rgba(var(--theme-light-rgb), 0.38),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      var(--theme-light),
      var(--theme) 58%,
      var(--theme-deep)
    );
  border: 0;
  overflow: hidden;
}

.face-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      112deg,
      transparent 0 37%,
      rgba(255, 255, 255, 0.3) 39%,
      transparent 43%
    ),
    linear-gradient(
      112deg,
      transparent 0 48%,
      rgba(255, 255, 255, 0.14) 49.5%,
      transparent 52%
    ),
    radial-gradient(
      circle at 16% 8%,
      rgba(255, 255, 255, 0.36),
      transparent 26%
    ),
    radial-gradient(
      circle at 88% 16%,
      rgba(var(--theme-mist-rgb), 0.22),
      transparent 28%
    );
  mix-blend-mode: screen;
  opacity: 0.6;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.monster-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 18px 30px rgba(255, 255, 255, 0.18),
    inset 0 -22px 42px rgba(var(--theme-deep-rgb), 0.32),
    inset 0 0 44px rgba(var(--theme-mist-rgb), 0.12);
  pointer-events: none;
}

.monster-face {
  position: relative;
  height: 238px;
}

.eye {
  position: absolute;
  top: 122px;
  z-index: 1;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 32%,
    rgba(255, 255, 255, 0.98),
    var(--theme-paper) 65%
  );
  box-shadow:
    inset 0 8px 18px rgba(255, 255, 255, 0.78),
    inset 0 0 0 2px rgba(var(--theme-light-rgb), 0.16),
    0 6px 18px rgba(var(--theme-deep-rgb), 0.18);
}

.eye::after {
  content: "";
  position: absolute;
  top: 26%;
  left: 30%;
  width: 18px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  filter: blur(1px);
  pointer-events: none;
}

.eye--left {
  left: 4px;
}

.eye--right {
  right: 8px;
}

.eye--right::after {
  top: 22%;
  left: 40%;
  width: 14px;
  height: 10px;
}

.pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 32% 30%,
      rgba(255, 255, 255, 0.34),
      transparent 26%
    ),
    #050505;
  transform: translate3d(
    calc(-50% + var(--pupil-x, 0px)),
    calc(-50% + var(--pupil-y, 0px)),
    0
  );
  will-change: transform;
  box-shadow:
    inset 0 7px 14px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.monster-copy {
  padding-top: 30px;
}

.monster-copy strong {
  display: block;
  color: #050505;
  font-size: clamp(56px, 6.5vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.monster-logo {
  display: block;
  width: min(210px, 82%);
  height: auto;
  margin-top: 12px;
  object-fit: contain;
}

.monster-info {
  position: relative;
  min-height: 194px;
  padding: 0 0 0;
}

.monster-info p {
  margin: 70px 0 0;
  color: #050505;
  font-size: 16px;
  font-weight: 500;
}

.signin-panel {
  display: flex;
  align-items: center;
  min-height: 610px;
  padding: 48px 34px;
  color: var(--text);
  background:
    radial-gradient(
      circle at 82% 18%,
      rgba(255, 255, 255, 0.2),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(var(--theme-rgb), 0.26),
      rgba(var(--theme-deep-rgb), 0.34)
    );
  text-shadow: 0 1px 14px rgba(var(--theme-deep-rgb), 0.42);
}

.signin-panel::before {
  content: none;
}

.signin-form {
  width: 100%;
}

.signin-form [hidden] {
  display: none !important;
}

.signin-heading h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

.signin-heading p {
  margin: 10px 0 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.signin-form[data-auth-mode="register"] .signin-heading p,
.signin-form[data-auth-mode="resetRequest"] .signin-heading p {
  margin-bottom: 20px;
}

.signin-form[data-auth-mode="resetToken"] .signin-heading p {
  margin-bottom: 32px;
}

.field {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 760;
}

.signin-form[data-auth-mode="register"] .field,
.signin-form[data-auth-mode="resetRequest"] .field {
  gap: 7px;
  margin-top: 13px;
  font-size: 13px;
}

.signin-form[data-auth-mode="resetToken"] .field {
  margin-top: 0;
}

.input-shell {
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 12px;
  background: rgba(var(--theme-deep-rgb), 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.signin-form[data-auth-mode="register"] .input-shell,
.signin-form[data-auth-mode="resetRequest"] .input-shell {
  min-height: 44px;
}

.input-shell > .ui-icon,
.input-shell > svg {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin-left: 16px;
  color: rgba(255, 255, 255, 0.86);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  min-width: 0;
  width: 100%;
  height: 50px;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 650;
  outline: none;
  padding: 0 14px;
}

.signin-form[data-auth-mode="register"] .input-shell input,
.signin-form[data-auth-mode="resetRequest"] .input-shell input {
  height: 44px;
}

.input-shell input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

.input-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 0 4px rgba(255, 255, 255, 0.12);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 50px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.2s ease,
    color 0.2s ease;
}

.signin-form[data-auth-mode="register"] .icon-button,
.signin-form[data-auth-mode="resetRequest"] .icon-button {
  height: 44px;
}

.field-action {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 86px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(var(--theme-deep-rgb), 0.18);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.field-action:disabled {
  cursor: default;
  color: rgba(255, 255, 255, 0.62);
}

.field-action:not(:disabled):hover,
.field-action:not(:disabled):focus-visible {
  background: rgba(var(--theme-light-rgb), 0.16);
  color: #fff;
}

.icon-button .ui-icon,
.icon-button svg {
  width: 21px;
  height: 21px;
  margin: 0;
}

.ui-icon {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.ui-icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.remember input {
  width: 17px;
  height: 17px;
  accent-color: var(--theme);
}

.signin-error {
  margin: 12px 0 0;
  min-height: 31px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 210, 210, 0.26);
  border-radius: 12px;
  background: rgba(96, 24, 28, 0.18);
  color: #ffe7e7;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 10px rgba(128, 12, 20, 0.26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.signin-error[data-tone="success"] {
  border-color: rgba(200, 255, 234, 0.28);
  background: rgba(18, 96, 73, 0.18);
  color: #e5fff4;
  text-shadow: 0 1px 10px rgba(12, 96, 72, 0.24);
}

.signin-error code {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(var(--theme-deep-rgb), 0.3);
  color: #fff;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
}

.signin-button,
.outline-button {
  width: 100%;
  min-height: 48px;
  border-radius: 24px;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-weight: 820;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease;
}

.signin-form[data-auth-mode="register"] .signin-button,
.signin-form[data-auth-mode="resetRequest"] .signin-button {
  margin-top: 12px;
}

.signin-form[data-auth-mode="resetToken"] .signin-button {
  margin-top: 28px;
}

.signin-form[data-auth-mode="register"] .outline-button,
.signin-form[data-auth-mode="resetRequest"] .outline-button {
  margin-top: 9px;
}

.signin-form[data-auth-mode="resetToken"] .outline-button {
  margin-top: 14px;
}

.signin-form[data-auth-mode="register"] .signin-button,
.signin-form[data-auth-mode="register"] .outline-button,
.signin-form[data-auth-mode="resetRequest"] .signin-button,
.signin-form[data-auth-mode="resetRequest"] .outline-button {
  min-height: 44px;
}

.signin-button {
  border: 0;
  background: linear-gradient(
    180deg,
    var(--theme-button-start),
    var(--theme-button-end)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 24px rgba(var(--theme-rgb), 0.24);
}

.outline-button {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(var(--theme-deep-rgb), 0.26);
}

.theme-swatch:hover,
.theme-swatch:focus-visible {
  filter: saturate(1.1) brightness(1.04);
  transform: translate3d(0, -2px, 0) scale(1.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 18px rgba(var(--theme-rgb), 0.24),
    0 0 18px rgba(var(--theme-light-rgb), 0.36);
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #fff;
  filter: drop-shadow(0 0 10px rgba(var(--theme-light-rgb), 0.58));
  transform: translate3d(0, -1px, 0) scale(1.06);
}

.signin-button:not(:disabled):hover,
.signin-button:not(:disabled):focus-visible,
.outline-button:hover,
.outline-button:focus-visible {
  filter: saturate(1.08) brightness(1.03);
  transform: translate3d(0, -2px, 0) scale(1.025);
}

.signin-button:not(:disabled):hover,
.signin-button:not(:disabled):focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 14px 30px rgba(var(--theme-rgb), 0.3),
    0 0 26px rgba(var(--theme-light-rgb), 0.34);
}

.outline-button:hover,
.outline-button:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 26px rgba(var(--theme-rgb), 0.2),
    0 0 22px rgba(var(--theme-light-rgb), 0.26);
}

.signin-button:active,
.outline-button:active,
.icon-button:active,
.theme-swatch:active {
  transform: translate3d(0, 1px, 0) scale(0.985);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .signin-button,
  .outline-button,
  .icon-button,
  .theme-swatch {
    filter: none !important;
    transform: none !important;
  }
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin: 26px 0;
  color: rgba(255, 255, 255, 0.82);
  font-style: normal;
}

.divider span {
  height: 1px;
  background: rgba(255, 255, 255, 0.36);
}

.divider em {
  font-style: normal;
}

.terms {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 820px) {
  .scene {
    align-items: start;
    padding: 64px 18px 22px;
  }

  .theme-dock {
    top: 16px;
    right: 18px;
  }

  .glass-card {
    grid-template-columns: 1fr;
    width: min(420px, calc(100vw - 28px));
    min-height: auto;
    background: rgba(var(--theme-mist-rgb), 0.28);
  }

  .glass-card::after {
    background:
      radial-gradient(
        circle at 72% 16%,
        rgba(255, 255, 255, 0.28),
        transparent 28%
      ),
      linear-gradient(
        105deg,
        transparent 0 44%,
        rgba(255, 255, 255, 0.22) 45%,
        transparent 46%
      ),
      linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 46%);
  }

  .monster-panel {
    display: none;
  }

  .signin-panel {
    min-height: auto;
    padding: 38px 28px 40px;
    background: rgba(var(--theme-mist-rgb), 0.24);
  }

  .signin-heading p {
    margin-bottom: 20px;
  }

  .field {
    margin-top: 16px;
  }

  .form-row {
    margin: 20px 0 24px;
  }

  .divider {
    margin: 22px 0;
  }
}
