/* ═══════════════════════════════════════════════════════════════════
   think-cell CDKey Activation – Design System
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Tokens ──────────────────────────────────────────────── */
:root {
  /* Palette – deep indigo / violet */
  --clr-bg-start: #0f0b1e;
  --clr-bg-end: #1a1135;
  --clr-surface: rgba(255, 255, 255, 0.05);
  --clr-surface-hover: rgba(255, 255, 255, 0.08);
  --clr-border: rgba(255, 255, 255, 0.10);
  --clr-border-focus: rgba(99, 102, 241, 0.5);
  --clr-primary: #6366f1;
  --clr-primary-hover: #818cf8;
  --clr-primary-glow: rgba(99, 102, 241, 0.35);
  --clr-accent: #a78bfa;
  --clr-success: #34d399;
  --clr-success-bg: rgba(52, 211, 153, 0.12);
  --clr-warning: #fbbf24;
  --clr-warning-bg: rgba(251, 191, 36, 0.10);
  --clr-danger: #f87171;
  --clr-danger-bg: rgba(248, 113, 113, 0.10);
  --clr-text: #e2e8f0;
  --clr-text-dim: #94a3b8;
  --clr-text-bright: #f8fafc;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--clr-border);
  --shadow-glow: 0 0 40px var(--clr-primary-glow);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(.4, 0, .2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--clr-text);
  background: linear-gradient(145deg, var(--clr-bg-start) 0%, var(--clr-bg-end) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
  animation: floatParticle linear infinite;
  opacity: 0.5;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.5;
  }

  90% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(-110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ── Page Wrapper ────────────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────── */
.site-header {
  text-align: center;
  margin-bottom: 40px;
}

.logo-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.logo-icon svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 20px var(--clr-primary-glow));
}

.logo-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--clr-text-bright);
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 0.85rem;
  color: var(--clr-text-dim);
  margin-top: 2px;
}

/* ── Glass Card ──────────────────────────────────────────────────── */
.glass-card {
  background: var(--clr-surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card {
  padding: 32px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.step-card {
  margin-bottom: 24px;
  animation: fadeSlideIn 0.5s ease-out both;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--clr-text-bright);
}

/* Step Badge */
.step-badge {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--clr-primary-glow);
}

.step-badge.pulse {
  animation: badgePulse 1.8s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--clr-primary-glow);
  }

  50% {
    box-shadow: 0 0 36px rgba(99, 102, 241, 0.55);
  }
}

.success-badge {
  background: linear-gradient(135deg, #059669, #34d399);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.35);
}

/* ── Input ────────────────────────────────────────────────────────── */
.input-group {
  display: flex;
  gap: 12px;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--clr-text-dim);
  pointer-events: none;
  transition: color var(--transition);
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--clr-text-bright);
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-wrapper input::placeholder {
  color: var(--clr-text-dim);
  opacity: 0.7;
}

.input-wrapper input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
  background: rgba(255, 255, 255, 0.07);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper input:focus~.input-icon {
  color: var(--clr-primary);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-primary), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 16px var(--clr-primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-dim);
  border: 1px solid var(--clr-border);
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  background: var(--clr-surface-hover);
  color: var(--clr-text);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
}

.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow {
  transition: transform var(--transition);
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* ── Error Message ───────────────────────────────────────────────── */
.error-msg {
  color: var(--clr-danger);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
}

.error-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Progress ────────────────────────────────────────────────────── */
.progress-area {
  text-align: center;
  padding: 16px 0;
}

.spinner-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-text {
  font-size: 0.95rem;
  color: var(--clr-text);
  margin-bottom: 16px;
}

.progress-bar-wrapper {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  border-radius: 2px;
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0% {
    width: 15%;
  }

  50% {
    width: 65%;
  }

  100% {
    width: 15%;
  }
}

/* ── License Box ─────────────────────────────────────────────────── */
.license-box {
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.10) 0%, rgba(139, 92, 246, 0.06) 40%, rgba(30, 27, 75, 0.3) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-lg);
  padding: 28px 24px 0;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: glowPulse 3s ease-in-out infinite;
}

.license-box::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 140%;
  height: 120%;
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.10) 0%, transparent 60%);
  pointer-events: none;
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.08);
  }

  50% {
    box-shadow: 0 0 48px rgba(99, 102, 241, 0.18);
  }
}

/* License Header */
.license-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
}

.license-shield {
  width: 22px;
  height: 22px;
  color: var(--clr-success);
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.4));
}

.license-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--clr-accent);
  font-weight: 600;
}

/* Segmented Key Display */
.license-key-segments {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  position: relative;
}

.key-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--clr-text-bright);
  min-width: 0;
  transition: all var(--transition);
}

.key-segment:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.key-separator {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  user-select: none;
  line-height: 1;
}

/* Copy Button – full width */
.btn-copy-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom: none;
  border-radius: 0;
  color: var(--clr-text-dim);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.btn-copy-large svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-copy-large:hover {
  background: rgba(99, 102, 241, 0.10);
  color: var(--clr-primary-hover);
}

.btn-copy-large.copied {
  color: var(--clr-success);
}

/* Validity Ribbon */
.license-valid-ribbon {
  margin-top: 12px;
  padding: 10px 0;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.08), rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.08));
  border-top: 1px solid rgba(52, 211, 153, 0.2);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--clr-success);
  letter-spacing: 0.02em;
  margin-left: -24px;
  margin-right: -24px;
}


/* ── Urgent Warning ──────────────────────────────────────────────── */
.urgent-warning {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 28px;
  animation: warnFlash 2s ease-in-out 3;
}

@keyframes warnFlash {

  0%,
  100% {
    border-color: rgba(251, 191, 36, 0.25);
  }

  50% {
    border-color: rgba(251, 191, 36, 0.6);
  }
}

.warning-icon-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 50%;
}

.warning-icon {
  width: 24px;
  height: 24px;
  color: var(--clr-warning);
}

.warning-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-warning);
  margin-bottom: 6px;
}

.warning-content p {
  font-size: 0.88rem;
  color: var(--clr-text);
  line-height: 1.5;
}

.warning-sub {
  font-size: 0.8rem !important;
  color: var(--clr-text-dim) !important;
  margin-top: 4px;
}

.countdown-number {
  font-size: 1.1em;
  font-weight: 800;
  color: var(--clr-danger);
  font-variant-numeric: tabular-nums;
}

/* ── Download Buttons ────────────────────────────────────────────── */
.download-section {
  margin-bottom: 8px;
}

.download-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--clr-text-bright);
  margin-bottom: 16px;
  text-align: center;
}

.download-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--clr-text);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.download-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--transition);
}

.windows-btn::before {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.06));
}

.mac-btn::before {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(139, 92, 246, 0.06));
}

.download-btn:hover {
  transform: translateY(-3px);
  border-color: var(--clr-primary);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.download-btn:hover::before {
  opacity: 1;
}

.dl-icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.dl-icon svg {
  width: 36px;
  height: 36px;
}

.windows-btn .dl-icon {
  color: #60a5fa;
}

.mac-btn .dl-icon {
  color: var(--clr-accent);
}

.dl-info {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dl-platform {
  font-weight: 700;
  font-size: 1rem;
  color: var(--clr-text-bright);
}

.dl-detail {
  font-size: 0.78rem;
  color: var(--clr-text-dim);
}

.dl-arrow {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  color: var(--clr-text-dim);
  transition: all var(--transition);
}

.dl-arrow svg {
  width: 22px;
  height: 22px;
}

.download-btn:hover .dl-arrow {
  color: var(--clr-primary);
  transform: translateY(2px);
}

/* ── Expired Overlay ─────────────────────────────────────────────── */
.expired-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(15, 11, 30, 0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.expired-content {
  text-align: center;
  padding: 24px;
}

.expired-icon {
  width: 56px;
  height: 56px;
  color: var(--clr-danger);
  margin-bottom: 16px;
}

.expired-content h3 {
  font-size: 1.2rem;
  color: var(--clr-text-bright);
  margin-bottom: 8px;
}

.expired-content p {
  font-size: 0.88rem;
  color: var(--clr-text-dim);
  margin-bottom: 20px;
}

/* result card needs position:relative for the overlay */
#stepResult {
  position: relative;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  margin-top: auto;
  padding-top: 32px;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--clr-text-dim);
  opacity: 0.5;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page-wrapper {
    padding: 24px 14px 40px;
  }

  .card {
    padding: 24px 18px;
  }

  .input-group {
    flex-direction: column;
  }

  .logo-text h1 {
    font-size: 1.3rem;
  }

  .key-segment {
    font-size: 1rem;
    padding: 6px 8px;
  }

  .download-buttons {
    grid-template-columns: 1fr;
  }

  .urgent-warning {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}