:root {
  --bg: #05060a;
  --bg-elev: #0b0d14;
  --bg-card: rgba(20, 22, 32, 0.72);
  --bg-card-stroke: rgba(255, 255, 255, 0.08);
  --text: #f3f4f7;
  --text-dim: #a8adbb;
  --accent: #7dd3fc;
  --accent-2: #38bdf8;
  --error: #ff6b6b;
  --success: #22c55e;
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-bg-focus: rgba(255, 255, 255, 0.08);
  --input-stroke: rgba(255, 255, 255, 0.10);
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(168, 85, 247, 0.14), transparent 55%),
    linear-gradient(180deg, #04050a, #08090f);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.shell {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(16px, 5vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vw, 20px);
}

.brand {
  text-align: center;
  padding-top: clamp(8px, 3vw, 18px);
}

.brand__logo {
  width: clamp(56px, 16vw, 84px);
  height: auto;
  display: block;
  margin: 0 auto 10px;
  filter: drop-shadow(0 10px 30px rgba(56, 189, 248, 0.25));
}

.brand__title {
  font-size: clamp(20px, 5.2vw, 26px);
  line-height: 1.2;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand__title span {
  background: linear-gradient(135deg, #a5f3fc, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand__sub {
  margin: 0;
  color: var(--text-dim);
  font-size: clamp(13px, 3.6vw, 14px);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-stroke);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 5vw, 22px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.field input,
.field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 14px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-stroke);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  min-height: 48px;
}

.field input::placeholder {
  color: rgba(160, 165, 180, 0.6);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.6);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.12);
}

.field input[disabled],
.field input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

.select-wrap {
  position: relative;
}
.select-wrap select {
  padding-right: 38px;
}
.select-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 14px;
}

.hint {
  color: var(--text-dim);
  font-size: 12px;
}

.error {
  color: var(--error);
  font-size: 12.5px;
  min-height: 0;
  display: none;
}
.field.has-error .error { display: block; }
.field.has-error input,
.field.has-error select {
  border-color: rgba(255, 107, 107, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12);
}

.form-error {
  color: var(--error);
  font-size: 13px;
  min-height: 0;
  display: none;
  text-align: center;
}
.form-error.visible { display: block; }

.btn-primary {
  position: relative;
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #02070d;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .05s ease, filter .15s ease, box-shadow .2s ease;
  box-shadow:
    0 10px 30px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: 0.6; cursor: progress; }

.btn-spinner {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(2, 7, 13, 0.3);
  border-top-color: #02070d;
  animation: spin 0.7s linear infinite;
  transform: translateY(-50%);
}
.btn-primary.loading .btn-spinner { display: inline-block; }
.btn-primary.loading .btn-label { opacity: 0.7; }

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.tos {
  margin: 2px 0 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

.hidden { display: none !important; }

.success {
  text-align: center;
  align-items: center;
}

.success h2 {
  margin: 0;
  font-size: clamp(20px, 5vw, 24px);
}

.success p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.55;
}

.check {
  color: var(--success);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.07);
}
.check svg { width: 44px; height: 44px; }

#turnstile-slot {
  min-height: 0;
  display: flex;
  justify-content: center;
}

@media (min-width: 720px) {
  .shell { padding: 32px; gap: 24px; }
  .card { padding: 28px; gap: 16px; }
}

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