:root {
  --ink: #202521;
  --muted: #69736b;
  --subtle: #9aa39b;
  --line: #e2ded5;
  --cream: #f6f1e8;
  --paper: #fffaf2;
  --coffee: #593f2c;
  --coffee-dark: #241a14;
  --gold: #c7964a;
  --green: #2e7352;
  --error: #b94f47;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  min-height: 100vh;
  color: var(--ink);
  background: #eef3ee;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  align-items: center;
  min-height: 100vh;
  padding: 54px 9vw;
  overflow: hidden;
  background: url("./assets/admin-login-bg.jpg") center/cover;
}

.login-stage,
.login-card {
  position: relative;
  z-index: 1;
}

.login-stage {
  min-height: 650px;
  padding: 28px 0;
}

.login-logo {
  display: grid;
  place-items: center;
  color: #1d241f;
  background: linear-gradient(135deg, #f4cf78, #bf8940);
  border-radius: 14px;
  font-weight: 850;
}

.login-card {
  width: 100%;
  padding: 48px 46px 42px;
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(57, 48, 38, 0.18);
  backdrop-filter: blur(18px);
}

.login-logo {
  width: 62px;
  height: 62px;
  margin: 0 auto 26px;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(151, 105, 47, 0.24);
}

.login-card h2 {
  margin: 0 0 34px;
  color: var(--coffee-dark);
  font-size: 30px;
  line-height: 1.18;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--coffee);
  font-size: 14px;
  font-weight: 720;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dfcdb5;
  border-radius: 8px;
  outline: none;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(199, 150, 74, 0.18);
}

.password-wrap {
  position: relative;
}

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

.text-button {
  position: absolute;
  top: 5px;
  right: 6px;
  height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
}

.text-button:hover {
  color: var(--coffee);
  background: #f4ece0;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 20px;
  margin-top: -6px;
}

.link-button,
.back-button {
  color: var(--coffee);
  background: transparent;
  border: 0;
  font-weight: 720;
}

.link-button {
  padding: 0;
  font-size: 13px;
}

.back-button {
  min-height: 38px;
  border-radius: 8px;
}

.link-button:hover,
.back-button:hover {
  color: var(--coffee-dark);
  background: #f4ece0;
}

.login-button {
  height: 48px;
  color: #fffaf2;
  background: linear-gradient(135deg, #8d5d32, #c9823d);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(151, 90, 43, 0.25);
  font-weight: 820;
}

.login-button:hover {
  filter: brightness(0.96);
}

.secondary-button {
  height: 44px;
  color: var(--coffee);
  background: #fff6e6;
  border: 1px solid #dfcdb5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: var(--subtle);
  background: #f1ece3;
}

.reset-dialog {
  width: min(440px, calc(100vw - 36px));
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.reset-dialog::backdrop {
  background: rgba(36, 26, 20, 0.36);
  backdrop-filter: blur(8px);
}

.reset-modal {
  position: relative;
  padding: 30px;
  background: rgba(255, 250, 242, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(36, 26, 20, 0.24);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f6ecdc;
  border: 1px solid #ead8be;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--coffee-dark);
  background: #fff6e6;
}

.reset-modal-header {
  margin: 0 44px 22px 0;
}

.reset-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  color: #244a2e;
  background: #edf6ec;
  border: 1px solid rgba(36, 74, 46, 0.2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 760;
}

.reset-modal h3 {
  margin: 12px 0 0;
  color: var(--coffee-dark);
  font-size: 24px;
  line-height: 1.2;
}

.reset-form {
  gap: 16px;
}

.reset-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reset-steps span {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--muted);
  background: #fff6e6;
  border: 1px solid #ead8be;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.reset-steps .is-active {
  color: #244a2e;
  background: #edf6ec;
  border-color: rgba(36, 74, 46, 0.24);
}

.code-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.form-hint {
  min-height: 20px;
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
}

.form-hint.is-error {
  color: var(--error);
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .login-page {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 32px 20px;
  }

  .login-stage {
    min-height: 360px;
    padding: 18px;
  }

  .login-card {
    max-width: 520px;
    margin: 20px auto 0;
  }

  .reset-dialog {
    margin-top: auto;
    margin-bottom: auto;
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 36px 24px 30px;
  }

  .login-card h2 {
    font-size: 25px;
  }

  .reset-modal {
    padding: 24px 20px 22px;
  }

  .code-field {
    grid-template-columns: 1fr;
  }
}
