/* ---- Lock page + full-bleed stage under navbar ---- */
html, body {
  height: 100%;
  overflow: hidden;
  background: #0b111a;
}

.login-container {
  --navbar-h: 60px;

  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 0;
}

.login-container::before {
  content: "";
  position: absolute;
  inset: 0;

  background: #0f1621;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  filter: brightness(0.9);
  z-index: -2;
}

/* Full-screen neon wash behind */
.login-container::after {
  content: "";
  position: absolute;
  inset: 0;

  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(42% 48% at 18% 12%, rgba(255, 0, 153, 0.45), transparent 60%),
    radial-gradient(48% 54% at 82% 18%, rgba(0, 221, 255, 0.40), transparent 62%),
    radial-gradient(50% 60% at 50% 96%, rgba(255, 176, 0, 0.38), transparent 60%),
    radial-gradient(120% 120% at 50% 50%, rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.38));
}

/* ---- Softer “screenshot” card style ---- */
.login-card {
  width: 100%;
  max-width: 420px;

  padding: 28px 26px;
  border-radius: 22px;

  position: relative;
  overflow: hidden;
  color: #fff;

  /* glass effect */
  background: rgba(16, 25, 36, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);

  /* border + subtle shadow */
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

/* Subtle inner multicolor wash */
.login-card::before {
  content: "";
  position: absolute;
  inset: -35% -28%;
  border-radius: 24px;

  background:
    radial-gradient(44% 52% at 20% 22%, rgba(255, 0, 153, 0.22), transparent 60%),
    radial-gradient(46% 54% at 82% 22%, rgba(0, 221, 255, 0.18), transparent 62%),
    radial-gradient(52% 60% at 45% 96%, rgba(255, 176, 0, 0.18), transparent 60%);

  filter: blur(18px) saturate(140%);
  z-index: 0;
  pointer-events: none;
}

/* Soft external halo */
.login-card::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: calc(22px + 14px);

  background:
    radial-gradient(60% 70% at 80% 72%, rgba(255, 0, 153, 0.20), transparent 70%),
    radial-gradient(55% 65% at 78% 22%, rgba(0, 221, 255, 0.16), transparent 70%),
    radial-gradient(65% 75% at 30% 95%, rgba(255, 176, 0, 0.14), transparent 75%);

  filter: blur(22px);
  z-index: -1;
  pointer-events: none;
}

/* Ensure content stays above card effects */
.login-card > * {
  position: relative;
  z-index: 2;
}

/* ---- Headings, inputs, buttons ---- */
.login-card h2 {
  text-align: center;
  margin: 6px 0 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.login-card label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.95rem;
  opacity: 0.95;
}

.login-card .input {
  width: 100%;
  padding: 12px;

  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);

  color: #fff;
  outline: none;

  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.login-card .input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.login-card .input:focus {
  border-color: rgba(0, 221, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(0, 221, 255, 0.25);
  background: rgba(255, 255, 255, 0.18);
}

.login-actions {
  margin-top: 16px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  border: 0;
  padding: 12px 16px;

  cursor: pointer;
  border-radius: 10px;
  font-weight: 600;
  color: #0f1621;

  background: linear-gradient(135deg, #00ddff, #ffb000 70%);
  box-shadow: 0 6px 18px rgba(0, 221, 255, 0.35);

  transition: transform 0.08s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 221, 255, 0.45);
}

.btn-primary:active {
  transform: none;
}

.back-link {
  color: #fff;
  text-decoration: underline;
  opacity: 0.9;
}

.back-link:hover {
  opacity: 1;
}

.error {
  background: rgba(255, 0, 92, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 10px 12px;

  border-radius: 10px;
  margin-bottom: 12px;
  text-align: center;
}

/* ---- Dark mode tweak ---- */
@media (prefers-color-scheme: dark) {
  .login-container::before {
    filter: brightness(0.85);
  }
}

.success {
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  text-align: center;
  color: #ffffff;
}

.muted {
  color: rgba(255, 255, 255, 0.82);
}

.login-help {
  margin: -4px 0 14px;
  text-align: center;
  line-height: 1.45;
  font-size: 0.94rem;
}

.login-form {
  margin: 0;
}

.otp-code-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.28rem;
  font-weight: 800;
  padding-left: calc(12px + 0.4em);
}

.otp-resend-form {
  margin: 14px 0 0;
  text-align: center;
}

.otp-resend-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.btn-primary:disabled,
.otp-resend-button:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

@media (max-width: 640px) {
  html,
  body {
    min-height: 100%;
    overflow: auto;
  }

  .login-container {
    position: fixed;
    top: var(--navbar-h);
    min-height: calc(100dvh - var(--navbar-h));
    padding: 16px;
    align-items: center;
  }

  .login-card {
    max-width: none;
    width: min(100%, 390px);
    padding: 24px 20px;
    border-radius: 20px;
  }

  .login-card h2 {
    margin-top: 2px;
    margin-bottom: 14px;
    font-size: 1.45rem;
  }

  .login-help {
    font-size: 0.9rem;
  }

  .login-card .input {
    min-height: 48px;
    font-size: 16px;
  }

  .otp-code-input {
    letter-spacing: 0.32em;
    font-size: 1.35rem;
    padding-left: calc(12px + 0.32em);
  }

  .login-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-primary {
    width: 100%;
    min-height: 48px;
  }

  .back-link {
    text-align: center;
  }
}

@media (max-width: 380px) {
  .login-container {
    padding: 12px;
  }

  .login-card {
    padding: 22px 16px;
  }

  .otp-code-input {
    letter-spacing: 0.24em;
    padding-left: calc(12px + 0.24em);
  }
}


/* ---- Passkey login ---- */
.passkey-login-panel {
  margin: 0 0 8px;
}

.passkey-login-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.28);
  transition: transform 0.08s, background 0.2s, box-shadow 0.2s;
}

.passkey-login-button:hover {
  transform: translateY(-1px);
  background: #b91c1c;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.4);
}

.passkey-login-button:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.passkey-login-status {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.52);
  color: #ffffff;
  text-align: center;
  line-height: 1.4;
}

.passkey-login-status.is-error {
  background: rgba(220, 38, 38, 0.32);
}

.passkey-login-status.is-ok {
  background: rgba(34, 197, 94, 0.25);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.login-divider span {
  flex: 0 0 auto;
}
