:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #242827;
  --muted: #6f7774;
  --line: #e3e8e5;
  --soft: #f4f7f5;
  --accent: #20c050;
  --accent-strong: #168c3d;
  --accent-soft: #edf9f1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: #ffffff;
}

body[data-portal="admin"] {
  --accent: #0080f0;
  --accent-strong: #0867b9;
  --accent-soft: #edf6ff;
}

body[data-portal="supplier"] {
  --accent: #f08000;
  --accent-strong: #b85f00;
  --accent-soft: #fff5e8;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(420px, 0.92fr);
}

.login-intro {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 46px clamp(42px, 6vw, 92px);
  background: var(--accent-soft);
}

.login-intro::before,
.login-intro::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.login-intro::before {
  width: 420px;
  height: 420px;
  right: -210px;
  top: -150px;
}

.login-intro::after {
  width: 250px;
  height: 250px;
  left: -130px;
  bottom: -90px;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.login-brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 9px 24px rgba(40, 75, 99, 0.13);
}

.login-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand > span:last-child { display: grid; gap: 2px; }
.login-brand strong { font-size: 22px; letter-spacing: 0.08em; }
.login-brand small { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }

.intro-copy {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin: auto 0 44px;
}

.portal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.intro-copy h1 {
  max-width: 590px;
  margin: 24px 0 18px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.intro-copy p {
  max-width: 570px;
  margin: 0;
  color: #59625f;
  font-size: 16px;
  line-height: 1.9;
}

.intro-points {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.intro-point {
  min-height: 88px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, white);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
}

.intro-point strong,
.intro-point span { display: block; }
.intro-point strong { margin-bottom: 7px; font-size: 14px; }
.intro-point span { color: var(--muted); font-size: 12px; line-height: 1.55; }

.login-page-code {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px clamp(32px, 6vw, 86px);
}

.portal-tabs {
  width: min(100%, 470px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 0 auto 26px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.portal-tabs a {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.portal-tabs a[aria-current="page"] {
  color: var(--accent-strong);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(35, 45, 40, 0.06);
}

.login-card { width: min(100%, 470px); margin: 0 auto; }

.login-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.login-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 800;
}

.login-heading h2 { margin: 0 0 5px; font-size: 25px; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }

.login-field { display: grid; gap: 9px; margin-bottom: 18px; }
.login-field > span:first-child { color: #444b48; font-size: 13px; font-weight: 650; }

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d9dfdc;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.password-input { position: relative; display: block; }
.password-input input { padding-right: 64px; }
.password-input button {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.captcha-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.captcha-image-button {
  height: 48px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9dfdc;
  border-radius: 10px;
  background: #f8faf9;
  cursor: pointer;
}

.captcha-image-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
  outline-offset: 2px;
}

.captcha-image-button:disabled { cursor: wait; opacity: 0.65; }
.captcha-image-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.captcha-help { margin-top: -2px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.login-message {
  min-height: 22px;
  margin: -3px 0 10px;
  color: #a24e59;
  font-size: 13px;
}

.login-message.success { color: var(--accent-strong); }

.login-submit {
  width: 100%;
  height: 49px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: var(--accent-strong);
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.login-submit:hover { background: color-mix(in srgb, var(--accent-strong) 88%, #1f2824); }
.login-submit:disabled { opacity: 0.58; cursor: wait; }

.login-support { margin: 22px auto 0; color: #8a918e; font-size: 12px; text-align: center; }

@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 28px 24px 30px; }
  .intro-copy { margin: 70px 0 30px; }
  .intro-copy h1 { font-size: clamp(34px, 9vw, 52px); }
  .login-panel { min-height: auto; padding: 34px 24px 48px; }
}

@media (max-width: 540px) {
  .intro-points { grid-template-columns: 1fr; }
  .intro-point { min-height: 0; }
  .portal-tabs { margin-bottom: 24px; }
  .captcha-input { grid-template-columns: minmax(0, 1fr) 132px; }
}
