:root {
  color-scheme: dark;
  --amber: #dfac59;
  --amber-bright: #f2c979;
  --ink: #e6e5dc;
  --muted: #8d9ba1;
  --paper: #0c1821;
  --paper-deep: #050b10;
  --line: rgba(151, 180, 181, 0.2);
  --line-strong: rgba(223, 172, 89, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper-deep);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(7, 16, 25, 0.84), rgba(5, 11, 16, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(151, 180, 181, 0.055) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(151, 180, 181, 0.055) 31px 32px),
    radial-gradient(circle at 72% 24%, rgba(46, 105, 107, 0.25), transparent 32%);
}

button, input { font: inherit; }

.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 4rem);
}

.login-card {
  position: relative;
  width: min(100%, 470px);
  border: 1px solid var(--line-strong);
  background: linear-gradient(155deg, rgba(18, 34, 45, 0.98), rgba(7, 16, 24, 0.98));
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.48);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--amber);
}

.identity-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.identity-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--amber);
  color: var(--amber-bright);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  transform: rotate(45deg);
}

.identity-mark::first-line { transform: rotate(-45deg); }

.identity-block h1 {
  margin: 0.15rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  font-weight: 600;
}

.eyebrow, .section-code {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.clearance-copy { padding: 1.75rem 1.65rem 0.8rem; }
.section-code { color: var(--amber); }

.clearance-copy h2 {
  margin: 0.55rem 0 0.65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.clearance-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.58;
}

.login-form {
  display: grid;
  gap: 0.55rem;
  padding: 1rem 1.65rem 1.65rem;
}

.login-form label {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(151, 180, 181, 0.34);
  border-radius: 0;
  outline: none;
  background: #061019;
  color: var(--ink);
}

.login-form input:focus {
  border-color: var(--amber-bright);
  box-shadow: 0 0 0 2px rgba(223, 172, 89, 0.16);
}

.login-form button {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--amber);
  color: #071019;
  background: var(--amber);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  cursor: pointer;
}

.login-form button:hover { background: var(--amber-bright); }
.login-form button:disabled { cursor: wait; opacity: 0.58; }

.login-error {
  margin: 0.4rem 0 0;
  padding: 0.65rem 0.75rem;
  border-left: 2px solid #db7771;
  background: rgba(139, 48, 48, 0.14);
  color: #e6a19d;
  font-size: 0.75rem;
  line-height: 1.45;
}

.login-card footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .login-stage { place-items: start center; padding: 0; }
  .login-card { min-height: 100vh; display: flex; flex-direction: column; border-width: 0 0 0 3px; }
  .identity-block { padding-top: max(1.4rem, env(safe-area-inset-top)); }
  .clearance-copy, .login-form { padding-inline: 1.25rem; }
  .login-card footer { margin-top: auto; padding-inline: 1.25rem; }
}

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