:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: #f2f2f7;
  color: #111114;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100dvh;
  background: #f2f2f7;
}

.login-shell {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: min(100%, 25rem);
  padding: 2.5rem 2rem 2rem;
  border: 1px solid #e0e0e5;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 8px 32px rgb(0 0 0 / 12%);
}

.brand {
  margin-bottom: 2rem;
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(100%, 13.75rem);
  height: auto;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

h1 {
  margin: 0;
  color: #111114;
  font-size: 1.375rem;
  font-weight: 700;
}

.brand p {
  margin: 0.25rem 0 0;
  color: #6e6e73;
  font-size: 0.875rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

label {
  margin-top: 0.25rem;
  color: #111114;
  font-size: 0.8rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #d7d7dc;
  border-radius: 0.5rem;
  background: #f8f8fa;
  color: #111114;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

input:focus {
  border-color: #e97316;
  box-shadow: 0 0 0 3px rgb(233 115 22 / 18%);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 4.75rem;
}

.toggle-visibility {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  transform: translateY(-50%);
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #4b4b52;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-visibility:hover {
  background: rgb(0 0 0 / 6%);
}

.toggle-visibility:focus-visible,
.link-button:focus-visible,
.submit:focus-visible {
  outline: 2px solid #e97316;
  outline-offset: 2px;
}

.hint {
  margin: -0.25rem 0 0;
  color: #b45309;
  font-size: 0.8rem;
  font-weight: 600;
}

.link-button {
  align-self: center;
  margin-top: 0.25rem;
  padding: 0.375rem 0.5rem;
  border: 0;
  background: transparent;
  color: #c2410c;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.submit {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: #e97316;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.submit:disabled {
  background: #fb923c;
  cursor: wait;
}

.message {
  margin: 0.25rem 0 0;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
}

.message.error {
  border: 1px solid rgb(220 38 38 / 30%);
  background: rgb(220 38 38 / 10%);
  color: #b91c1c;
}

.message.status {
  border: 1px solid #d7d7dc;
  background: #f2f2f7;
  color: #4b4b52;
}

@media (prefers-color-scheme: dark) {
  :root,
  body {
    background: #1c1c1e;
    color: #fff;
  }

  .login-card {
    border-color: #3a3a3c;
    background: #2c2c2e;
  }

  h1,
  label {
    color: #fff;
  }

  .brand p {
    color: #a1a1a6;
  }

  input {
    border-color: #48484a;
    background: #1c1c1e;
    color: #fff;
  }

  .toggle-visibility {
    color: #d1d1d6;
  }

  .toggle-visibility:hover {
    background: rgb(255 255 255 / 10%);
  }

  .hint {
    color: #fbbf24;
  }

  .link-button {
    color: #fb923c;
  }

  .message.status {
    border-color: #48484a;
    background: #1c1c1e;
    color: #d1d1d6;
  }
}
[hidden] { display: none !important; }
