:root {
  --auth-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI Variable",
    "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --auth-ink: #0f1f46;
  --auth-body: #4b5f86;
  --auth-muted: #7c8dac;
  --auth-line: #d8e2f3;
  --auth-blue: #1768ff;
  --auth-blue-dark: #0c54e8;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(115, 171, 255, .19), transparent 31%),
    radial-gradient(circle at 88% 84%, rgba(98, 145, 255, .13), transparent 34%),
    #edf5ff;
  color: var(--auth-ink);
  font-family: var(--auth-font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }

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

.auth-shell {
  width: min(1480px, 100%);
  min-height: min(900px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, .98fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 34px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 24px 70px rgba(64, 108, 176, .16);
  backdrop-filter: blur(18px);
}

.auth-brand-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 48px 54px 34px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(222,237,255,.72)),
    radial-gradient(circle at 80% 18%, rgba(83,143,255,.2), transparent 38%);
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -12% -30% 18%;
  height: 68%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(72, 133, 255, .18), transparent 67%);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(28, 104, 255, .22));
}

.auth-brand-name {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--auth-ink);
}

.auth-brand-tagline {
  margin-left: 8px;
  color: var(--auth-body);
  font-size: 15px;
  font-weight: 500;
}

.auth-hero-copy {
  position: relative;
  z-index: 2;
  margin-top: 52px;
}

.auth-hero-copy h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.045em;
}

.auth-hero-copy h1 span {
  display: block;
  margin-top: 8px;
  color: var(--auth-blue);
}

.auth-hero-copy p {
  margin: 18px 0 0;
  color: var(--auth-body);
  font-size: 17px;
  line-height: 1.7;
}

.auth-benefits {
  position: relative;
  z-index: 2;
  width: 250px;
  margin-top: 34px;
  display: grid;
  gap: 14px;
}

.auth-benefit {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 14px;
}

.auth-benefit-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 117, 255, .2);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 8px 20px rgba(62, 122, 220, .11);
  color: var(--auth-blue);
}

.auth-benefit-icon svg { width: 24px; height: 24px; }

.auth-benefit strong {
  display: block;
  color: var(--auth-ink);
  font-size: 15px;
  font-weight: 650;
}

.auth-benefit small {
  display: block;
  margin-top: 2px;
  color: var(--auth-muted);
  font-size: 12px;
}

.auth-hero-art {
  position: absolute;
  z-index: 1;
  right: -4%;
  bottom: -2%;
  width: min(76%, 660px);
  max-height: 67%;
  object-fit: contain;
  object-position: right bottom;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 78% 78% at 59% 68%, #000 48%, transparent 91%);
  mask-image: radial-gradient(ellipse 78% 78% at 59% 68%, #000 48%, transparent 91%);
  opacity: .98;
  pointer-events: none;
}

.auth-form-panel {
  min-width: 0;
  margin: 18px;
  border: 1px solid rgba(226, 234, 248, .86);
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 45px rgba(42, 81, 139, .08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-form-topbar {
  min-height: 76px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--auth-body);
  font-size: 14px;
  font-weight: 500;
}

.auth-language {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-language svg { width: 18px; height: 18px; }

.auth-form-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.auth-form-wrap {
  width: min(540px, calc(100% - 64px));
  min-height: 100%;
  margin: 0 auto;
  padding: 48px 0 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-wrap.is-register {
  justify-content: flex-start;
  padding-top: 18px;
  padding-bottom: 32px;
}

.auth-title {
  margin: 0;
  color: var(--auth-ink);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.035em;
}

.auth-subtitle {
  margin: 10px 0 34px;
  color: var(--auth-body);
  font-size: 16px;
  font-weight: 400;
}

.auth-form { width: 100%; }

.auth-field { margin-bottom: 20px; }

.auth-label {
  display: block;
  margin-bottom: 8px;
  color: #25375c;
  font-size: 14px;
  font-weight: 600;
}

.auth-input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  width: 21px;
  height: 21px;
  color: #7387ad;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 54px;
  padding: 0 48px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #17284c;
  font-size: 15px;
  font-weight: 400;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-input.no-leading-icon { padding-left: 16px; }
.auth-input.no-trailing-icon { padding-right: 16px; }

.auth-input::placeholder { color: #9aa9c2; opacity: 1; }

.auth-input:focus {
  border-color: #6b9cff;
  box-shadow: 0 0 0 4px rgba(23,104,255,.09);
}

.auth-input-action {
  position: absolute;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #7387ad;
  cursor: pointer;
}

.auth-input-action svg { width: 21px; height: 21px; }

.auth-options {
  margin: 2px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--auth-body);
  font-size: 14px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--auth-body);
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
}

.auth-check input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 2px 0 0;
  accent-color: var(--auth-blue);
}

.auth-link {
  color: var(--auth-blue);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-primary,
.auth-secondary {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}

.auth-primary {
  border: 0;
  background: linear-gradient(180deg, #2d7cff 0%, #1261f4 100%);
  box-shadow: 0 12px 24px rgba(23,104,255,.22);
  color: #fff;
}

.auth-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(23,104,255,.27);
}

.auth-primary:disabled { opacity: .62; cursor: not-allowed; transform: none; }

.auth-secondary {
  border: 1px solid #76a2ff;
  background: #fff;
  color: var(--auth-blue);
}

.auth-secondary:hover { background: #f5f8ff; }

.auth-button-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.auth-button-inline svg {
  width: 21px;
  height: 21px;
}

.auth-divider {
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: #91a0ba;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: #e4eaf4;
}

.auth-consent {
  margin-top: 18px;
  justify-content: center;
  text-align: center;
}

.auth-consent-note {
  margin: 22px 0 0;
  color: #71819e;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  text-align: center;
}

.auth-legal {
  margin-top: 22px;
  color: #8a99b4;
  font-size: 12px;
  text-align: center;
}

.auth-legal a { color: #5875a8; text-decoration: none; }

.auth-captcha-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
}

.auth-captcha-row .auth-input { padding-left: 16px; padding-right: 16px; }

.auth-captcha-image {
  width: 132px;
  height: 54px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  object-fit: cover;
  cursor: pointer;
}

.auth-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-grid-two .auth-field { min-width: 0; }

.auth-strength { margin-top: 7px; }

.strength-bar { display: flex; gap: 5px; height: 4px; }
.strength-bar div { flex: 1; background: #e6eaf1; border-radius: 999px; }
#strength-text { margin-top: 4px; color: var(--auth-muted); font-size: 12px; }

/* Existing login CAPTCHA modal */
#captcha-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15,31,70,.46);
  backdrop-filter: blur(5px);
}

.captcha-box {
  position: relative;
  width: min(360px, 100%);
  padding: 30px 26px 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16,42,88,.22);
}

.captcha-box h3 { margin: 0 0 16px; text-align: center; font-size: 18px; }
.captcha-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: #8190aa; font-size: 22px; cursor: pointer; }
.captcha-img { width: 100%; height: 54px; margin-bottom: 12px; border: 1px solid var(--auth-line); border-radius: 10px; object-fit: cover; cursor: pointer; }
.captcha-input { width: 100%; height: 48px; margin-bottom: 14px; padding: 0 14px; border: 1px solid var(--auth-line); border-radius: 10px; outline: none; }
.captcha-input:focus { border-color: #6b9cff; box-shadow: 0 0 0 4px rgba(23,104,255,.09); }
.captcha-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-refresh, .btn-confirm { height: 44px; border-radius: 10px; cursor: pointer; }
.btn-refresh { border: 1px solid var(--auth-line); background: #fff; color: var(--auth-body); }
.btn-confirm { border: 0; background: var(--auth-blue); color: #fff; font-weight: 600; }

@media (max-width: 1100px) {
  .auth-shell { grid-template-columns: minmax(0, .85fr) minmax(500px, 1fr); }
  .auth-brand-panel { padding-left: 38px; padding-right: 38px; }
  .auth-brand-tagline { display: none; }
  .auth-benefits { width: 220px; }
  .auth-hero-art { right: -14%; width: 82%; opacity: .86; }
}

@media (max-width: 880px) {
  .auth-page { padding: 0; display: block; }
  .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .auth-form-topbar { min-height: 64px; padding: 0 24px; }
  .auth-form-wrap { width: min(520px, calc(100% - 40px)); padding-top: 26px; justify-content: flex-start; }
  .auth-title { font-size: 32px; }
}

@media (max-width: 560px) {
  .auth-form-topbar { min-height: 54px; }
  .auth-form-wrap { width: calc(100% - 32px); padding: 18px 0 28px; }
  .auth-title { font-size: 28px; }
  .auth-subtitle { margin-bottom: 26px; font-size: 14px; }
  .auth-grid-two { grid-template-columns: 1fr; gap: 0; }
  .auth-input { height: 52px; }
  .auth-primary, .auth-secondary { height: 52px; }
  .auth-captcha-row { grid-template-columns: 1fr 112px; }
  .auth-captcha-image { width: 112px; height: 52px; }
}


/* Compact centered dialog variant */
.auth-page {
  padding: 36px;
}

.auth-shell {
  width: min(1020px, 100%);
  height: min(700px, calc(100vh - 72px));
  min-height: 600px;
  grid-template-columns: 44% 56%;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 68px rgba(52, 82, 130, .18);
}

.auth-brand-panel {
  padding: 42px 38px 28px;
  background:
    radial-gradient(circle at 80% 28%, rgba(93, 153, 255, .18), transparent 36%),
    linear-gradient(145deg, #fbfdff 0%, #eaf3ff 100%);
}

.auth-brand,
.auth-benefits {
  display: none;
}

.auth-hero-copy {
  margin-top: 0;
}

.auth-hero-copy h1 {
  max-width: 360px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.035em;
}

.auth-hero-copy h1 span {
  margin-top: 5px;
  font-size: 29px;
}

.auth-hero-copy p {
  max-width: 350px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.65;
}

.auth-hero-art {
  right: -7%;
  bottom: -2%;
  width: 108%;
  max-height: 68%;
  -webkit-mask-image: radial-gradient(ellipse 79% 78% at 57% 68%, #000 48%, transparent 91%);
  mask-image: radial-gradient(ellipse 79% 78% at 57% 68%, #000 48%, transparent 91%);
}

.auth-form-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.auth-form-topbar {
  display: none;
}

.auth-form-wrap,
.auth-form-wrap.is-register {
  width: min(410px, calc(100% - 64px));
  min-height: 100%;
  padding: 30px 0 22px;
  justify-content: center;
}

.auth-form-wrap.is-register {
  padding-top: 24px;
  padding-bottom: 22px;
}

.auth-title {
  font-size: 30px;
  line-height: 1.25;
}

.auth-subtitle {
  margin: 7px 0 24px;
  font-size: 14px;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-label {
  margin-bottom: 6px;
  font-size: 13px;
}

.auth-input,
.auth-captcha-image {
  height: 48px;
  border-radius: 10px;
  font-size: 14px;
}

.auth-input {
  padding-left: 44px;
  padding-right: 44px;
}

.auth-input-icon {
  left: 14px;
  width: 19px;
  height: 19px;
}

.auth-options {
  margin: 0 0 16px;
  font-size: 13px;
}

.auth-check {
  font-size: 13px;
}

.auth-primary,
.auth-secondary {
  height: 48px;
  border-radius: 10px;
  font-size: 15px;
}

.auth-divider {
  margin: 16px 0;
}

.auth-consent-note {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.55;
}

.auth-legal {
  margin-top: 10px;
  font-size: 10.5px;
}

.auth-captcha-row {
  grid-template-columns: 1fr 120px;
}

.auth-captcha-image {
  width: 120px;
}

.auth-grid-two {
  gap: 12px;
}

@media (max-height: 720px) and (min-width: 801px) {
  .auth-page { padding-top: 24px; padding-bottom: 24px; }
  .auth-shell { height: calc(100vh - 48px); min-height: 560px; }
  .auth-form-wrap,
  .auth-form-wrap.is-register { padding-top: 18px; padding-bottom: 16px; }
  .auth-subtitle { margin-bottom: 18px; }
  .auth-field { margin-bottom: 11px; }
  .auth-divider { margin: 12px 0; }
  .auth-consent-note { margin-top: 10px; }
}

@media (max-width: 800px) {
  .auth-page {
    min-height: 100vh;
    padding: 20px;
  }

  .auth-shell {
    width: min(480px, 100%);
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 0;
    border-radius: 20px;
  }

  .auth-form-wrap,
  .auth-form-wrap.is-register {
    width: calc(100% - 40px);
    min-height: 0;
    padding: 34px 0 26px;
  }

  .auth-title { font-size: 28px; }
}

@media (max-width: 480px) {
  .auth-page { padding: 12px; }
  .auth-form-wrap,
  .auth-form-wrap.is-register { width: calc(100% - 28px); padding-top: 28px; }
  .auth-grid-two { grid-template-columns: 1fr; gap: 0; }
  .auth-captcha-row { grid-template-columns: 1fr 106px; }
  .auth-captcha-image { width: 106px; }
}


/* Unified service and privacy modal */
body.policy-open {
  overflow: hidden;
}

.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 31, 70, .42);
  backdrop-filter: blur(7px);
}

.policy-modal.is-open {
  display: flex;
  animation: policy-fade-in .18s ease-out;
}

.policy-dialog {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(222, 231, 246, .96);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(24, 48, 91, .26);
  animation: policy-dialog-in .22s ease-out;
}

.policy-header {
  min-height: 66px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9eef7;
}

.policy-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-ink);
  font-size: 18px;
  font-weight: 700;
}

.policy-heading svg {
  width: 21px;
  height: 21px;
  color: var(--auth-blue);
}

.policy-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f5f7fb;
  color: #74839f;
  font-size: 20px;
  cursor: pointer;
}

.policy-close:hover {
  background: #edf2fb;
  color: var(--auth-ink);
}

.policy-tabs {
  padding: 12px 22px 0;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e9eef7;
}

.policy-tab {
  min-width: 116px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px 9px 0 0;
  background: transparent;
  color: #61718e;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.policy-tab.is-active {
  background: #edf4ff;
  color: var(--auth-blue);
}

.policy-content {
  min-height: 0;
  padding: 22px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #465673;
  font-size: 13px;
  line-height: 1.8;
}

.policy-panel[hidden] {
  display: none;
}

.policy-panel h2 {
  margin: 0 0 4px;
  color: var(--auth-ink);
  font-size: 21px;
  line-height: 1.4;
}

.policy-date {
  margin: 0 0 18px;
  color: #8795ad;
  font-size: 12px;
}

.policy-panel h3 {
  margin: 20px 0 6px;
  color: #243658;
  font-size: 14px;
}

.policy-panel p {
  margin: 0 0 10px;
}

.policy-panel ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.policy-summary {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f2f6ff;
  color: #58709a;
  font-size: 12px;
}

.policy-footer {
  min-height: 66px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e9eef7;
  background: #fbfcfe;
}

.policy-footer-note {
  color: #8795ad;
  font-size: 11px;
}

.policy-confirm {
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  background: var(--auth-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@keyframes policy-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes policy-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .policy-modal { padding: 12px; }
  .policy-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 15px;
  }
  .policy-header { min-height: 58px; padding: 0 16px; }
  .policy-tabs { padding-left: 14px; padding-right: 14px; }
  .policy-tab { flex: 1; min-width: 0; padding: 0 10px; }
  .policy-content { padding: 18px; }
  .policy-footer { padding: 10px 16px; }
  .policy-footer-note { display: none; }
  .policy-confirm { width: 100%; }
}
