:root {
  color-scheme: light;
  --paper: #fbfbf8;
  --white: #ffffff;
  --ink: #191922;
  --muted: #62626b;
  --line: #deded8;
  --blue: #2e5e8e;
  --blue-light: #d5e3f1;
  --danger: #9d2f3f;
  --danger-soft: #f7e9eb;
  font-family: Inter, "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 58%, rgba(46, 94, 142, 0.045) 58% 100%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue-light); color: var(--ink); }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 18px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, 0.94);
}

.brand-mark { width: 3px; height: 32px; background: var(--blue); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.1; letter-spacing: -0.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.1; }

main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: clamp(48px, 9vw, 150px);
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: 72px 0;
}

.login-copy { max-width: 660px; }
.context-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
}
.context-line span { width: 18px; height: 3px; background: var(--blue); }

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 13ch;
  margin-bottom: 26px;
  font-size: clamp(2.8rem, 5.4vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.login-copy > p {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
}

.signal {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 40px;
  margin-top: 52px;
}
.signal span { width: 7px; border-radius: 2px; background: var(--blue); }
.signal span:nth-child(1) { height: 9px; opacity: .25; }
.signal span:nth-child(2) { height: 16px; opacity: .4; }
.signal span:nth-child(3) { height: 25px; opacity: .58; }
.signal span:nth-child(4) { height: 34px; opacity: .78; }
.signal span:nth-child(5) { height: 40px; }

.login-panel {
  width: 100%;
  max-width: 460px;
  justify-self: end;
  padding: clamp(30px, 4vw, 48px);
  background: var(--white);
  box-shadow: 0 22px 64px rgba(31, 45, 58, 0.13);
}

.panel-heading { margin-bottom: 32px; }
.panel-heading h2 { margin-bottom: 9px; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.03em; }
.panel-heading p, .privacy-note { color: var(--muted); font-size: 0.875rem; line-height: 1.55; }
.panel-heading p { margin-bottom: 0; }

.form-alert {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 10px;
  align-items: start;
  margin: -8px 0 24px;
  padding: 13px 14px;
  color: #6d1726;
  background: var(--danger-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}
.form-alert span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: white; background: var(--danger); font-weight: 800; }
.form-alert p { margin: 0; }

.field { margin-bottom: 22px; }
.field label { display: block; margin-bottom: 9px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.field input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #b9b9b3;
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:hover { border-color: #777780; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46, 94, 142, 0.15); }

.password-field { position: relative; }
.password-field input { padding-right: 50px; }
.reveal {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}
.reveal:hover { color: var(--blue); background: #f1f3f4; }
.reveal svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

button:focus-visible { outline: 3px solid #6fa0cc; outline-offset: 3px; }

.submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  font: 700 0.9rem/1 var(--font, inherit);
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}
.submit:hover { background: var(--blue); transform: translateY(-2px); }
.submit:disabled { color: #d4d4d8; background: #66666e; transform: none; cursor: wait; }
.submit svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.privacy-note { margin: 18px 0 0; text-align: center; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(24px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

@media (prefers-reduced-motion: no-preference) {
  .login-panel { animation: panel-in 650ms cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes panel-in {
    from { opacity: 0; transform: translateY(18px); clip-path: inset(0 0 12% 0); }
    to { opacity: 1; transform: translateY(0); clip-path: inset(0); }
  }
}

@media (max-width: 820px) {
  body { background: var(--paper); }
  main { grid-template-columns: 1fr; gap: 44px; width: min(560px, calc(100% - 40px)); padding: 48px 0 60px; }
  .login-copy { max-width: none; }
  h1 { max-width: 12ch; font-size: clamp(2.6rem, 11vw, 4.4rem); }
  .signal { display: none; }
  .login-panel { max-width: none; justify-self: stretch; }
}

@media (max-width: 480px) {
  .brand { min-height: 68px; padding: 15px 20px; }
  main { width: calc(100% - 28px); padding: 36px 0 44px; gap: 32px; }
  .context-line { margin-bottom: 18px; font-size: 9px; }
  h1 { margin-bottom: 18px; }
  .login-panel { padding: 26px 22px; }
  footer { padding: 17px 20px; }
  footer span:first-child { display: none; }
  footer { justify-content: flex-end; }
}
