* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
}

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

body.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: #f4f1fa;
  background: #070914;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scene {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  background-color: #060812;
  background-image: url("./assets/login-background.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.light-ray,
.floor-glow {
  display: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 530px;
  min-height: 640px;
  padding: 64px 52px 42px;
  border: 1px solid rgba(183, 184, 203, 0.34);
  border-radius: 27px;
  background:
    radial-gradient(110% 82% at -4% -3%, rgba(136, 113, 186, 0.27) 0%, rgba(98, 78, 151, 0.14) 39%, rgba(49, 39, 83, 0) 69%),
    linear-gradient(180deg, rgba(19, 22, 39, 0.72), rgba(8, 10, 20, 0.84)),
    rgba(8, 10, 20, 0.76);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px) saturate(108%);
  -webkit-backdrop-filter: blur(18px) saturate(108%);
}

.login-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.brand-moon {
  display: block;
  width: 68px;
  height: 68px;
  margin-bottom: 17px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(164, 119, 235, 0.24));
  user-select: none;
  pointer-events: none;
}

.login-brand h1 {
  margin: 0;
  color: #f4f0f8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(204, 189, 229, 0.05);
}

.login-brand p {
  margin: 12px 0 0;
  color: rgba(220, 215, 234, 0.62);
  font-size: 14px;
  line-height: 1.4;
}

.brand-divider {
  width: 42px;
  height: 2px;
  margin-top: 17px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(181, 135, 226, 0.90), transparent);
  box-shadow: 0 0 8px rgba(160, 112, 208, 0.24);
}

.login-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 9px;
}

.field-label {
  color: rgba(231, 228, 240, 0.78);
  font-size: 14px;
  font-weight: 500;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap input {
  width: 100%;
  height: 58px;
  border: 1px solid rgba(125, 128, 151, 0.48);
  border-radius: 8px;
  padding: 0 52px 0 51px;
  color: #f3f1f8;
  background:
    linear-gradient(180deg, rgba(22, 25, 41, 0.98), rgba(15, 18, 31, 0.98));
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 5px 14px rgba(0, 0, 0, 0.08);
  font-size: 16px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.input-wrap input::placeholder {
  color: rgba(207, 205, 220, 0.40);
}

.input-wrap input:focus {
  border-color: rgba(169, 154, 207, 0.76);
  background:
    linear-gradient(180deg, rgba(24, 27, 44, 0.99), rgba(16, 19, 33, 0.99));
  box-shadow:
    0 0 0 2px rgba(135, 107, 181, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.field-icon,
.password-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 17px;
  color: rgba(181, 181, 202, 0.70);
  transform: translateY(-50%);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 11px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  padding: 0;
  color: rgba(181, 181, 203, 0.72);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover:not(:disabled) {
  color: rgba(231, 226, 244, 0.92);
}

.login-submit {
  width: 100%;
  height: 60px;
  margin-top: 14px;
  border: 1px solid rgba(242, 240, 251, 0.24);
  border-radius: 8px;
  padding: 0;
  color: #15151f;
  background:
    linear-gradient(
      180deg,
      #d8d5e9 0%,
      #c4c1dc 28%,
      #a8a6c7 60%,
      #8585ad 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.40),
    0 11px 26px rgba(112, 87, 151, 0.17);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}

.login-submit:hover:not(:disabled) {
  filter: brightness(1.035);
  transform: translateY(-1px);
}

.login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.invite-register {
  margin: -8px 0 0;
  color: rgba(211, 205, 225, 0.48);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.invite-register a {
  color: rgba(214, 196, 244, 0.82);
  text-decoration: none;
  transition: color 150ms ease, text-shadow 150ms ease;
}

.invite-register a:hover,
.invite-register a:focus-visible {
  color: #f1e9ff;
  text-shadow: 0 0 12px rgba(168, 120, 225, 0.28);
  outline: none;
}

.auth-error {
  min-height: 21px;
  margin: -3px 0 0;
  color: #e8a0ae;
  font-size: 13px;
  line-height: 21px;
  text-align: center;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f3f1f8;
  caret-color: #f3f1f8;
  -webkit-box-shadow: 0 0 0 1000px rgb(18, 21, 35) inset;
  transition: background-color 9999s ease-out;
}

@media (max-width: 680px) {
  body.login-page {
    overflow-y: auto;
  }

  .scene {
    padding:
      max(18px, env(safe-area-inset-top))
      16px
      max(18px, env(safe-area-inset-bottom));
  }


  .login-card {
    width: min(100%, 430px);
    min-height: auto;
    padding: 34px 24px 26px;
  }

  .brand-moon {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
  }

  .login-brand h1 {
    font-size: 34px;
  }

  .input-wrap input,
  .login-submit {
    height: 52px;
  }

  .login-submit {
    margin-top: 8px;
  }
}

@media (max-height: 760px) and (min-width: 681px) {
  .scene {
    padding: 18px;
  }

  .login-card {
    width: 500px;
    min-height: auto;
    padding: 34px 48px 27px;
  }

  .brand-moon {
    width: 56px;
    height: 56px;
    margin-bottom: 13px;
  }

  .login-brand {
    margin-bottom: 22px;
  }

  .login-brand h1 {
    font-size: 36px;
  }

  .login-brand p {
    margin-top: 9px;
  }

  .brand-divider {
    margin-top: 13px;
  }

  .input-wrap input {
    height: 52px;
  }

  .login-submit {
    height: 54px;
    margin-top: 8px;
  }
}


/* DMINOR_LOGIN_INTERACTION_GUARD_V1_20260722 */
.login-page,
.login-page * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.login-page input,
.login-page textarea,
.login-page select,
.login-page [contenteditable=""],
.login-page [contenteditable="true"],
.login-page [contenteditable="plaintext-only"] {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* DMINOR_LOGIN_FRAME_V6_20260723
   The crescent's alpha retains only its original light and halo, leaving the
   surrounding card background fully visible behind the Dminor heading. */
.login-card {
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 3px;
  border: 1px solid rgba(196, 188, 225, 0.18);
  border-radius: 23px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 0 0 1px rgba(111, 92, 155, 0.06);
  pointer-events: none;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.brand-moon {
  visibility: hidden;
}

.login-brand {
  position: relative;
}

.login-brand::before {
  content: "";
  position: absolute;
  top: -38px;
  left: 50%;
  z-index: 2;
  width: 160px;
  height: 160px;
  background: url("./assets/login-card-moon-feathered.png") center / contain no-repeat;
  pointer-events: none;
  transform: translateX(-50%);
}

@media (max-width: 680px) {
  .login-brand::before {
    top: -35px;
    width: 140px;
    height: 140px;
  }
}

@media (max-height: 760px) and (min-width: 681px) {
  .login-brand::before {
    top: -35px;
    width: 140px;
    height: 140px;
  }
}
