:root {
  color-scheme: dark;
  --surface: #0b0c0a;
  --surface-raised: #11130f;
  --surface-control: #070806;
  --line: #34372f;
  --line-strong: #5b5f54;
  --text: #f2f3ee;
  --text-muted: #9da097;
  --signal: #ff3b30;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--surface);
  font-family: var(--font-mono);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface);
  background-size: 40px 40px;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  border-radius: 0;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  width: min(1120px, calc(100% - 48px));
  min-height: min(720px, calc(100svh - 48px));
  margin: 24px auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.identity-panel,
.login-panel {
  min-width: 0;
}

.identity-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  background: var(--surface-raised);
}

.identity-panel__top,
.login-panel__header,
.login-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.identity-panel__top {
  min-height: 96px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 48px;
  height: 48px;
  color: var(--signal);
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.host-name,
.section-index,
.access-note,
.login-panel__footer {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.host-name {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.identity-panel__content {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
  padding: 64px 48px;
}

.identity-panel__content::before {
  position: absolute;
  top: 64px;
  bottom: 64px;
  left: 0;
  width: 4px;
  background: var(--signal);
  content: "";
}

.section-index {
  color: var(--signal);
  font-size: 12px;
  letter-spacing: 0.1em;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.05em;
}

h1 {
  margin-top: 18px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.95;
}

h2 {
  font-size: 24px;
}

.access-note {
  max-width: 30ch;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.identity-panel__footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 32px;
  border-top: 1px solid var(--line);
}

.identity-panel__footer span {
  border-right: 1px solid var(--line);
}

.identity-panel__footer span:last-child {
  border-right: 0;
}

.login-panel {
  display: flex;
  flex-direction: column;
  padding: 0 56px;
}

.login-panel__header {
  min-height: 144px;
  border-bottom: 1px solid var(--line);
}

.login-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 56px 0;
}

.field {
  display: grid;
  gap: 10px;
}

.field label {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  outline: 0;
  color: var(--text);
  background: var(--surface-control);
  caret-color: var(--signal);
  transition:
    border-color 120ms linear,
    background-color 120ms linear;
}

.field input:hover {
  border-color: var(--text-muted);
}

.field input:focus {
  border-color: var(--signal);
  background: var(--surface);
}

.form-error {
  margin: -10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--signal);
  color: var(--signal);
  font-size: 13px;
  line-height: 1.5;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--signal);
  color: var(--surface);
  background: var(--signal);
  cursor: pointer;
  transition:
    color 120ms linear,
    background-color 120ms linear;
}

.submit-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.submit-button:hover {
  color: var(--signal);
  background: var(--surface);
}

.submit-button:focus-visible,
.frontend-link:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.login-panel__footer {
  min-height: 80px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
}

.frontend-link {
  color: var(--text);
  text-decoration-color: var(--signal);
  text-underline-offset: 5px;
}

.frontend-link:hover {
  color: var(--signal);
}

@media (max-width: 820px) {
  body {
    background-size: 32px 32px;
  }

  .page-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 620px);
    min-height: calc(100svh - 24px);
    margin: 12px auto;
  }

  .identity-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .identity-panel__top {
    min-height: 72px;
    padding: 16px 20px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .identity-panel__content {
    min-height: 220px;
    padding: 48px 28px;
  }

  .identity-panel__content::before {
    top: 48px;
    bottom: 48px;
  }

  h1 {
    font-size: clamp(42px, 15vw, 68px);
  }

  .login-panel {
    min-height: 470px;
    padding: 0 28px;
  }

  .login-panel__header {
    min-height: 92px;
  }

  .login-form {
    padding: 40px 0;
  }
}

@media (max-width: 460px) {
  .page-shell {
    width: 100%;
    min-height: 100svh;
    margin: 0;
    border-width: 0;
  }

  .host-name {
    max-width: 25ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .identity-panel__content {
    min-height: 190px;
    padding: 38px 24px;
  }

  .identity-panel__content::before {
    top: 38px;
    bottom: 38px;
  }

  .access-note {
    margin-top: 20px;
  }

  .login-panel {
    padding: 0 20px;
  }

  .login-panel__footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
  }
}

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