:root {
  --ink: #171716;
  --paper: #f5f5f1;
  --white: #ffffff;
  --line: #d8d7d1;
  --muted: #6e6d68;
  --oc-red: #dd1724;
  --oc-red-dark: #9f1420;
  --pink: #e8abc0;
  --green: #1f6d50;
  --error: #a91d2d;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(620px, 1.55fr) minmax(390px, .85fr);
}

.login-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(340px, .72fr);
  grid-template-rows: auto 1fr;
  gap: 56px clamp(44px, 7vw, 118px);
  padding: 38px clamp(42px, 7vw, 112px) 70px;
  background: var(--white);
}

.brand-lockup { display: flex; align-items: center; gap: 13px; grid-column: 1 / -1; }
.brand-lockup div { display: grid; gap: 2px; }
.brand-lockup strong { font-size: 14px; letter-spacing: -.01em; }
.brand-lockup span { color: var(--muted); font-size: 10px; }
.brand-mark {
  position: relative;
  width: 32px; height: 39px; display: block;
  background: linear-gradient(90deg, var(--oc-red) 0 45%, #fff 45% 68%, #cfcfc9 68%);
  border-radius: 18px 18px 3px 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.brand-mark::after { content: ""; position: absolute; inset: 6px 8px auto auto; width: 11px; height: 25px; border-left: 2px solid rgba(255,255,255,.8); transform: skewY(-22deg); }

.login-copy { align-self: center; max-width: 560px; }
.eyebrow { display: block; margin-bottom: 28px; color: var(--oc-red-dark); font: 700 10px/1.2 Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(52px, 6vw, 92px); line-height: 1.04; letter-spacing: -.06em; }
.login-copy p { max-width: 420px; margin: 28px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }

.login-form {
  align-self: center;
  padding: 30px;
  border: 1px solid var(--line);
  background: #fbfbf9;
  box-shadow: 0 30px 80px rgba(21, 21, 20, .08);
}
.form-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; font-weight: 700; }
.form-heading i { height: 1px; flex: 1; background: var(--line); }
.login-form label { display: grid; gap: 9px; margin-bottom: 20px; color: var(--muted); font-size: 11px; }
.login-form input {
  width: 100%; height: 48px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 0; outline: 0;
  color: var(--ink); background: var(--white);
}
.login-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,23,22,.08); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 60px; }
.password-field button { position: absolute; top: 1px; right: 1px; height: 46px; padding: 0 13px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.form-error { min-height: 22px; margin: 2px 0 10px; color: var(--error); font-size: 11px; line-height: 1.5; }
.login-button { width: 100%; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border: 1px solid var(--ink); color: var(--white); background: var(--ink); cursor: pointer; }
.login-button:hover { border-color: var(--oc-red); background: var(--oc-red); }
.login-button:focus-visible { outline: 3px solid rgba(221,23,36,.28); outline-offset: 3px; }
.login-button[disabled] { opacity: .55; cursor: wait; }
.login-button b { color: var(--pink); font-size: 18px; }
.login-form small { display: block; margin-top: 17px; color: var(--muted); font-size: 9px; line-height: 1.6; }

.material-gate { position: relative; min-height: 100vh; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; }
.gate-layer { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 13px; padding: 50px 20px; border-left: 1px solid rgba(255,255,255,.42); }
.gate-layer b { font-size: clamp(25px, 2.5vw, 42px); writing-mode: vertical-rl; text-orientation: upright; letter-spacing: .12em; }
.gate-layer span { min-height: 138px; font-size: 11px; line-height: 1.6; writing-mode: vertical-rl; text-orientation: upright; }
.layer-scene { background: #ede9df; }
.layer-system { color: var(--white); background: var(--oc-red); }
.layer-proof { color: var(--white); background: var(--green); }
.gate-lock { position: absolute; top: 50%; left: 50%; width: 88px; height: 88px; display: grid; place-items: center; transform: translate(-50%,-50%); border-radius: 50%; background: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.gate-lock::before { content: ""; width: 28px; height: 23px; margin-top: -22px; border: 4px solid var(--white); border-bottom: 0; border-radius: 16px 16px 0 0; }
.gate-lock span { position: absolute; top: 42px; width: 8px; height: 20px; border-radius: 6px; background: var(--pink); }

@media (max-width: 1050px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-stage { min-height: auto; grid-template-columns: 1fr 1fr; }
  .material-gate { min-height: 300px; }
  .gate-layer { padding: 35px 18px; }
  .gate-layer b, .gate-layer span { writing-mode: horizontal-tb; min-height: auto; }
}

@media (max-width: 720px) {
  .login-stage { grid-template-columns: 1fr; gap: 38px; padding: 26px 20px 36px; }
  .brand-lockup { grid-column: 1; }
  .login-copy { padding-top: 18px; }
  h1 { font-size: 48px; }
  .login-form { padding: 24px; }
  .material-gate { min-height: 210px; }
  .gate-layer span { display: none; }
  .gate-lock { width: 68px; height: 68px; }
  .gate-lock::before { width: 22px; height: 18px; margin-top: -18px; }
  .gate-lock span { top: 34px; height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
