:root {
  color-scheme: light;
  --page: #f4f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #64727c;
  --line: #d8e0e4;
  --primary: #126e82;
  --primary-dark: #0c5262;
  --danger: #b23b3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}

button,
input {
  font: inherit;
}

.login-shell {
  flex: 1;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.login-panel {
  width: min(100%, 380px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(28, 46, 54, 0.08);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-size: 23px;
  font-weight: 800;
}

.company-name {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.access-label {
  margin: 8px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

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

label {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fbfcfd;
  font-size: 16px;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 110, 130, 0.12);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 68px;
}

.visibility-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 58px;
  height: 40px;
  border: 0;
  color: var(--primary-dark);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.login-status {
  min-height: 22px;
  margin: 2px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.login-button {
  width: 100%;
  height: 48px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 800;
}

.login-button:active {
  background: var(--primary-dark);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .login-shell {
    align-items: start;
    padding-top: max(64px, calc(env(safe-area-inset-top) + 36px));
  }

  .login-panel {
    padding: 26px 22px;
  }

  .site-footer {
    padding-top: 10px;
  }
}
