:root {
  color-scheme: dark;
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, "Helvetica Neue", Inter, sans-serif;
  font-optical-sizing: auto;
  letter-spacing: -0.011em;
  color: #e8eef9;
  background: #0a0e17;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgb(94 234 212 / 12%), transparent 50%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgb(232 121 249 / 8%), transparent 45%),
    linear-gradient(180deg, #0f1522, #0a0e17);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.login-card {
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 40%),
    rgb(16 22 36 / 92%);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 6%),
    0 28px 72px rgb(0 0 0 / 48%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  color: #042f2e;
  background: linear-gradient(135deg, #5eead4, #818cf8 55%, #e879f9);
  font-size: 22px;
  font-weight: 800;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 12%),
    0 12px 28px rgb(94 234 212 / 18%);
}

h1 {
  margin: 20px 0 0;
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 650;
}

.login-card > p {
  margin: 8px 0 26px;
  color: #8b97b0;
  font-size: 14px;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 10px;
}

label {
  color: #aeb9d0;
  font-size: 12px;
  font-weight: 650;
}

.key-row {
  position: relative;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 92px 0 14px;
  border: 1px solid #2a354d;
  border-radius: 12px;
  outline: none;
  color: #e8eef9;
  background: #0a0e17;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 16px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input:focus {
  border-color: rgb(94 234 212 / 55%);
  box-shadow: 0 0 0 3px rgb(94 234 212 / 16%);
}

.toggle-key {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #8b97b0;
  background: #182034;
  cursor: pointer;
  touch-action: manipulation;
}

.toggle-key:hover {
  color: #e8eef9;
  background: #222c44;
}

.error {
  margin: 0;
  color: #fca5a5;
  font-size: 12px;
}

.submit {
  min-height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  color: #042f2e;
  background: linear-gradient(145deg, #99f6e4, #5eead4);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 24px rgb(94 234 212 / 18%);
  touch-action: manipulation;
  transition: transform 120ms ease, filter 120ms ease;
}

.submit:hover:not(:disabled) {
  filter: brightness(1.04);
}

.submit:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(0.98);
}

.submit:disabled {
  cursor: default;
  opacity: 0.55;
}

.toggle-key:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px 18px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card,
  .submit,
  input,
  .toggle-key {
    transition:
      opacity 200ms ease,
      border-color 200ms ease,
      background-color 200ms ease,
      box-shadow 200ms ease !important;
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .login-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #101624;
  }
}
