:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #171815;
  color: #f7f1df;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

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

body {
  min-height: 100vh;
  min-height: 100svh;
  background: #171815;
}

.login-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.machine-scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 150svh);
  aspect-ratio: 3 / 2;
  transform: translate(-50%, -50%);
  background: #171815 url('/assets/boba-weathered-machine.jpg') center / cover no-repeat;
}

.control-panel {
  position: absolute;
  top: 57%;
  left: 50%;
  display: grid;
  width: clamp(220px, 18.4%, 246px);
  gap: 6px;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
}

label {
  color: #d8c7a8;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  text-shadow: 0 1px 2px #000;
}

input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(206, 159, 87, 0.6);
  border-radius: 3px;
  outline: none;
  background: rgba(31, 31, 29, 0.9);
  color: #f5eddb;
  font: inherit;
  font-size: 14px;
  box-shadow: inset 0 1px 7px rgba(0, 0, 0, 0.7);
}

input:focus-visible {
  border-color: #efbd65;
  box-shadow: 0 0 0 2px #171815, 0 0 0 4px #efbd65;
}

button {
  width: 100%;
  min-height: 40px;
  margin-top: 2px;
  border: 1px solid #6b3d23;
  border-radius: 3px;
  background: #9f5f2f;
  color: #fff3dc;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

button:hover {
  background: #bc7a3d;
}

button:focus-visible {
  outline: 2px solid #f7f1df;
  outline-offset: 2px;
}

.form-error {
  display: none;
  margin: 0;
  padding: 5px 6px;
  border-left: 3px solid #ff8d77;
  background: #512a27;
  color: #fff0e9;
  font-size: 10px;
  line-height: 1.25;
}

.form-error.is-visible {
  display: block;
}

.attribution {
  position: absolute;
  top: 88%;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(247, 241, 223, 0.72);
  font-size: 10px;
  text-align: center;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .control-panel {
    top: 58%;
    width: clamp(218px, 18.4%, 234px);
    gap: 5px;
  }

  input {
    height: 34px;
  }

  button {
    min-height: 36px;
  }
}

@media (max-height: 520px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .login-stage {
    min-height: 640px;
    overflow: visible;
  }

  .machine-scene {
    top: 0;
    width: max(100vw, 960px);
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
