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

:root {
  --bg: #0f0f1e;
  --bg-elevated: #121426;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --primary: #8aa5ff;
  --accent: #2934ff;
  --accent-bright: #1f36e5;
  --glow: rgba(138, 165, 255, 0.25);
  --destructive: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background effects */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(41, 52, 255, 0.18) 0%, transparent 70%);
  filter: blur(80px);
}

.bg-glow::after {
  content: "";
  position: absolute;
  bottom: 10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(138, 165, 255, 0.1) 0%, transparent 70%);
  filter: blur(100px);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 32px;
}

/* Hero */
.hero {
  text-align: center;
  max-width: 560px;
  margin-bottom: 56px;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary);
}

.hero p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-wrap: balance;
}

/* Card */
.card {
  width: 100%;
  max-width: 480px;
  background: rgba(18, 20, 38, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Form */
#redeem-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 165, 255, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 24px rgba(41, 52, 255, 0.35);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(41, 52, 255, 0.5);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  align-self: center;
}

.badge strong {
  color: var(--text);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.error {
  font-size: 14px;
  color: var(--destructive);
  text-align: center;
}

/* Success state */
.success-card .card-header {
  padding: 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.success-card .card-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.success-card .card-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.promo-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  margin: 24px 32px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.promo-code span {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.copy-btn {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.success-note {
  padding: 0 32px 32px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

.success-note a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.success-note a:hover {
  color: #a8b8ff;
}

.hidden {
  display: none !important;
}

/* FAQ */
.faq {
  width: 100%;
  max-width: 480px;
  margin-top: 40px;
}

.faq h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(18, 20, 38, 0.6);
}

.accordion-item {
  border-bottom: 1px solid var(--border-subtle);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}

.accordion-trigger:hover {
  color: var(--primary);
}

.accordion-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.accordion-item.open .accordion-content {
  display: block;
}

.accordion-content ol {
  margin: 8px 0 0 16px;
}

.accordion-content li {
  margin-bottom: 4px;
}

.accordion-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 48px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-in {
  animation: fadeIn 0.3s ease-out;
}

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

  .card-body {
    padding: 24px 20px;
  }

  .promo-code {
    margin: 20px 20px 20px;
    flex-direction: column;
  }
}
