:root {
  --ink: #eef9ff;
  --muted: #8ca6ba;
  --cyan: #69e2ef;
  --blue: #4c88e8;
  --violet: #8164d4;
  --line: rgba(135, 215, 239, .2);
  --danger: #ff9ca8;
  --success: #7ee4c4;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: #04101d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }

.gateway {
  position: relative;
  min-height: 100svh;
  padding: 56px clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 470px);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  overflow: hidden;
}
.gateway-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 10, 19, .26), rgba(3, 10, 19, .1) 47%, rgba(3, 10, 19, .82) 100%),
    linear-gradient(180deg, rgba(1, 7, 14, .08), rgba(1, 7, 14, .64)),
    url("assets/ckwy-login.jpg") center / cover no-repeat;
}
.sky-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(100px); opacity: .2; }
.sky-glow-one { right: -120px; top: -160px; background: #5acde2; }
.sky-glow-two { right: 250px; bottom: -260px; background: #7558d6; }

.back-home {
  position: absolute;
  z-index: 5;
  top: 24px;
  left: clamp(20px, 4vw, 54px);
  padding: 9px 14px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(190, 230, 247, .2);
  border-radius: 20px;
  color: #c7dae9;
  background: rgba(4, 14, 26, .42);
  font-size: 12px;
  text-decoration: none;
  backdrop-filter: blur(12px);
}
.back-home:hover { border-color: rgba(105, 226, 239, .55); color: #fff; }

.gateway-brand { position: relative; z-index: 2; align-self: end; padding-bottom: 70px; text-shadow: 0 7px 30px rgba(0,0,0,.45); }
.gateway-brand p { margin: 0 0 9px; color: #a0ecf4; font-size: 10px; font-weight: 800; letter-spacing: .24em; }
.gateway-brand h1 {
  margin: 0;
  font: 700 clamp(62px, 8vw, 112px)/.95 Georgia, "STKaiti", serif;
  letter-spacing: .08em;
  background: linear-gradient(120deg, #fff, #a8f2f8 48%, #b3a2ff);
  color: transparent;
  background-clip: text;
}
.gateway-brand > span { display: block; margin-top: 18px; color: #d4e5f0; font: 600 16px Georgia, "STKaiti", serif; letter-spacing: .14em; }

.auth-card {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(139, 220, 240, .27);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(8, 24, 40, .94), rgba(5, 14, 29, .97));
  box-shadow: 0 35px 110px rgba(0, 5, 14, .68), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(24px);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 100% 0%, rgba(101, 218, 239, .12), transparent 33%);
}
.auth-card-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.auth-card-top p { margin: 0; color: #6386a1; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.auth-card-top h2 { margin: 5px 0 0; font: 700 27px/1.2 Georgia, "STKaiti", serif; letter-spacing: .04em; }
.server-state { display: inline-flex; gap: 7px; align-items: center; color: #7eb79f; font-size: 10px; white-space: nowrap; }
.server-state i { width: 7px; height: 7px; border-radius: 50%; background: #67dfb5; box-shadow: 0 0 12px #67dfb5; }

.auth-tabs { position: relative; margin: 23px 0 21px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(129, 193, 223, .13); border-radius: 13px; background: rgba(2, 10, 21, .62); }
.auth-tab { min-height: 42px; border: 0; border-radius: 9px; color: #718ca2; background: transparent; font-size: 13px; font-weight: 800; transition: .2s; }
.auth-tab.is-active { color: #f4fcff; background: linear-gradient(110deg, rgba(43, 123, 180, .8), rgba(100, 76, 180, .82)); box-shadow: 0 7px 20px rgba(46, 79, 169, .2); }

.auth-form { position: relative; display: grid; gap: 14px; }
.auth-form.is-hidden { display: none; }
.auth-form label > span { display: block; margin: 0 0 6px 3px; color: #9cb2c4; font-size: 11px; font-weight: 700; }
.auth-form input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid rgba(126, 182, 211, .2);
  border-radius: 11px;
  outline: none;
  color: #f0f8ff;
  background: rgba(2, 9, 20, .78);
  font-size: 16px;
  letter-spacing: .14em;
  transition: border-color .2s, box-shadow .2s;
}
.auth-form input::placeholder { color: #4f687c; font-size: 12px; letter-spacing: .03em; }
.auth-form input:focus { border-color: rgba(101, 224, 239, .72); box-shadow: 0 0 0 3px rgba(87, 202, 224, .09); }
.auth-form input[aria-invalid="true"] { border-color: rgba(255, 129, 145, .75); box-shadow: 0 0 0 3px rgba(255, 117, 137, .08); }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 8px; min-width: 44px; padding: 6px; border: 0; color: #78aec6; background: transparent; font-size: 10px; transform: translateY(-50%); }
.form-message { min-height: 19px; margin: -2px 3px 0; color: var(--danger); font-size: 11px; }
.form-message.is-success { color: var(--success); }
.submit-button {
  min-height: 51px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(111, 226, 241, .5);
  border-radius: 11px;
  color: #f7fdff;
  background: linear-gradient(110deg, #287fb7, #5266c4 55%, #7758bd);
  box-shadow: 0 15px 35px rgba(54, 86, 191, .27), inset 0 1px rgba(255,255,255,.2);
  font-size: 13px;
  font-weight: 800;
  transition: transform .2s, filter .2s;
}
.submit-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.submit-button:disabled { cursor: wait; filter: grayscale(.35); opacity: .68; transform: none; }
.submit-button i { font-size: 20px; font-style: normal; }
.switch-hint { border: 0; color: #6e879b; background: transparent; font-size: 11px; }
.switch-hint b { color: var(--cyan); }

.security-note { position: relative; margin-top: 21px; padding: 13px 14px; display: flex; gap: 10px; border: 1px solid rgba(102, 202, 220, .1); border-radius: 12px; background: rgba(26, 70, 85, .11); }
.security-note > span { flex: 0 0 auto; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #7ce0c2; background: rgba(80, 207, 169, .1); font-size: 10px; }
.security-note p { margin: 0; color: #6c879a; font-size: 10px; line-height: 1.6; }
.security-note b { display: block; color: #a9c0cf; font-size: 11px; }

.healthy-copy { position: absolute; z-index: 3; right: 0; bottom: 10px; left: 0; display: grid; gap: 2px; margin: 0; padding: 0 16px; color: rgba(191, 218, 233, .5); text-align: center; font-size: 9px; line-height: 1.45; letter-spacing: .04em; }
.healthy-copy p { margin: 0; }
.healthy-copy a { color: inherit; }

@media (max-width: 860px) {
  .gateway { grid-template-columns: 1fr; align-content: center; padding-top: 88px; padding-bottom: 70px; }
  .gateway-bg {
    background:
      linear-gradient(180deg, rgba(3, 10, 19, .18), rgba(3, 10, 19, .48) 45%, #04101d 100%),
      url("assets/ckwy-login.jpg") 57% center / cover no-repeat;
  }
  .gateway-brand { align-self: auto; padding: 0; text-align: center; }
  .gateway-brand h1 { font-size: clamp(52px, 14vw, 78px); }
  .gateway-brand > span { font-size: 13px; }
  .auth-card { width: min(470px, 100%); margin: 0 auto; }
}

@media (max-width: 520px) {
  .gateway { min-height: 100svh; padding: 92px 14px 62px; gap: 26px; }
  .back-home { top: 16px; left: 14px; }
  .gateway-brand p { font-size: 8px; }
  .gateway-brand > span { margin-top: 10px; font-size: 11px; }
  .auth-card { padding: 21px 18px; border-radius: 21px; }
  .auth-card-top h2 { font-size: 23px; }
  .server-state { font-size: 9px; }
  .auth-tabs { margin-top: 18px; }
}

@media (max-height: 650px) and (orientation: landscape) {
  .gateway { padding: 24px 5vw; grid-template-columns: 1fr 430px; gap: 40px; }
  .gateway-brand { align-self: center; padding: 0; text-align: left; }
  .gateway-brand h1 { font-size: 66px; }
  .auth-card { padding: 18px 22px; }
  .auth-card-top h2 { font-size: 22px; }
  .auth-tabs { margin: 13px 0; }
  .auth-form { grid-template-columns: 1fr 1fr; gap: 9px 12px; }
  .auth-form .form-message,
  .auth-form .submit-button,
  .auth-form .switch-hint { grid-column: 1 / -1; }
  #registerForm label:nth-of-type(3) { grid-column: 1 / -1; }
  .security-note { display: none; }
  .healthy-copy { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
