.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  overflow: auto;
  background:
    radial-gradient(ellipse at 18% 18%, rgba(0, 120, 96, .14), transparent 36%),
    radial-gradient(ellipse at 82% 14%, rgba(22, 143, 232, .1), transparent 30%),
    rgba(0, 7, 7, .7);
  color: var(--body-ink, #d6efec);
  backdrop-filter: blur(5px) saturate(.78) brightness(.58);
  -webkit-backdrop-filter: blur(5px) saturate(.78) brightness(.58);
}

.auth-gate::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(80, 224, 176, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 224, 176, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.65), transparent 88%);
}

.auth-gate[hidden],
.auth-method-choice[hidden],
.auth-account-form[hidden],
.auth-phone-form[hidden] { display: none; }

.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  width: min(100%, 1267px);
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(80, 224, 176, .25);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(80, 224, 176, .075), transparent 38%),
    rgba(2, 14, 14, .93);
  box-shadow:
    0 32px 96px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(80, 224, 176, .05),
    0 0 44px rgba(80, 224, 176, .09);
}
.auth-visual-panel { position: relative; min-height: 739px; overflow: hidden; background: #071112; }
.auth-visual-video { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(1.15) contrast(1.12) brightness(.78); }
.auth-visual-video-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 7, 8, .06) 16%, rgba(0, 8, 9, .2) 42%, rgba(0, 7, 8, .94) 100%), linear-gradient(90deg, rgba(0, 7, 8, .08), rgba(0, 7, 8, .18)); pointer-events: none; }
.auth-visual-grid { position: absolute; inset: 0; z-index: 2; opacity: .16; background-image: linear-gradient(rgba(151,239,208,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(151,239,208,.13) 1px, transparent 1px); background-size: 34px 34px; transform: perspective(520px) rotateY(-12deg) scale(1.25); pointer-events: none; }
.auth-visual-content { position: relative; z-index: 3; display: flex; box-sizing: border-box; min-height: 739px; height: 100%; flex-direction: column; justify-content: flex-end; padding: 52px; }
.auth-visual-kicker { color: #8de8c8; font-size: 11px; letter-spacing: .2em; }
.auth-visual-content strong { margin-top: 18px; color: #fff; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -.055em; text-shadow: 0 5px 24px rgba(0,0,0,.42); }
.auth-visual-content em { color: #7ce1bb; font-style: normal; }
.auth-panel-content { display: flex; container-type: inline-size; min-width: 0; min-height: 739px; box-sizing: border-box; flex-direction: column; padding: 48px 36px 42px; }
.auth-close-button { position: absolute; z-index: 5; top: 18px; right: 20px; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.04); color: #9fcac4; font-size: 24px; line-height: 1; cursor: pointer; }
.auth-close-button:hover { color: #fff; border-color: rgba(80,224,176,.5); background: rgba(80,224,176,.1); }

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 26px;
  color: var(--ink, #fff);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
}

.auth-brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  filter: drop-shadow(0 0 16px rgba(48, 192, 192, .28));
}

.auth-card h1 {
  margin: 0;
  color: var(--ink, #fff);
  font-size: clamp(27px, 10.8cqi, 38px);
  line-height: 1.18;
  letter-spacing: -.045em;
  text-align: center;
}

.auth-card h1 span { display: block; white-space: nowrap; }

.auth-card h1 span:last-child {
  background: var(--brand-gradient, linear-gradient(135deg, #50e0b0, #168fe8));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.auth-method-choice,
.auth-account-form,
.auth-phone-form { display: grid; gap: 13px; }

.auth-alt-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 19px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.auth-alt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--muted, #9fcac4);
  text-align: left;
  cursor: pointer;
  transition: color .18s ease, transform .18s ease;
}

.auth-alt-button:hover:not(:disabled) { color: var(--ink, #fff); transform: translateY(-1px); }
.auth-alt-button:focus-visible { outline: 2px solid var(--accent, #50e0b0); outline-offset: 3px; border-radius: 8px; }
.auth-alt-button:disabled { opacity: .72; cursor: pointer; }
.auth-alt-button strong, .auth-alt-button small { display: block; }
.auth-alt-button strong { font-size: 12px; font-weight: 700; }
.auth-alt-button small { margin-top: 3px; color: var(--muted-weak, #7fafaa); font-size: 10px; line-height: 1.3; }
.auth-alt-icon { display: grid; flex: 0 0 29px; box-sizing: border-box; width: 29px; min-width: 29px; height: 29px; min-height: 29px; place-items: center; border: 1px solid rgba(80,224,176,.32); border-radius: 9px; background: rgba(80,224,176,.08); color: var(--accent, #50e0b0); }
.auth-alt-icon svg { display: block; flex: 0 0 17px; width: 17px; min-width: 17px; height: 17px; min-height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-alt-icon-account { display: none; }
.auth-gate.auth-phone-mode .auth-alt-button-phone .auth-alt-icon-phone { display: none; }
.auth-gate.auth-phone-mode .auth-alt-button-phone .auth-alt-icon-account { display: grid; border-color: rgba(145,121,255,.52); background: rgba(113,91,225,.16); color: #b6a7ff; }
.auth-alt-button-phone .auth-alt-icon-phone { border-color: rgba(216,181,106,.52); background: rgba(216,181,106,.12); color: #f1cb6d; }
.auth-alt-button-feishu .auth-alt-icon-feishu { border-color: rgba(80,224,176,.48); background: rgba(39,201,202,.14); color: #50e0b0; }
.auth-alt-divider { color: var(--muted-weak, #7fafaa); font-size: 11px; }
.auth-alt-actions > .auth-feedback { grid-column: 1 / -1; text-align: center; }

.auth-method-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 80px;
  padding: 15px 18px;
  border: 1px solid rgba(80, 224, 176, .18);
  border-radius: 16px;
  background: rgba(3, 24, 23, .72);
  color: var(--body-ink, #d6efec);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.auth-method-button:hover:not(:disabled) {
  border-color: rgba(80, 224, 176, .56);
  background: linear-gradient(135deg, rgba(80, 224, 176, .14), rgba(22, 143, 232, .1));
  box-shadow: 0 0 26px rgba(80, 224, 176, .1);
  transform: translateY(-1px);
}

.auth-method-button:focus-visible,
.auth-submit-button:focus-visible { outline: 2px solid var(--accent, #50e0b0); outline-offset: 3px; }
.auth-method-button:disabled { opacity: .48; cursor: not-allowed; }
.auth-method-button strong,.auth-method-button small { display: block; }
.auth-method-button strong { color: var(--ink, #fff); font-size: 16px; }
.auth-method-button small { margin-top: 5px; color: var(--muted, #9fcac4); font-size: 12px; line-height: 1.4; }
.auth-method-button b { color: var(--accent, #50e0b0); font-size: 28px; font-weight: 400; line-height: 1; }

.auth-method-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: var(--brand-gradient, linear-gradient(135deg, #50e0b0, #168fe8));
  color: #001010;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(80, 224, 176, .16);
}

.auth-method-button:not(.auth-method-button-feishu) .auth-method-icon { background: linear-gradient(135deg, #30c0c0, #168fe8); }
.auth-method-button-phone .auth-method-icon { background: linear-gradient(135deg, #d8b56a, #d77b52); }
.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.auth-code-button { min-height: 46px; padding: 0 14px; border: 1px solid rgba(216,181,106,.42); border-radius: 12px; background: rgba(216,181,106,.08); color: #e8c879; cursor: pointer; white-space: nowrap; }
.auth-code-button:disabled { opacity: .55; cursor: wait; }
.auth-inline-button { border: 0; background: transparent; color: #9fcac4; cursor: pointer; font-size: 12px; }
.auth-inline-button:hover { color: #50e0b0; }
.auth-phone-register-fields { display: grid; gap: 13px; }
.auth-phone-register-fields[hidden] { display: none; }

.auth-choice-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
  color: var(--muted-weak, #7fafaa);
  font-size: 12px;
}

.auth-choice-divider::before,
.auth-choice-divider::after { height: 1px; content: ""; background: linear-gradient(90deg, transparent, rgba(80, 224, 176, .18)); }
.auth-choice-divider::after { transform: scaleX(-1); }
.auth-choice-divider span { padding: 1px 2px; }
.auth-choice-divider[hidden] { display: none; }

.auth-account-form label,
.auth-phone-form label {
  display: grid;
  gap: 7px;
  color: var(--muted, #9fcac4);
  font-size: 12px;
}

.auth-account-form input,
.auth-phone-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 15px;
  border: 1px solid rgba(80, 224, 176, .19);
  border-radius: 13px;
  background: rgba(0, 8, 8, .78);
  color: var(--ink, #fff);
  font: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-account-form input::placeholder,
.auth-phone-form input::placeholder { color: rgba(159, 202, 196, .56); }
.auth-account-form input:focus,
.auth-phone-form input:focus { border-color: var(--accent, #50e0b0); background: rgba(3, 24, 23, .9); box-shadow: 0 0 0 3px rgba(80, 224, 176, .14), 0 0 20px rgba(80, 224, 176, .08); }

.auth-password-field { position: relative; display: block; }
.auth-password-field input { padding-right: 52px; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #9fcac4);
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover { color: var(--accent, #50e0b0); background: rgba(80, 224, 176, .08); }
.auth-password-toggle:focus-visible { outline: 2px solid var(--accent, #50e0b0); outline-offset: 2px; }
.auth-password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.auth-submit-button {
  margin-top: 8px;
  padding: 14px 16px;
  border: 0;
  border-radius: 13px;
  background: var(--brand-gradient, linear-gradient(135deg, #50e0b0, #168fe8));
  color: #001010;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(22, 143, 232, .16), 0 0 22px rgba(80, 224, 176, .12);
  transition: filter .18s ease, transform .18s ease;
}

.auth-submit-button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.auth-submit-button:disabled { opacity: .6; cursor: wait; }

.auth-feedback { min-height: 18px; margin: 0; color: #ffabb8; font-size: 12px; line-height: 1.5; }
.auth-hint { margin: 0; color: var(--muted-weak, #7fafaa); font-size: 12px; line-height: 1.5; }

.auth-gate.auth-account-mode .auth-brand,
.auth-gate.auth-account-mode .auth-card h1,
.auth-gate.auth-phone-mode .auth-card h1 { display: none; }

.auth-gate.auth-account-mode .auth-card { width: min(100%, 1267px); }

@media (max-width: 560px) {
  .auth-gate { padding: 18px 14px; }
  .auth-card { display: block; padding: 0; border-radius: 20px; }
  .auth-visual-panel { min-height: 190px; }
  .auth-visual-content { min-height: 190px; padding: 28px 24px 24px; justify-content: flex-end; }
  .auth-visual-content strong { margin-top: 10px; font-size: 30px; }
  .auth-panel-content { min-height: 0; padding: 28px 22px 26px; }
  .auth-card h1 { font-size: clamp(23px, 6vw, 29px); }
  .auth-brand { margin-bottom: 22px; }
  .auth-method-button { min-height: 74px; padding: 13px 14px; }
  .auth-alt-actions { grid-template-columns: 1fr; gap: 6px; }
  .auth-alt-divider { display: none; }
  .auth-alt-button { justify-content: flex-start; width: 100%; padding: 8px 4px; }
  .auth-code-row { grid-template-columns: 1fr; }
  .auth-code-button { width: 100%; }
}

@media (min-width: 561px) and (max-width: 960px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-visual-panel, .auth-visual-content { min-height: 220px; }
  .auth-visual-content { padding: 30px; }
  .auth-panel-content { min-height: 0; padding: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-method-button,.auth-submit-button { transition: none; }
}


.auth-consent-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--muted-weak, #7fafaa);
  font-size: 11px;
  line-height: 1.6;
}

.auth-consent-checkbox {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent, #50e0b0);
  cursor: pointer;
}

.auth-consent-copy { min-width: 0; }
.auth-policy-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent, #50e0b0);
  font: inherit;
  cursor: pointer;
}
.auth-policy-link:hover { color: var(--ink, #fff); text-decoration: underline; }
.auth-policy-link:focus-visible { outline: 2px solid var(--accent, #50e0b0); outline-offset: 2px; border-radius: 3px; }

.auth-policy-dialog {
  position: fixed;
  z-index: 11000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 8, 8, .72);
  backdrop-filter: blur(10px);
}
.auth-policy-dialog[hidden] { display: none; }
.auth-policy-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 720px);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(80, 224, 176, .22);
  border-radius: 18px;
  background: #071918;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), 0 0 36px rgba(80, 224, 176, .08);
}
.auth-policy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.auth-policy-eyebrow { color: var(--accent, #50e0b0); font-size: 10px; letter-spacing: .08em; }
.auth-policy-header h2 { margin: 7px 0 0; color: var(--ink, #fff); font-size: 21px; }
.auth-policy-meta { margin: 6px 0 0; color: var(--muted-weak, #7fafaa); font-size: 11px; }
.auth-policy-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted, #9fcac4);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.auth-policy-close:hover { color: var(--ink, #fff); background: rgba(80, 224, 176, .1); }
.auth-policy-close:focus-visible { outline: 2px solid var(--accent, #50e0b0); outline-offset: 2px; }
.auth-policy-content {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 28px;
  color: var(--body-ink, #d6efec);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


@media (max-width: 600px) {
  .auth-policy-dialog { padding: 12px; }
  .auth-policy-card { max-height: calc(100vh - 24px); border-radius: 15px; }
  .auth-policy-header { padding: 18px 18px 14px; }
  .auth-policy-content { padding: 18px 18px 22px; }
}
