.sg-body,
.sg-body *,
.sg-body *::before,
.sg-body *::after {
  box-sizing: border-box;
}

.sg-body {
  min-height: 100vh;
  margin: 0;
  background: #f4f6f8;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sg-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.sg-card {
  width: 100%;
  max-width: 420px;
  padding: 44px 40px 32px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.sg-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.sg-logo svg {
  width: 28px;
  height: 28px;
  display: block;
}

.sg-card h1 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #111827;
}

.sg-lead {
  margin: 0 auto 24px;
  max-width: 320px;
  font-size: 13.5px;
  color: #6b7280;
}

.sg-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 24px;
  font-size: 13px;
  font-weight: 550;
  color: #374151;
}

.sg-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #dbe3ef;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: sg-spin 0.8s linear infinite;
}

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

.sg-progress {
  position: relative;
  height: 4px;
  margin: 18px auto 0;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 99px;
}

.sg-progress span {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  animation: sg-slide 1.4s ease-in-out infinite;
}

@keyframes sg-slide {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

.sg-turnstile {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
  min-height: 0;
}

.sg-turnstile[hidden] {
  display: none;
}

.sg-body.sg-mode-turnstile .sg-lead,
.sg-body.sg-mode-turnstile .sg-spinner,
.sg-body.sg-mode-turnstile .sg-progress {
  display: none;
}

.sg-alert {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  text-align: left;
}

.sg-alert p {
  margin: 0;
}

.sg-button {
  margin-top: 10px;
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: #1d4ed8;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sg-button:hover {
  background: #1e40af;
}

.sg-button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.sg-foot {
  margin: 28px 0 0;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #9ca3af;
}

@media (max-width: 480px) {
  .sg-shell {
    padding: 20px 14px;
  }

  .sg-card {
    padding: 34px 22px 26px;
    border-radius: 10px;
  }

  .sg-card h1 {
    font-size: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  .sg-body {
    background: #0b1120;
    color: #e5e7eb;
  }

  .sg-card {
    background: #111827;
    border-color: #1f2937;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  }

  .sg-card h1 {
    color: #f3f4f6;
  }

  .sg-lead {
    color: #9ca3af;
  }

  .sg-status-row {
    color: #d1d5db;
  }

  .sg-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
  }

  .sg-progress {
    background: #1f2937;
  }

  .sg-alert {
    border-color: #7f1d1d;
    background: #2a1215;
    color: #fecaca;
  }

  .sg-foot {
    color: #6b7280;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-spinner {
    animation-duration: 2.4s;
  }

  .sg-progress span {
    animation: none;
    left: 0;
    width: 100%;
    opacity: 0.55;
  }
}
