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

:root {
  --bg: #f4f9ff;
  --surface: #ffffff;
  --border: rgba(114, 164, 235, 0.2);
  --border-focus: rgba(79, 149, 234, 0.45);
  --border-error: rgba(255, 80, 80, 0.35);
  --text: #17324f;
  --muted: rgba(23, 50, 79, 0.58);
  --label: rgba(23, 50, 79, 0.72);
  --input-bg: rgba(114, 164, 235, 0.08);
  --input-bg-focus: rgba(114, 164, 235, 0.14);
  --btn-bg: #5865f2;
  --btn-text: #ffffff;
  --btn-hover: #4752c4;
  --btn-disabled-bg: rgba(88, 101, 242, 0.22);
  --btn-disabled-text: rgba(255, 255, 255, 0.72);
  --error: #ff5f5f;
  --discord: #5865f2;
  --discord-hover: #4752c4;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background:
    radial-gradient(ellipse 900px 500px at 50% -60px, rgba(88, 101, 242, 0.12) 0%, transparent 70%);
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
}

/* ── Header ─────────────────────────────────── */

.header {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #17324f;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ── Form fields ─────────────────────────────── */

.field {
  margin-bottom: 16px;
}

.turnstile-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#turnstileWidget {
  min-height: 65px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--label);
  letter-spacing: 0.01em;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  box-shadow: 0 8px 18px rgba(23, 50, 79, 0.08);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  border-color: var(--border-focus);
  background: var(--input-bg-focus);
  box-shadow: 0 10px 24px rgba(23, 50, 79, 0.12);
}

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

.error {
  min-height: 16px;
  margin: 5px 0 0;
  color: var(--error);
  font-size: 11.5px;
  line-height: 1.4;
}

/* ── Submit button ───────────────────────────── */

button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 6px;
}

button:hover:not(:disabled) {
  background: var(--btn-hover);
}

button:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  cursor: not-allowed;
}

.status {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* ── Success state ───────────────────────────── */

.success {
  text-align: center;
}

.success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  background: rgba(95, 168, 255, 0.1);
  border: 1px solid rgba(114, 164, 235, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(23, 50, 79, 0.72);
}

.code-block {
  background: rgba(95, 168, 255, 0.06);
  border: 1px solid rgba(114, 164, 235, 0.18);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 16px;
}

.success-copy {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.code {
  color: #17324f;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}

.discord-button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--discord);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.discord-button:hover {
  background: var(--discord-hover);
}

.success-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 480px) {
  .page {
    padding: 16px;
  }

  .card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  h1 {
    font-size: 22px;
  }
}
