:root {
  color-scheme: dark;
  --ink: #eef5ff;
  --muted: #8ea0b7;
  --line: #263951;
  --panel: #0b1828;
  --field: #0a1625;
  --blue: #3b82f6;
  --cyan: #2dd4bf;
  --orange: #f59e0b;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(rgba(7, 17, 31, 0.94), rgba(7, 17, 31, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(79, 209, 197, 0.05) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(79, 209, 197, 0.04) 80px),
    #07111f;
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
  min-height: 100dvh;
}

.identity-panel,
.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 88px);
}

.identity-panel {
  position: relative;
  overflow: hidden;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(11, 30, 48, 0.96), rgba(8, 24, 38, 0.88)),
    #0b1e30;
  border-right: 1px solid var(--line);
}

.identity-panel::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: 14%;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(45, 212, 191, 0.16);
  transform: rotate(45deg);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: #0a2231;
  color: var(--cyan);
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0;
}

h1 {
  max-width: 520px;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.98;
}

.identity-copy {
  max-width: 460px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.status-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  max-width: 420px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.status-strip strong {
  color: var(--ink);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.7);
}

.form-panel {
  align-items: center;
}

.form-wrap {
  width: min(100%, 520px);
}

.lock-mark {
  position: relative;
  width: 42px;
  height: 36px;
  margin-bottom: 28px;
  border: 2px solid var(--orange);
}

.lock-mark::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -17px;
  width: 20px;
  height: 18px;
  border: 2px solid var(--orange);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.lock-mark span {
  position: absolute;
  left: 18px;
  top: 11px;
  width: 3px;
  height: 11px;
  background: var(--orange);
}

h2 {
  font-size: clamp(30px, 4vw, 44px);
}

.form-intro,
.session-note {
  color: var(--muted);
}

.form-intro {
  margin: 10px 0 34px;
}

label {
  display: block;
  margin: 20px 0 9px;
  color: #cbd7e7;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--field);
  color: var(--ink);
  caret-color: var(--cyan);
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 58px;
}

#toggle-password {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.eye {
  display: block;
  width: 20px;
  height: 13px;
  margin: auto;
  border: 2px solid currentColor;
  border-radius: 50% / 60%;
}

.eye::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  margin: 2px auto;
  border-radius: 50%;
  background: currentColor;
}

.sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin-top: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.sign-in:hover {
  background: #2563eb;
}

.sign-in:active {
  transform: translateY(1px);
}

.sign-in:disabled {
  cursor: wait;
  opacity: 0.72;
}

.sign-in-icon {
  width: 15px;
  height: 15px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.error-message {
  display: none;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--danger);
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
  font-size: 14px;
}

.error-message:not(:empty) {
  display: block;
}

.session-note {
  margin: 28px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .login-shell {
    display: block;
  }

  .identity-panel {
    min-height: 190px;
    padding: calc(26px + env(safe-area-inset-top)) 24px 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .identity-panel > div:nth-child(2) {
    margin-top: 24px;
  }

  .identity-panel .eyebrow,
  .identity-copy,
  .status-strip {
    display: none;
  }

  h1 {
    font-size: 34px;
  }

  .form-panel {
    justify-content: flex-start;
    min-height: calc(100dvh - 190px);
    padding: 38px 22px calc(32px + env(safe-area-inset-bottom));
  }

  .lock-mark {
    margin-bottom: 24px;
  }

  h2 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .form-wrap {
    animation: enter 420ms ease-out both;
  }

  @keyframes enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}