:root {
  --ink: #171717;
  --paper: #f1f0ed;
  --surface: #ffffff;
  --muted: #777771;
  --line: #d8d7d3;
  --lime: #65da29;
  --orange: #ff6517;
  --blue: #1667f6;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 255, 255, 0.9) 0 12%, transparent 35%),
    linear-gradient(110deg, #edede9 0%, #f6f5f2 55%, #ecebe7 100%);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

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

.shell {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 3;
  display: flex;
  width: 108px;
  flex-direction: column;
  align-items: center;
  padding: 32px 12px 24px;
  border-right: 1px solid rgba(23, 23, 23, 0.1);
  background: rgba(241, 240, 237, 0.82);
  backdrop-filter: blur(22px);
}

.rail-brand {
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.11em;
  text-decoration: none;
}

.rail-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-top: 44px;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: var(--orange);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

.rail-spacer {
  flex: 1;
}

.rail-status {
  display: flex;
  align-items: center;
  gap: 6px;
  writing-mode: vertical-rl;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rail-status span,
.live-pill span,
.key-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(101, 218, 41, 0.16);
}

.page {
  position: relative;
  grid-column: 2;
  min-height: 100vh;
  overflow: hidden;
  padding: 38px clamp(28px, 5vw, 88px) 64px;
}

.ghost-title {
  position: absolute;
  z-index: 0;
  top: -42px;
  left: 3vw;
  color: rgba(23, 23, 23, 0.055);
  font-size: clamp(78px, 11vw, 190px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.9;
  white-space: nowrap;
  pointer-events: none;
}

.topbar,
.view {
  position: relative;
  z-index: 1;
  width: min(1320px, 100%);
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  margin-bottom: clamp(64px, 9vh, 120px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.flag {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  color: #ffd51b;
  background: #1766b5;
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
}

.flag::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent 31%, #ffd51b 31% 43%, transparent 43%);
}

.flag::after {
  position: absolute;
  inset: 41% 0 auto;
  height: 12%;
  content: "";
  background: #ffd51b;
}

.brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.live-pill,
.key-status {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.live-pill {
  padding: 11px 16px;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 0.72fr);
  gap: clamp(54px, 10vw, 170px);
  align-items: end;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(50px, 6.8vw, 108px);
  font-weight: 750;
  letter-spacing: -0.075em;
  line-height: 0.88;
}

.lead {
  max-width: 620px;
  margin-bottom: 0;
  color: #555550;
  font-size: clamp(17px, 1.7vw, 24px);
  line-height: 1.43;
}

.login-card {
  display: flex;
  min-height: 378px;
  flex-direction: column;
  padding: clamp(28px, 3vw, 48px);
  border: 1px solid rgba(23, 23, 23, 0.11);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 28px 80px rgba(31, 31, 28, 0.08);
  backdrop-filter: blur(18px);
  animation: card-in 600ms cubic-bezier(.2,.8,.2,1) both;
}

label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.password-row {
  position: relative;
}

input {
  width: 100%;
  height: 78px;
  padding: 0 104px 0 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  outline: none;
  color: var(--ink);
  background: #f3f2ef;
  font-size: 18px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(23, 23, 23, 0.07);
}

.show-password {
  position: absolute;
  top: 50%;
  right: 20px;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transform: translateY(-50%);
}

.primary-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  margin-top: 18px;
  padding: 0 24px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.primary-button {
  color: white;
  background: var(--ink);
  font-weight: 750;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.form-error {
  min-height: 22px;
  margin: 14px 0 0;
  color: #d33d23;
  font-size: 13px;
}

.form-note {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

.success-view {
  animation: view-in 520ms ease both;
}

.has-key .topbar {
  margin-bottom: clamp(36px, 6vh, 78px);
}

.success-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 40px;
}

.success-heading h1 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: clamp(48px, 6vw, 94px);
}

.success-stamp {
  display: grid;
  width: 116px;
  height: 116px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(8deg);
}

.key-panel {
  padding: clamp(24px, 3.5vw, 52px);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: 0 24px 76px rgba(31, 31, 28, 0.08);
}

.key-panel-head,
.key-actions,
.help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.key-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.key-date {
  margin-left: 14px;
  color: var(--muted);
  font-size: 12px;
}

.key-status {
  padding: 9px 13px;
  border: 0;
  background: #effbe9;
}

.key-status i {
  display: block;
}

textarea {
  width: 100%;
  height: 126px;
  margin-top: 24px;
  padding: 20px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  color: #454541;
  background: #f1f0ed;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.key-actions {
  justify-content: flex-start;
}

.key-actions .primary-button,
.key-actions .secondary-button {
  width: min(100%, 310px);
}

.secondary-button {
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #f7f6f3;
  font-weight: 700;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.step-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.58);
}

.step-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.step-card h2 {
  margin: 52px 0 12px;
  font-size: 23px;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.step-card p {
  margin-bottom: 0;
  color: #5e5e58;
  font-size: 14px;
  line-height: 1.48;
}

.step-card a {
  margin-top: auto;
  color: inherit;
  font-size: 13px;
  font-weight: 750;
}

.step-card code {
  font-size: 12px;
}

.dark-card {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.dark-card .step-number,
.dark-card p {
  color: #bdbdb5;
}

.accent-card {
  border-color: var(--lime);
  background: var(--lime);
}

.accent-card .step-number,
.accent-card p {
  color: #214414;
}

.help-row {
  margin-top: 18px;
  padding: 24px 28px;
  border: 1px dashed #bbb9b2;
  border-radius: 22px;
}

.help-row p {
  max-width: 900px;
  margin-bottom: 0;
  color: #61615c;
  font-size: 13px;
  line-height: 1.5;
}

.help-row button {
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) rotate(0.5deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1040px) {
  .login-view {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .login-card {
    min-height: 330px;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .shell {
    display: block;
  }

  .rail {
    position: relative;
    width: 100%;
    height: 72px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 23, 23, 0.1);
  }

  .rail-mark {
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 14px;
  }

  .rail-spacer {
    display: none;
  }

  .rail-status {
    writing-mode: initial;
  }

  .page {
    padding: 24px 18px 40px;
  }

  .ghost-title {
    top: 12px;
    left: 8px;
    font-size: 72px;
  }

  .topbar {
    min-height: 58px;
    margin-bottom: 74px;
  }

  .live-pill {
    padding: 9px 11px;
    font-size: 0;
  }

  .brand-name {
    font-size: 17px;
  }

  .flag {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  h1 {
    font-size: clamp(48px, 15vw, 72px);
  }

  .lead {
    font-size: 17px;
  }

  .login-view {
    gap: 38px;
  }

  .login-card {
    min-height: 340px;
    padding: 24px;
    border-radius: 26px;
  }

  .success-heading {
    align-items: flex-start;
  }

  .success-heading h1 {
    font-size: clamp(44px, 13vw, 68px);
  }

  .success-stamp {
    display: none;
  }

  .key-panel {
    padding: 22px;
    border-radius: 26px;
  }

  .key-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .key-actions .primary-button,
  .key-actions .secondary-button {
    width: 100%;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    min-height: 230px;
  }

  .help-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

