:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #111827;
  --muted: #475569;
  --primary: #0f766e;
  --border: #e2e8f0;
  --danger: #b91c1c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #111827;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --primary: #2dd4bf;
    --border: #334155;
    --danger: #fca5a5;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.verification-card {
  width: min(100%, 420px);
  padding: clamp(22px, 6vw, 32px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary);
  color: var(--surface);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.body-copy {
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.status-region {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.status-message {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.4;
}

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

.status-region.is-success .status-message {
  color: var(--primary);
}

.spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner[hidden] {
  display: none;
}

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

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

.turnstile-container {
  min-height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.retry-button {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: var(--surface);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}

.retry-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent);
  outline-offset: 3px;
}

.retry-button:active {
  transform: translateY(1px);
}

.error-detail {
  margin: 16px 0 0;
  color: var(--danger);
  line-height: 1.5;
}

@media (max-width: 359px) {
  .verification-card {
    padding: 20px 14px;
    border-radius: 18px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .turnstile-container {
    transform: scale(0.92);
    transform-origin: center;
  }
}
