:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  background: #edf2ef;
  color: #18211e;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; }
button, input, select { font: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 640px);
  padding: 34px;
  border: 1px solid #dfe5e2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(25, 47, 39, .12);
}

.eyebrow {
  margin: 0 0 8px;
  color: #176b52;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

h1 { margin: 0; font-size: 28px; }
.description { margin: 10px 0 28px; color: #62706b; line-height: 1.6; }
form { display: grid; gap: 10px; }
label { margin-top: 6px; color: #34423d; font-size: 14px; font-weight: 700; }

.identity-picker {
  display: grid;
  gap: 12px;
  margin: 0 0 6px;
  padding: 16px;
  border: 1px solid #d7e7e0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f2faf6 0%, #fbfdfc 100%);
}

.identity-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  cursor: pointer;
}

.identity-heading > span:last-child { display: grid; gap: 3px; }
.identity-heading strong { color: #24332e; font-size: 15px; }
.identity-heading small { color: #71807a; font-size: 12px; font-weight: 400; }

.identity-icon {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: #e2f1eb;
  color: #176b52;
}

.identity-icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.select-wrap { position: relative; }
.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #527168;
  border-bottom: 2px solid #527168;
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap select {
  height: 50px;
  padding: 0 46px 0 14px;
  appearance: none;
  border-color: #b9d2c9;
  background: #fff;
  color: #24332e;
  cursor: pointer;
  font-weight: 600;
}

.select-wrap select:invalid { color: #77837f; font-weight: 400; }
.select-wrap:focus-within::after { border-color: #176b52; }

.role-description {
  min-height: 20px;
  margin: -2px 2px 0;
  color: #597067;
  font-size: 12px;
  line-height: 1.6;
}

input, select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #c7d1cc;
  border-radius: 6px;
  background: #fff;
  color: #18211e;
}

input:focus, select:focus, button:focus-visible {
  outline: 3px solid #b9e6d8;
  outline-offset: 2px;
}

#login-error {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 5px;
  background: #fff0ee;
  color: #9c2f23;
  font-size: 14px;
}

button {
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 6px;
  background: #176b52;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) { background: #0e5741; }
button:disabled { cursor: wait; opacity: .58; }

.link-button {
  min-height: auto;
  margin-top: 2px;
  padding: 9px;
  color: #176b52;
  background: transparent;
}
.link-button:hover:not(:disabled) { background: #eef7f3; }

dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 10px; color: #18211e; box-shadow: 0 18px 48px rgba(25,47,39,.2); }
dialog::backdrop { background: rgba(23,51,43,.56); }
dialog form { padding: 26px; gap: 12px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-close,.secondary-button { width: auto; min-height: 38px; margin: 0; padding: 8px 12px; border: 1px solid #c7d1cc; color: #34423d; background: #fff; }
.dialog-close:hover:not(:disabled),.secondary-button:hover:not(:disabled) { background: #f2f6f4; }
.dialog-copy { margin: 0 0 5px; color: #62706b; font-size: 13px; line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.dialog-actions button { width: auto; margin: 0; padding-inline: 18px; }
.reset-code-fields { display: grid; gap: 12px; margin-top: 5px; padding-top: 18px; border-top: 1px solid #e2e8e5; }
.form-message { margin: 6px 0 0; padding: 10px 12px; border-radius: 5px; color: #176b52; background: #e7f4ef; font-size: 13px; line-height: 1.55; }
.form-message.error { color: #9c2f23; background: #fff0ee; }
dialog b { color: #ad3e3e; }

@media (max-width: 480px) {
  .login-shell { padding: 16px; }
  .login-card { padding: 26px 22px; }
}
