:root {
  --ink: #111916;
  --paper: #f4f2eb;
  --paper-raised: #fbfaf6;
  --muted: #68716c;
  --line: #d8d8d0;
  --accent: #b6f235;
  --danger: #a73b31;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

.login-shell {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(360px, 41%) minmax(0, 1fr);
}

.login-brand {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow: hidden;
  padding: 46px clamp(34px, 5vw, 78px) 38px;
  color: #f6f8f4;
  background: var(--ink);
}

.login-brand::before {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}

.login-brand-lockup,
.login-brand-copy,
.login-brand-foot,
.login-signal { position: relative; z-index: 1; }

.login-brand-lockup {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: rise-in 520ms ease both;
}

.login-mark {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: flex-end;
  gap: 3px;
}

.login-mark i { width: 8px; background: var(--accent); }
.login-mark i:nth-child(1) { height: 17px; }
.login-mark i:nth-child(2) { height: 30px; }
.login-mark i:nth-child(3) { height: 23px; }

.login-brand-lockup > span:last-child { display: grid; gap: 8px; }
.login-brand-lockup strong { font-size: 23px; line-height: 0.9; letter-spacing: -0.045em; }
.login-brand-lockup small,
.login-brand-copy > p,
.login-brand-foot {
  color: #87928c;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.login-brand-copy {
  margin: auto 0;
  animation: rise-in 620ms 70ms ease both;
}

.login-brand-copy > p { margin: 0 0 20px; color: var(--accent); }
.login-brand-copy h1 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(37px, 4.1vw, 67px);
  font-weight: 620;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-brand-copy > span {
  display: block;
  max-width: 440px;
  margin-top: 28px;
  color: #aab3ae;
  font-size: 12px;
  line-height: 1.65;
}

.login-brand-foot { margin: 30px 0 0; }

.login-signal {
  display: grid;
  grid-template-columns: 2fr 5fr 3fr 1fr;
  gap: 5px;
  width: min(280px, 75%);
  height: 3px;
}

.login-signal i { background: rgba(255, 255, 255, 0.12); }
.login-signal i:nth-child(2) { background: var(--accent); animation: signal 2.8s ease-in-out infinite; }

.login-panel {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 54px clamp(30px, 8vw, 118px);
  background: var(--paper);
}

.login-form-wrap {
  width: min(100%, 430px);
  animation: rise-in 560ms 120ms ease both;
}

.login-eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.login-form-wrap h2 {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 660;
  line-height: 1;
  letter-spacing: -0.052em;
}

.login-intro {
  max-width: 350px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.login-alert {
  margin: 25px 0 -4px;
  padding: 11px 13px;
  border-left: 2px solid var(--danger);
  color: #7c3029;
  background: rgba(167, 59, 49, 0.06);
  font-size: 11px;
  line-height: 1.45;
}

#login-form { display: grid; gap: 24px; margin-top: 39px; }

.login-field { display: grid; gap: 9px; }
.login-field > label {
  color: #5d6761;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

#login-form input {
  width: 100%;
  height: 52px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid #aeb3af;
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#login-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 2px 0 -1px var(--ink);
}

.password-control { position: relative; display: block; }
.password-control input { padding-right: 58px; }
.password-control button {
  position: absolute;
  top: 9px;
  right: 0;
  height: 34px;
  padding: 0 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.password-control button:hover { color: var(--ink); }

.login-submit {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 19px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--paper-raised);
  background: var(--ink);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.login-submit i { font-size: 20px; font-style: normal; font-weight: 400; }
.login-submit:hover:not(:disabled) { color: var(--ink); background: var(--accent); transform: translateY(-1px); }
.login-submit:disabled { cursor: wait; opacity: 0.72; }

.login-form-wrap.is-loading .login-mark i,
body.is-loading .login-mark i { animation: bar-pulse 850ms ease-in-out infinite alternate; }
body.is-loading .login-mark i:nth-child(2) { animation-delay: 110ms; }
body.is-loading .login-mark i:nth-child(3) { animation-delay: 220ms; }

.login-foot {
  margin: 33px 0 0;
  color: #8b928e;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes signal { 50% { opacity: 0.3; transform: scaleX(0.72); transform-origin: left; } }
@keyframes bar-pulse { to { opacity: 0.35; } }

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand {
    min-height: 190px;
    padding: 25px 22px 27px;
  }
  .login-brand-copy { margin: auto 0 0; }
  .login-brand-copy > p,
  .login-brand-copy > span,
  .login-signal,
  .login-brand-foot { display: none; }
  .login-brand-copy h1 { max-width: 330px; margin-top: 28px; font-size: 31px; }
  .login-panel { min-height: calc(100svh - 190px); place-items: start center; padding: 44px 22px 64px; }
  .login-form-wrap h2 { font-size: 36px; }
  #login-form { margin-top: 34px; }
  #login-form input,
  .login-submit { min-height: 50px; }
}

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