/* =============================================
   FANTASTIC TECH — Design System
   Light, restrained, Apple/Gemini-influenced.
   Signature: ambient floating node network (canvas)
   ============================================= */

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

:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-card-2: #f4f5f7;
  --border: #e6e8eb;
  --border-bright: #d3d8de;
  --accent-a: #4f7cff;
  --accent-b: #9b6fff;
  --accent-grad: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
  --text: #1d1d1f;
  --text-muted: #6e7077;
  --text-dim: #45474c;
  --success: #1fae6a;
  --warning: #c8791a;
  --danger: #e0463f;
  --radius: 14px;
  --radius-lg: 22px;
  --transition: 0.2s cubic-bezier(.4, 0, .2, 1);
  --header-h: 64px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  padding-bottom: 60px;
  position: relative;
}

/* ---- AMBIENT BACKGROUND CANVAS ---- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* lift real content above the canvas */
.site-header,
.pricing-section,
.download-section,
.guide-section,
.site-footer,
.modal,
.overlay {
  position: relative;
  z-index: 1;
}

/* ---- HEADER ---- */
.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 250, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--accent-grad);
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.header-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.header-nav a:hover {
  color: var(--text);
}

.header-nav .nav-login {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-card-2);
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.header-nav .nav-login:hover {
  background: var(--border);
}

@media (max-width: 480px) {
  .header-nav {
    gap: 14px;
  }

  .header-nav a:not(.nav-login) {
    display: none;
  }
}

/* ---- SITE HEADLINE ---- */
.eyebrow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-a);
  margin-top: 56px;
}

.site-title {
  text-align: center;
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 10px;
  color: var(--text);
}

.site-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 10px;
  margin-bottom: 8px;
}

/* ---- PRICING ---- */
.pricing-section {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

@media (max-width: 480px) {
  .plans {
    grid-template-columns: 1fr;
  }
}

.plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.plan:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* signature element: gradient ring on featured card */
.plan--featured {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--accent-grad) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 8px 28px rgba(79, 124, 255, 0.14);
}

.plan-badge {
  display: inline-block;
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.plan-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.plan-price {
  font-size: 2.2rem;
  font-weight: 750;
  color: var(--text);
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.plan-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 24px;
}

.plan-features li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding-left: 18px;
  position: relative;
}

.plan-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-grad);
}

.btn-subscribe {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  background: var(--text);
  color: #fff;
}

.plan--featured .btn-subscribe {
  background: var(--accent-grad);
}

.btn-subscribe:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

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

.login-link {
  text-align: center;
  margin-top: 22px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.login-link a {
  color: var(--accent-a);
  text-decoration: none;
  font-weight: 600;
}

/* ---- DOWNLOAD ---- */
.download-section {
  max-width: 700px;
  margin: 64px auto 0;
  padding: 0 20px;
}

.download-section h2,
.guide-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.dl-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}

.dl-btn:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-2);
}

.dl-icon {
  font-size: 1.3rem;
}

.dl-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dl-info strong {
  font-size: 0.86rem;
  font-weight: 600;
}

.dl-info small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ---- GUIDE ---- */
.guide-section {
  max-width: 700px;
  margin: 48px auto 0;
  padding: 0 20px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  flex: 1;
  min-width: 120px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.3;
}

.step-arrow {
  color: var(--text-muted);
  font-size: 1rem;
}

@media (max-width: 480px) {
  .step-arrow {
    display: none;
  }

  .steps {
    flex-direction: column;
  }

  .step {
    width: 100%;
  }
}

/* ---- FOOTER ---- */
.site-footer {
  text-align: center;
  margin-top: 72px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =============================================
   MODALS
   ============================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 25, 0.42);
  backdrop-filter: blur(6px);
  z-index: 100;
  transition: opacity 0.2s;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  position: relative;
  animation: slideUp 0.25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text);
}

.modal-box h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* email input */
#input-email {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 11px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 8px;
}

#input-email:focus {
  border-color: var(--accent-a);
}

.field-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-bottom: 12px;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity var(--transition);
}

.btn-primary:hover {
  opacity: 0.88;
}

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

/* ---- PAYMENT METHOD TOGGLE ---- */
.pay-method-toggle {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.pay-method {
  flex: 1;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.pay-method.active {
  border-color: transparent;
  background: var(--accent-grad);
  color: #fff;
}

/* ---- PAYMENT MODAL (QR) ---- */
.payment-amount {
  font-size: 1.6rem;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 20px;
}

.qr-container {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
}

.qr-loading p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qr-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-a);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.payment-timer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.timer {
  color: var(--warning);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.payment-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-status p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dots {
  display: flex;
  gap: 6px;
}

.dots span {
  width: 6px;
  height: 6px;
  background: var(--accent-a);
  border-radius: 50%;
  animation: pulse 1.2s ease infinite;
}

.dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ---- CARD MODAL (Stripe Payment Element) ---- */
#payment-element {
  margin-top: 4px;
  margin-bottom: 4px;
}

#card-form .btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#card-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#card-error {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
}

/* ---- SUCCESS MODAL ---- */
.modal-box--success {
  text-align: center;
}

.success-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.success-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.sub-qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  width: fit-content;
  margin: 0 auto 16px;
}

.sub-url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sub-url-box input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 0.7rem;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#copy-btn {
  padding: 10px 14px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

#copy-btn:hover {
  opacity: 0.88;
}

.email-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.usage-guide {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
}

.guide-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guide-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---- ACCESSIBILITY ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-a);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- UTILITY ---- */
.hidden {
  display: none !important;
}

/* =============================================
   PAYMENT-COMPLETE REDIRECT PAGE
   Reuses existing tokens from the main stylesheet —
   no new colors or fonts introduced.
   ============================================= */

.redirect-section {
  max-width: 480px;
  margin: 0 auto;
  padding: 80px 20px 0;
  display: flex;
  justify-content: center;
}

.redirect-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.redirect-state h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.redirect-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.spinner--lg {
  width: 40px;
  height: 40px;
  margin: 0 auto;
}

.fail-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary--link {
  display: inline-block;
  text-decoration: none;
  width: auto;
  padding: 12px 28px;
  margin-top: 20px;
}