:root {
  --blue: #1966e6;
  --blue-dark: #104aaa;
  --green: #2f9d68;
  --ink: #15262e;
  --ink-soft: #5a6c74;
  --surface: #ffffff;
  --canvas: #edf3f5;
  --line: #d5e0e3;
  --danger: #b84242;
  --focus: #ffb238;
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

:root[data-theme='dark'] {
  --ink: #f1f5f7;
  --ink-soft: #b7c5ca;
  --surface: #222c31;
  --canvas: #172126;
  --line: #45555c;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 58%) minmax(320px, 42%);
}

.access-panel {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(24px, 4vw, 58px);
  background: var(--surface);
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand > span {
  font-size: 1.75rem;
  font-weight: 710;
  letter-spacing: -0.055em;
}

.brand strong {
  color: var(--blue);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.access-content {
  width: min(100%, 560px);
  align-self: center;
  margin: clamp(44px, 8vh, 90px) auto;
}

.intro {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.intro > p:last-child {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.65;
}

.access-form {
  display: grid;
  gap: 20px;
}

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

.field label {
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
}

.field input:focus {
  border-color: var(--blue);
  outline: 3px solid rgb(25 102 230 / 18%);
}

.field-help {
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 84px;
}

.reveal-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  padding: 7px 8px;
  color: var(--blue);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  padding: 12px 20px;
  color: #fff;
  background: var(--blue);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgb(25 102 230 / 22%);
}

.primary-button:hover {
  background: var(--blue-dark);
}

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

.form-message {
  margin: -4px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  border-radius: 6px;
  color: var(--ink);
  background: rgb(47 157 104 / 10%);
  line-height: 1.5;
}

.form-message.is-error {
  border-color: var(--danger);
  background: rgb(184 66 66 / 10%);
}

.state-card {
  display: grid;
  justify-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  background: var(--surface);
}

.state-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-state h2 {
  margin: 0;
  font-size: 1.55rem;
}

.result-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 1.6rem;
  font-weight: 800;
}

.result-state.is-error .result-symbol {
  background: var(--danger);
}

.link-button {
  width: 100%;
  margin-top: 7px;
}

.text-button {
  border: 0;
  padding: 6px;
  color: var(--blue);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

footer {
  display: flex;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.visual-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 18%, rgb(64 151 255 / 35%), transparent 28%),
    radial-gradient(circle at 80% 75%, rgb(44 193 143 / 25%), transparent 32%),
    linear-gradient(145deg, #10232e, #142f48 52%, #163b42);
}

.visual-copy {
  position: absolute;
  left: clamp(32px, 5vw, 82px);
  bottom: clamp(40px, 8vh, 100px);
  display: grid;
  gap: 12px;
  color: #fff;
}

.visual-copy span {
  color: #9dc9db;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.visual-copy strong {
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.orbit {
  position: absolute;
  border: 1px solid rgb(158 217 234 / 25%);
  border-radius: 50%;
}

.orbit-one {
  width: 48vw;
  aspect-ratio: 1;
  top: -15vw;
  left: -8vw;
}

.orbit-two {
  width: 34vw;
  aspect-ratio: 1;
  right: -17vw;
  top: 22vh;
}

.signal {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, #59c8f2, transparent);
  transform: rotate(-18deg);
  box-shadow: 0 0 18px #59c8f2;
}

.signal-one {
  width: 75%;
  top: 34%;
  left: 5%;
}

.signal-two {
  width: 50%;
  top: 47%;
  right: -6%;
  transform: rotate(28deg);
}

@media (max-width: 820px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    display: none;
  }

  .access-panel {
    min-height: 100vh;
  }
}

@media (max-width: 520px) {
  .access-panel {
    padding: 22px;
  }

  .theme-toggle #theme-label {
    display: none;
  }

  .access-content {
    margin: 48px auto;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
