:root {
  color-scheme: dark;
  --ink: #071017;
  --ink-soft: #0a1720;
  --panel: #0d1b24;
  --panel-raised: #132630;
  --line: #213640;
  --line-bright: #2f4a55;
  --text: #edf5f4;
  --muted: #8ca1a9;
  --mint: #59d6b0;
  --mint-soft: #a3f0d7;
  --danger: #ff9a9a;
}

* { box-sizing: border-box; }

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

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

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(480px, 1.15fr) minmax(430px, .85fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 8% 88%, rgba(89, 214, 176, .09), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(49, 109, 130, .15), transparent 34%),
    linear-gradient(145deg, #07141c 0%, #081119 60%, #050c11 100%);
}

.login-story::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .28;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent 8%, black 56%, transparent 100%);
}

.brand, .mobile-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 680;
  font-size: 17px;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
}

.brand-mark span {
  position: absolute;
  left: 6px;
  width: 22px;
  height: 13px;
  border: 2px solid var(--mint);
  transform: rotate(30deg) skewX(-30deg) scaleY(.86);
}

.brand-mark span:nth-child(1) { top: 2px; }
.brand-mark span:nth-child(2) { top: 10px; opacity: .82; }
.brand-mark span:nth-child(3) { top: 18px; opacity: .58; }

.story-copy {
  position: relative;
  z-index: 1;
  width: min(640px, 92%);
  margin: auto 0 52px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--mint-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(89, 214, 176, .1);
}

.story-copy h1 {
  margin: 0 0 24px;
  font-size: clamp(46px, 5vw, 76px);
  line-height: .99;
  letter-spacing: -.065em;
  font-weight: 570;
}

.story-copy h1 span { color: var(--mint); }

.story-copy > p {
  max-width: 570px;
  margin: 0;
  color: #9db0b7;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.7;
}

.terminal-preview {
  position: relative;
  z-index: 1;
  width: min(650px, 100%);
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(5, 14, 20, .82);
  box-shadow: 0 28px 80px rgba(0,0,0,.3);
}

.preview-bar, .security-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.preview-status { display: flex; align-items: center; gap: 8px; color: #bdcec9; }
.preview-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

.preview-body {
  min-height: 134px;
  padding: 24px 22px;
  color: #cbd9d9;
  font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.preview-body p { margin: 0; }
.preview-body b { color: var(--mint); font-weight: 600; }
.preview-body .success { color: #85d8bc; }
.cursor { display: inline-block; width: 7px; height: 14px; vertical-align: -2px; background: #d9e8e6; animation: blink 1s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.security-note {
  justify-content: flex-start;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: rgba(19, 38, 48, .48);
}

.security-note > span:last-child { display: flex; flex-direction: column; }
.security-note strong { color: #d7e4e1; font-weight: 600; }
.security-note small { color: var(--muted); }
.shield-icon { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #2b6a58; border-radius: 9px; color: var(--mint); }

.login-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px clamp(28px, 5vw, 76px);
  background: #0a141b;
}

.login-panel::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  right: 0;
  top: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(89,214,176,.055), transparent 65%);
}

.mobile-brand { display: none; }

.login-card { position: relative; z-index: 1; width: min(430px, 100%); }

.login-heading { margin-bottom: 34px; }

.lock-badge {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid #2b544a;
  border-radius: 14px;
  background: #102720;
  color: var(--mint);
  font-size: 22px;
}

.kicker {
  margin: 0 0 7px !important;
  color: var(--mint) !important;
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-heading h2 { margin: 0 0 10px; font-size: clamp(30px, 3vw, 38px); line-height: 1.15; letter-spacing: -.045em; font-weight: 600; }
.login-heading p { margin: 0; color: var(--muted); font-size: 15px; }

.passkey-button, .legacy-button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #6ce0bc;
  border-radius: 12px;
  background: var(--mint);
  color: #061a14;
  font-weight: 750;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 12px 32px rgba(49, 159, 127, .13);
}

.passkey-button:hover, .legacy-button:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 15px 36px rgba(49, 159, 127, .2); }
.passkey-button:focus-visible, .legacy-button:focus-visible, input:focus-visible { outline: 3px solid rgba(89,214,176,.22); outline-offset: 2px; }
.passkey-button:disabled, .legacy-button:disabled { opacity: .6; cursor: wait; transform: none; }
.face-icon { font-size: 22px; }
.passkey-button .arrow, .legacy-button span { margin-left: auto; }

.legacy { margin-top: 26px; }
.divider { display: flex; align-items: center; gap: 14px; color: #627880; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.migration-note { margin: 18px 0 20px; color: var(--muted); font-size: 13px; }

.field-group { margin: 0 0 16px; }
.field-group label { display: block; margin-bottom: 8px; color: #b8c8ca; font-size: 13px; font-weight: 600; }
.field-group input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #071118;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.field-group input::placeholder { color: #52666d; }
.field-group input:focus { border-color: #418b77; background: #09161e; outline: none; }
.legacy-button { min-height: 50px; padding: 0 16px; background: #172a33; border-color: #29434e; color: var(--text); box-shadow: none; }

.message { min-height: 26px; margin-top: 18px; color: #a5b7bb; font-size: 13px; }
.message.error { padding: 10px 12px; border: 1px solid rgba(255,154,154,.3); border-radius: 9px; background: rgba(255,154,154,.06); color: var(--danger); }
.privacy { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; color: #667b82; font-size: 11px; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .login-shell { display: block; min-height: 100dvh; }
  .login-story { display: none; }
  .login-panel { min-height: 100dvh; padding: 88px 24px 42px; place-items: start center; }
  .mobile-brand { display: inline-flex; position: absolute; top: 25px; left: 24px; }
  .lock-badge { margin-top: 28px; }
}

@media (max-width: 480px) {
  .login-panel { padding-inline: 20px; }
  .login-heading { margin-bottom: 26px; }
  .login-heading h2 { font-size: 31px; }
  .lock-badge { width: 44px; height: 44px; margin-bottom: 22px; }
}

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