:root {
  color-scheme: dark;
  --bg: #050914;
  --surface: rgba(10, 18, 34, .76);
  --surface-strong: rgba(13, 24, 45, .94);
  --line: rgba(148, 184, 224, .15);
  --line-strong: rgba(75, 225, 211, .36);
  --text: #f4f8ff;
  --muted: #94a8c4;
  --primary: #48e1d0;
  --primary-2: #6d8cff;
  --danger: #ff7890;
  --shadow: 0 30px 90px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 15%, rgba(67, 226, 211, .12), transparent 31rem),
    radial-gradient(circle at 86% 82%, rgba(102, 122, 255, .14), transparent 34rem),
    linear-gradient(145deg, #040711 0%, #07101f 52%, #050915 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(136, 173, 211, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 173, 211, .08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

a { color: inherit; }
button, input { font: inherit; }

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .13;
  pointer-events: none;
  animation: drift 10s ease-in-out infinite alternate;
}

.ambient-a { top: -18rem; right: 12%; background: var(--primary); }
.ambient-b { bottom: -22rem; left: 10%; background: var(--primary-2); animation-delay: -4s; }

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr);
}

.brand-panel {
  min-height: 100vh;
  padding: clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .04em;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22), 0 0 28px rgba(255, 91, 101, .13);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  object-fit: contain;
  background: #fff;
}

.brand-copy { max-width: 720px; margin: clamp(70px, 10vh, 130px) 0 48px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; box-shadow: 0 0 10px currentColor; }

h1 {
  max-width: 760px;
  margin: 24px 0 22px;
  font-size: clamp(46px, 6.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

h1 em { font-style: normal; color: transparent; background: linear-gradient(92deg, #fff 8%, var(--primary) 54%, #8ba2ff); -webkit-background-clip: text; background-clip: text; }
.brand-lead { max-width: 620px; margin: 0; color: #a9bad0; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.8; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; margin-top: 38px; }
.feature-card { position: relative; min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(13, 25, 45, .62), rgba(7, 14, 27, .4)); overflow: hidden; }
.feature-card::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(72, 225, 208, .7), transparent); opacity: 0; transition: opacity .25s; }
.feature-card:hover::after { opacity: 1; }
.feature-index { color: var(--primary); font: 600 11px ui-monospace, monospace; letter-spacing: .12em; }
.feature-card h2 { margin: 24px 0 7px; font-size: 16px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.trust-row { display: flex; align-items: center; gap: 12px; color: #748aa7; font-size: 12px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px rgba(72, 225, 208, .08), 0 0 14px var(--primary); }

.form-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  border-left: 1px solid rgba(148, 184, 224, .1);
  background: linear-gradient(180deg, rgba(7, 13, 25, .32), rgba(3, 7, 15, .72));
  backdrop-filter: blur(20px);
}

.auth-card { width: min(100%, 470px); padding: clamp(28px, 4vw, 46px); border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(155deg, rgba(14, 26, 48, .92), rgba(7, 13, 27, .94)); box-shadow: var(--shadow); animation: reveal .65s cubic-bezier(.2,.75,.25,1) both; }
.card-kicker { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.auth-card h2 { margin: 12px 0 9px; font-size: clamp(30px, 3vw, 40px); letter-spacing: -.04em; }
.card-subtitle { margin: 0 0 30px; color: var(--muted); line-height: 1.65; }

.field { margin-bottom: 18px; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.field label, .field-label { display: block; margin-bottom: 9px; color: #c5d2e5; font-size: 13px; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; height: 54px; border: 1px solid rgba(148, 184, 224, .18); border-radius: 14px; outline: none; padding: 0 46px 0 16px; color: var(--text); background: rgba(3, 8, 18, .56); transition: border .2s, box-shadow .2s, background .2s; }
.input-wrap input::placeholder { color: #586c87; }
.input-wrap input:focus { border-color: var(--line-strong); background: rgba(5, 12, 24, .86); box-shadow: 0 0 0 4px rgba(72, 225, 208, .07), 0 0 22px rgba(72, 225, 208, .06); }
.input-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #667c98; pointer-events: none; }
.toggle-password { border: 0; padding: 7px; right: 9px; cursor: pointer; pointer-events: auto; background: transparent; }
.toggle-password:hover { color: var(--primary); }

.code-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; }
.send-code-btn { border: 1px solid rgba(72, 225, 208, .28); border-radius: 14px; color: var(--primary); cursor: pointer; background: rgba(72, 225, 208, .07); font-size: 13px; font-weight: 700; transition: border .2s, background .2s, color .2s; }
.send-code-btn:hover { border-color: rgba(72, 225, 208, .55); background: rgba(72, 225, 208, .12); }
.send-code-btn:disabled { cursor: wait; color: #71869e; border-color: var(--line); background: rgba(7, 14, 27, .5); }

.form-options { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 8px 0 24px; color: var(--muted); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.text-link { color: #a9baff; text-decoration: none; }
.text-link:hover { color: var(--primary); }

.primary-btn { width: 100%; height: 56px; border: 0; border-radius: 15px; cursor: pointer; color: #03100f; font-weight: 800; letter-spacing: .02em; background: linear-gradient(100deg, var(--primary), #7df0df 42%, #89a1ff); box-shadow: 0 12px 32px rgba(72, 225, 208, .16); transition: transform .2s, box-shadow .2s, filter .2s; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(72, 225, 208, .22); filter: saturate(1.08); }
.primary-btn:disabled { cursor: wait; opacity: .75; transform: none; }

.platform-entry-btn { width: 100%; min-height: 62px; margin-top: 14px; padding: 11px 16px; border: 1px solid rgba(137, 161, 255, .34); border-radius: 15px; cursor: pointer; color: #eaf2ff; background: linear-gradient(120deg, rgba(63, 92, 148, .34), rgba(39, 67, 112, .18)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); transition: transform .2s, border-color .2s, background .2s; }
.platform-entry-btn:hover { transform: translateY(-2px); border-color: rgba(72, 225, 208, .52); background: linear-gradient(120deg, rgba(50, 112, 139, .38), rgba(65, 76, 148, .25)); }
.platform-entry-btn:disabled { cursor: wait; opacity: .65; transform: none; }
.platform-entry-btn span, .platform-entry-btn small { display: block; }
.platform-entry-btn span { font-weight: 800; letter-spacing: .04em; }
.platform-entry-btn small { margin-top: 4px; color: #8fa6c4; font-size: 11px; }

.switch-auth { margin: 24px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.switch-auth a { margin-left: 6px; color: var(--primary); text-decoration: none; font-weight: 700; }
.legal { margin: 28px 0 0; color: #5f7390; font-size: 11px; line-height: 1.7; text-align: center; }
.legal a { color: #8397b3; }

.strength { margin-top: 10px; }
.strength-head { display: flex; justify-content: space-between; color: #7085a1; font-size: 11px; }
.strength-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.strength-bar i { height: 3px; border-radius: 10px; background: #26364d; transition: background .2s, box-shadow .2s; }
.strength[data-level="1"] i:nth-child(-n+1), .strength[data-level="2"] i:nth-child(-n+2), .strength[data-level="3"] i:nth-child(-n+3), .strength[data-level="4"] i:nth-child(-n+4) { background: var(--primary); box-shadow: 0 0 8px rgba(72, 225, 208, .45); }
.form-message { min-height: 20px; margin: 14px 0 -4px; color: var(--primary); font-size: 13px; text-align: center; }

@keyframes reveal { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes drift { to { transform: translate3d(35px, 20px, 0) scale(1.08); } }

@media (max-width: 1100px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(390px, .82fr); }
  .feature-grid { grid-template-columns: 1fr; max-width: 540px; }
  .feature-card { min-height: auto; }
  .feature-card h2 { margin-top: 12px; }
}

@media (max-width: 900px) {
  .auth-shell { display: block; }
  .brand-panel { min-height: auto; padding-bottom: 28px; }
  .brand-copy { margin: 72px 0 20px; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); max-width: none; }
  .trust-row { margin-top: 28px; }
  .form-panel { min-height: auto; border: 0; padding-top: 18px; padding-bottom: 56px; }
}

@media (max-width: 640px) {
  .brand-panel, .form-panel { padding-left: 18px; padding-right: 18px; }
  h1 { font-size: 44px; }
  .brand-lead { font-size: 15px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card:nth-child(n+3) { display: none; }
  .auth-card { padding: 26px 20px; border-radius: 22px; }
  .form-options { align-items: flex-start; }
  .code-row { grid-template-columns: 1fr; }
  .send-code-btn { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
