:root {
  --peg-bg: #030811;
  --peg-panel: rgba(7, 18, 31, 0.82);
  --peg-line: rgba(94, 220, 255, 0.42);
  --peg-cyan: #68e8ff;
  --peg-blue: #2677ff;
  --peg-gold: #f5d36d;
  --peg-text: #f3fbff;
  --peg-muted: #9cc3d3;
  --peg-danger: #ff6f86;
}

body.personalecho-gateway-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--peg-bg);
}

body.personalecho-gateway-page .peg-authorized {
  min-height: 100vh;
  background: var(--peg-bg);
}

.peg-shell .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  padding: 0;
  white-space: nowrap;
}

.peg-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: clamp(20px, 4vw, 56px);
  color: var(--peg-text);
  background:
    radial-gradient(circle at 50% 38%, rgba(104, 232, 255, 0.18), transparent 34%),
    radial-gradient(circle at 50% 52%, rgba(245, 211, 109, 0.13), transparent 28%),
    linear-gradient(135deg, #02050b 0%, #071728 48%, #030811 100%);
  isolation: isolate;
}

.peg-grid,
.peg-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.peg-grid {
  background-image:
    linear-gradient(rgba(104, 232, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 232, 255, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  z-index: -2;
}

.peg-scanline {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
  opacity: 0.42;
  z-index: 2;
}

.peg-panel {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid var(--peg-line);
  border-radius: 12px;
  padding: clamp(28px, 5vw, 46px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
    var(--peg-panel);
  box-shadow:
    0 0 0 1px rgba(104, 232, 255, 0.08) inset,
    0 0 54px rgba(38, 119, 255, 0.22),
    0 24px 90px rgba(0, 0, 0, 0.48);
  text-align: center;
  backdrop-filter: blur(18px);
}

.peg-panel::before,
.peg-panel::after {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: var(--peg-cyan);
  border-style: solid;
  content: "";
  opacity: 0.8;
}

.peg-panel::before {
  top: 14px;
  left: 14px;
  border-width: 1px 0 0 1px;
}

.peg-panel::after {
  right: 14px;
  bottom: 14px;
  border-width: 0 1px 1px 0;
}

.peg-orbit {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 210px;
  height: 210px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.5;
}

.peg-orbit span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(104, 232, 255, 0.4);
  border-radius: 50%;
  animation: pegSpin 14s linear infinite;
}

.peg-orbit span:nth-child(2) {
  inset: 22px;
  border-color: rgba(245, 211, 109, 0.48);
  animation-duration: 10s;
  animation-direction: reverse;
}

.peg-orbit span:nth-child(3) {
  inset: 48px;
  border-color: rgba(255, 255, 255, 0.34);
  animation-duration: 7s;
}

.peg-core {
  position: relative;
  display: grid;
  width: 132px;
  height: 132px;
  margin: 0 auto 28px;
  place-items: center;
  border: 1px solid rgba(104, 232, 255, 0.55);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(245, 211, 109, 0.35), transparent 42%),
    radial-gradient(circle, rgba(104, 232, 255, 0.32), transparent 68%);
  box-shadow:
    0 0 36px rgba(104, 232, 255, 0.48),
    0 0 80px rgba(245, 211, 109, 0.18);
}

.peg-core::before,
.peg-core::after {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  content: "";
}

.peg-core::after {
  inset: 30px;
  border-color: rgba(245, 211, 109, 0.42);
}

.peg-core-mark {
  position: relative;
  z-index: 1;
  color: var(--peg-text);
  font: 800 28px/1 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(104, 232, 255, 0.8);
}

.peg-kicker {
  margin: 0 0 8px;
  color: var(--peg-gold);
  font: 800 12px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.peg-panel h1 {
  margin: 0 0 26px;
  font: 900 clamp(30px, 7vw, 50px)/0.95 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

.peg-form {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 14px;
}

.peg-form input,
.peg-form button {
  min-height: 54px;
  border-radius: 8px;
  font: 800 15px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.peg-form input {
  width: 100%;
  border: 1px solid rgba(104, 232, 255, 0.42);
  padding: 0 16px;
  color: var(--peg-text);
  background: rgba(1, 8, 16, 0.72);
  box-shadow: 0 0 0 1px rgba(104, 232, 255, 0.08) inset;
  text-align: center;
}

.peg-form input:focus {
  border-color: var(--peg-cyan);
  outline: none;
  box-shadow:
    0 0 0 1px rgba(104, 232, 255, 0.28) inset,
    0 0 24px rgba(104, 232, 255, 0.18);
}

.peg-form button {
  border: 1px solid rgba(245, 211, 109, 0.65);
  color: #06101a;
  background: linear-gradient(135deg, #fff5bc, #f5d36d 48%, #58dfff);
  box-shadow: 0 12px 34px rgba(245, 211, 109, 0.22);
  cursor: pointer;
  text-transform: uppercase;
}

.peg-form button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.72;
}

.peg-status {
  min-height: 20px;
  margin: 0;
  color: var(--peg-muted);
  font: 700 13px/1.4 Inter, system-ui, sans-serif;
}

.peg-status.is-error {
  color: var(--peg-danger);
}

.peg-status.is-success {
  color: var(--peg-cyan);
}

.peg-form.is-loading .peg-status::after {
  display: inline-block;
  width: 1.2em;
  content: "...";
  animation: pegPulse 1s steps(3, end) infinite;
}

@keyframes pegSpin {
  from {
    transform: rotate(0deg) scaleX(1);
  }

  to {
    transform: rotate(360deg) scaleX(1.08);
  }
}

@keyframes pegPulse {
  0% {
    opacity: 0.2;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.2;
  }
}

@media (max-width: 640px) {
  .peg-shell {
    min-height: 100svh;
    padding: 18px;
  }

  .peg-panel {
    padding: 24px 18px;
  }
}
