:root {
  --beta-gateway-background: #f4f6f8;
  --beta-gateway-surface: #ffffff;
  --beta-gateway-text: #172033;
  --beta-gateway-muted: #5f6979;
  --beta-gateway-border: #dfe4ea;
  --beta-gateway-accent: #1167d8;
  --beta-gateway-accent-hover: #0d56b7;
  --beta-gateway-accent-soft: #eaf3ff;
  --beta-gateway-error: #a72727;
  --beta-gateway-error-background: #fff1f1;
  --beta-gateway-success: #176b43;
  --beta-gateway-success-background: #edf9f2;
  --beta-gateway-focus: rgba(17, 103, 216, 0.24);
  --beta-gateway-shadow: 0 24px 70px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

.beta-gateway-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at top left,
      rgba(17, 103, 216, 0.1),
      transparent 34rem
    ),
    linear-gradient(
      180deg,
      #f8fafc 0%,
      var(--beta-gateway-background) 100%
    );
  color: var(--beta-gateway-text);
}

.beta-gateway-page {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.beta-gateway-game {
  position: fixed;
  z-index: 0;
  top: 0;
  bottom: 0;
  width: 18vw;
  min-width: 110px;
  max-width: 220px;
  overflow: hidden;
  pointer-events: none;
}

.beta-gateway-game--left {
  left: 0;
}

.beta-gateway-game--right {
  right: 0;
}

.beta-gateway-game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.beta-gateway-panel {
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  border: 1px solid var(--beta-gateway-border);
  border-radius: 24px;
  background: var(--beta-gateway-surface);
  box-shadow: var(--beta-gateway-shadow);
}

.beta-gateway-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--beta-gateway-border);
}

.beta-gateway-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--beta-gateway-text);
  text-decoration: none;
}

.beta-gateway-brand:focus-visible {
  border-radius: 10px;
  outline: 3px solid var(--beta-gateway-focus);
  outline-offset: 4px;
}

.beta-gateway-brand-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--beta-gateway-accent);
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.beta-gateway-brand-name {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.beta-gateway-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #cfe1fb;
  border-radius: 999px;
  background: var(--beta-gateway-accent-soft);
  color: #174f95;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.beta-gateway-content {
  padding: 26px 22px 22px;
}

.beta-gateway-kicker {
  margin: 0 0 9px;
  color: var(--beta-gateway-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.beta-gateway-title {
  max-width: 500px;
  margin: 0;
  color: var(--beta-gateway-text);
  font-size: clamp(25px, 4.5vw, 34px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.beta-gateway-introduction {
  max-width: 510px;
  margin: 14px 0 0;
  color: var(--beta-gateway-muted);
  font-size: 15px;
  line-height: 1.5;
}

.beta-gateway-explainer {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--beta-gateway-border);
  border-radius: 14px;
  background: #fafbfc;
}

.beta-gateway-explainer-title {
  margin: 0;
  color: var(--beta-gateway-text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.beta-gateway-explainer-copy {
  margin: 6px 0 0;
  color: var(--beta-gateway-muted);
  font-size: 13px;
  line-height: 1.45;
}

.beta-gateway-form {
  margin-top: 20px;
}

.beta-gateway-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.beta-gateway-label {
  color: var(--beta-gateway-text);
  font-size: 14px;
  font-weight: 700;
}

.beta-gateway-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #c9d0da;
  border-radius: 12px;
  background: #ffffff;
  color: var(--beta-gateway-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.beta-gateway-input:hover {
  border-color: #9ca8b7;
}

.beta-gateway-input:focus {
  border-color: var(--beta-gateway-accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--beta-gateway-focus);
}

.beta-gateway-input[aria-invalid="true"] {
  border-color: var(--beta-gateway-error);
}

.beta-gateway-help {
  margin: 0;
  color: var(--beta-gateway-muted);
  font-size: 12px;
  line-height: 1.4;
}

.beta-gateway-message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.beta-gateway-message[hidden] {
  display: none;
}

.beta-gateway-message[data-state="error"] {
  border: 1px solid #f0c6c6;
  background: var(--beta-gateway-error-background);
  color: var(--beta-gateway-error);
}

.beta-gateway-message[data-state="success"] {
  border: 1px solid #bfe3cf;
  background: var(--beta-gateway-success-background);
  color: var(--beta-gateway-success);
}

.beta-gateway-invalid-password-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

.beta-gateway-invalid-password-actions[hidden] {
  display: none;
}

.beta-gateway-incorrect-password {
  color: var(--beta-gateway-error);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.beta-gateway-request-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--beta-gateway-border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--beta-gateway-accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.beta-gateway-request-access:hover {
  background: #fafbfc;
  border-color: #c9d0da;
}

.beta-gateway-request-access:focus-visible {
  outline: 3px solid var(--beta-gateway-focus);
  outline-offset: 3px;
}

.beta-gateway-request-access[hidden] {
  display: none;
}

.beta-gateway-submit {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--beta-gateway-accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.beta-gateway-submit:hover {
  background: var(--beta-gateway-accent-hover);
  box-shadow: 0 8px 22px rgba(17, 103, 216, 0.22);
  transform: translateY(-1px);
}

.beta-gateway-submit:focus-visible {
  outline: 3px solid var(--beta-gateway-focus);
  outline-offset: 3px;
}

.beta-gateway-submit:active {
  transform: translateY(0);
}

.beta-gateway-submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.beta-gateway-submit-progress[hidden] {
  display: none;
}

.beta-gateway-support {
  margin: 12px 0 0;
  color: var(--beta-gateway-muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.beta-gateway-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-top: 1px solid var(--beta-gateway-border);
  background: #fafbfc;
  color: #778191;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

@media (min-width: 640px) {
  .beta-gateway-page {
    padding: 18px 24px;
  }

  .beta-gateway-header {
    padding: 16px 28px 14px;
  }

  .beta-gateway-content {
    padding: 26px 38px 24px;
  }

  .beta-gateway-footer {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 480px) {
  .beta-gateway-page {
    align-items: flex-start;
    padding: 12px;
  }

  .beta-gateway-panel {
    border-radius: 18px;
  }

  .beta-gateway-header {
    padding: 15px 16px 13px;
  }

  .beta-gateway-content {
    padding: 22px 16px 20px;
  }

  .beta-gateway-invalid-password-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .beta-gateway-request-access {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .beta-gateway-game {
    width: 72px;
    min-width: 72px;
  }

  .beta-gateway-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .beta-gateway-title {
    font-size: 28px;
  }
}

@media (max-height: 760px) and (min-width: 640px) {
  .beta-gateway-page {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .beta-gateway-header {
    padding-top: 13px;
    padding-bottom: 11px;
  }

  .beta-gateway-content {
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .beta-gateway-title {
    font-size: 30px;
  }

  .beta-gateway-introduction {
    margin-top: 11px;
    font-size: 14px;
  }

  .beta-gateway-explainer {
    margin-top: 12px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .beta-gateway-form {
    margin-top: 15px;
  }

  .beta-gateway-submit {
    margin-top: 13px;
  }

  .beta-gateway-support {
    margin-top: 9px;
  }

  .beta-gateway-footer {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beta-gateway-game {
    display: none;
  }

  .beta-gateway-input,
  .beta-gateway-submit,
  .beta-gateway-request-access {
    transition: none;
  }
}
