/* ============================================================
   KeyDeck – Dark Gaming Aesthetic Stylesheet
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary:   #0d1117;
  --bg-secondary: #161b22;
  --bg-card:      #1c2333;
  --bg-card-hover:#212d45;
  --purple:       #7c3aed;
  --purple-light: #9d5cf6;
  --purple-dark:  #5b21b6;
  --cyan:         #06b6d4;
  --cyan-light:   #22d3ee;
  --green:        #10b981;
  --red:          #ef4444;
  --text-primary: #f0f6fc;
  --text-secondary:#8b949e;
  --text-muted:   #6e7681;
  --border:       #30363d;
  --border-glow:  rgba(124, 58, 237, 0.5);
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --transition:   0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--cyan-light);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.2rem; }

p { color: var(--text-secondary); }

/* ---------- Layout Helpers ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.nav-logo:hover {
  opacity: 0.85;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  box-shadow: 0 0 32px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
  color: #fff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--purple-light);
  color: var(--purple-light);
  background: rgba(124, 58, 237, 0.08);
}

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 100px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% -10%,
    rgba(124, 58, 237, 0.22) 0%,
    rgba(6, 182, 212, 0.08) 50%,
    transparent 80%),
    var(--bg-primary);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(124, 58, 237, 0.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.07) 0%, transparent 50%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  max-width: 780px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: 24px;
  display: block;
}

/* ---------- Section Headings ---------- */
.section-heading {
  text-align: center;
  margin-bottom: 64px;
}

.section-heading h2 {
  margin-bottom: 12px;
}

.section-heading p {
  max-width: 500px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ---------- Features Grid ---------- */
.features-section {
  background: var(--bg-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(6,182,212,0.04));
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.18);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* PRO badge chip */
.pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ---------- Pricing Section ---------- */
.pricing-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(22, 27, 34, 0.6) 100%);
}

.pricing-card-wrapper {
  display: flex;
  justify-content: center;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 52px 48px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.12);
}

.pricing-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  z-index: -1;
  opacity: 0.35;
}

.pricing-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 12px;
}

.pricing-card h3 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 20px 0 8px;
}

.pricing-amount {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-currency {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  align-self: flex-start;
  margin-top: 10px;
}

.pricing-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.pricing-features {
  margin: 0 0 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.975rem;
  color: var(--text-secondary);
}

.pricing-features .check {
  color: var(--green);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pricing-features .feature-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pricing-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 16px;
  font-size: 1.05rem;
}

/* ---------- Download Section ---------- */
.download-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.download-section h2 {
  margin-bottom: 16px;
}

.download-section p {
  max-width: 540px;
  margin: 0 auto 36px;
  font-size: 1rem;
}

.download-note {
  margin-top: 14px;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}

footer a:hover {
  color: var(--cyan);
}

/* ---------- Success / Cancel Pages ---------- */
.page-hero {
  padding: 96px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse 70% 50% at 50% 0%,
    rgba(124, 58, 237, 0.18) 0%,
    transparent 70%),
    var(--bg-primary);
}

.page-hero.success-hero {
  background: radial-gradient(ellipse 70% 50% at 50% 0%,
    rgba(16, 185, 129, 0.15) 0%,
    transparent 70%),
    var(--bg-primary);
}

.page-hero.cancel-hero {
  background: radial-gradient(ellipse 70% 50% at 50% 0%,
    rgba(239, 68, 68, 0.12) 0%,
    transparent 70%),
    var(--bg-primary);
}

.status-icon {
  font-size: 5rem;
  margin-bottom: 24px;
  display: block;
}

.page-hero h1 {
  margin-bottom: 14px;
}

.page-hero p {
  max-width: 500px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ---------- License Lookup Form ---------- */
.lookup-section {
  padding: 64px 0 96px;
}

#license-lookup {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 540px;
  margin: 0 auto;
}

#license-lookup h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

#license-lookup .form-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

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

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input[type="email"]:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

#license-lookup .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 14px;
}

/* Result area */
.result-area {
  margin-top: 28px;
}

.result-area.hidden {
  display: none;
}

.result-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* License key display box */
.license-key-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.1);
}

.license-key-text {
  font-family: 'Courier New', 'Roboto Mono', monospace;
  font-size: 1.05rem;
  color: var(--cyan-light);
  letter-spacing: 0.06em;
  word-break: break-all;
  flex: 1;
}

.copy-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: var(--purple-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(124, 58, 237, 0.3);
  color: #fff;
}

/* Activation instructions */
.activation-steps {
  margin-top: 28px;
  padding: 24px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
}

.activation-steps h3 {
  font-size: 1rem;
  color: var(--green);
  margin-bottom: 14px;
}

.activation-steps ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activation-steps li {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Error message */
.error-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: #fca5a5;
  margin-top: 16px;
}

.error-msg.hidden {
  display: none;
}

.error-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Inline button error (main.js) */
.checkout-error {
  margin-top: 12px;
  font-size: 0.875rem;
  color: #fca5a5;
  text-align: center;
}

/* ---------- Cancel Page ---------- */
.cancel-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  section {
    padding: 64px 0;
  }

  .hero {
    padding: 80px 0 64px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    padding: 36px 24px;
  }

  #license-lookup {
    padding: 32px 20px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .cancel-actions {
    flex-direction: column;
    align-items: center;
  }

  .license-key-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .copy-btn {
    width: 100%;
    text-align: center;
  }
}
