/* UWA purchase app — styles. Reuses the landing's design tokens (dark
 * #04060f default + light theme, primary #3b82f6 / secondary #8b5cf6, glass) so
 * the app matches uwa-promo-website.html. Theme is toggled via [data-theme] on
 * <html> and persisted in localStorage('uwapro-theme'). */

:root {
  --bg-base: #04060f;
  --bg-surface: rgba(13, 20, 38, 0.55);
  --bg-surface-solid: #0b0f1e;
  --bg-card: rgba(20, 30, 54, 0.45);
  --bg-input: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.16);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-sub: #cbd5e1;

  --primary: #3b82f6;
  --primary-rgb: 59, 130, 246;
  --secondary: #8b5cf6;
  --secondary-rgb: 139, 92, 246;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --glow-intensity: 0.16;
  --shadow-intensity: rgba(0, 0, 0, 0.5);
  --glass-blur: 16px;

  --radius-md: 12px;
  --radius-lg: 20px;

  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Segoe UI', var(--font-ui);
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

:root[data-theme='light'] {
  --bg-base: #f4f6fc;
  --bg-surface: rgba(255, 255, 255, 0.75);
  --bg-surface-solid: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-input: rgba(0, 0, 0, 0.02);
  --border-color: rgba(0, 0, 0, 0.1);
  --border-color-hover: rgba(0, 0, 0, 0.2);

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-sub: #374151;

  --primary: #2563eb;
  --primary-rgb: 37, 99, 235;
  --secondary: #7c3aed;
  --secondary-rgb: 124, 58, 237;

  --glow-intensity: 0.06;
  --shadow-intensity: rgba(0, 0, 0, 0.08);
  --glass-blur: 12px;
}

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

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

body {
  font-family: var(--font-ui);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background orbs (subtle, matches the landing). */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: var(--glow-intensity);
  mix-blend-mode: screen;
}
.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 80%);
  top: -12%;
  left: -8%;
}
.orb-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 80%);
  bottom: -12%;
  right: -8%;
}

/* Layout */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  margin-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}
.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.brand-pro {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-tag {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.theme-btn:hover {
  border-color: var(--border-color-hover);
  transform: scale(1.05);
}
.theme-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Screens */
.screen {
  animation: fadeIn 0.35s ease;
}
.hidden {
  display: none !important;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-head {
  text-align: center;
  margin: 12px 0 28px;
}
/* Enticing (small) kicker above the plan heading. */
.plans-kicker {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.screen-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.screen-sub {
  max-width: 520px;
  margin: 0 auto;
}
.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Card (glass) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 15px 40px var(--shadow-intensity);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* Package grid */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 560px) {
  .pkg-grid {
    grid-template-columns: 1fr;
  }
}
.pkg-card {
  position: relative;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 22px 22px;
  cursor: pointer;
  color: var(--text-main);
  font-family: var(--font-ui);
  box-shadow: 0 10px 30px var(--shadow-intensity);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.pkg-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-color-hover);
  box-shadow: 0 20px 44px var(--shadow-intensity);
}
.pkg-card-best {
  border: 2px solid var(--accent-amber);
  box-shadow: 0 18px 44px rgba(234, 179, 8, 0.16);
}
.pkg-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(135deg, var(--accent-amber), #f59e0b);
  color: #111827;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}
.pkg-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  margin-bottom: 2px;
}
.pkg-dur {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.pkg-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.pkg-cur {
  font-size: 1.4rem;
  font-weight: 800;
}
.pkg-amt {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.pkg-permo {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 8px;
}
.pkg-onetime {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
  margin-bottom: 20px;
}
.pkg-cta {
  margin-top: auto;
  display: block;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
  transition: filter 0.2s ease;
}
.pkg-card:hover .pkg-cta {
  filter: brightness(1.08);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 12px;
}
.btn-lg {
  padding: 15px 22px;
  font-size: 1.05rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.3);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.btn-ghost {
  background: var(--bg-input);
  border-color: var(--border-color);
  color: var(--text-sub);
}
.btn-ghost:hover {
  border-color: var(--border-color-hover);
  color: var(--text-main);
}
.btn-back {
  width: auto;
  margin: 0 0 14px;
  padding: 8px 16px;
  font-size: 0.9rem;
}
.btn-copy {
  width: auto;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.btn-cancel {
  color: var(--accent-rose);
}

/* Pay screen */
.pay-card .pay-head {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.pay-head-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pay-head-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.pay-head-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}
.pay-dur {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.pay-amount {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.4rem;
  letter-spacing: -0.02em;
}
.pay-cur {
  font-size: 1.5rem;
  vertical-align: baseline;
  margin-right: 2px;
}
.usdt {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
}
.field-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 8px;
}
.email-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 1rem;
  transition: all 0.2s ease;
}
.email-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.pay-trc20 {
  text-align: center;
  margin-bottom: 16px;
}
.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 16px;
}
.qr-wrap img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 8px 24px var(--shadow-intensity);
}
.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.key-row-lg {
  justify-content: center;
}
.mono {
  font-family: var(--font-mono);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  word-break: break-all;
  flex: 1;
}
.mono.license {
  flex: initial;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
  padding: 16px 18px;
}
.pay-receipt {
  margin-top: 14px;
  font-size: 0.85rem;
  word-break: break-word;
}
.pay-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}
.pay-warn {
  margin-top: 10px;
  color: var(--accent-rose);
  font-size: 0.82rem;
  text-align: center;
}

/* Status */
.status-card,
.delivery-card {
  text-align: center;
}
.status-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  margin-bottom: 10px;
}
.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
}
.mark-ok {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}
.mark-bad {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.3);
}
.status-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* Delivery */
.expiry-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.expiry-row .field-label {
  margin: 0;
}
.expiry-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}
.email-note {
  margin-top: 14px;
  font-size: 0.9rem;
}
.dl-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
  text-align: left;
}
.dl-title {
  text-align: center;
}
.dl-sub-line {
  text-align: center;
  margin-bottom: 8px;
}
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  .download-grid {
    grid-template-columns: 1fr;
  }
}
.download-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s ease;
}
.download-btn:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}
.download-btn .dl-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}
.download-btn .dl-icon svg {
  width: 26px;
  height: 26px;
}
.download-btn .dl-text {
  display: flex;
  flex-direction: column;
}
.download-btn .dl-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.download-btn .dl-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- Home free-download block (above the plan grid) ------------------------ */
/* .free-dl is the FIRST child of #screen-home, so override .dl-block's top rule +
   spacing. These rules sit AFTER .dl-block in source order → equal specificity
   (0,1,0) resolves by source order in our favor. */
.free-dl {
  border-top: none;
  margin-top: 4px;
  padding-top: 0;
}
/* 3 across only from 481px up. Scoped to min-width:481px so it never overrides the
   base @media(max-width:480px){.download-grid{1fr}} → phones keep 1 column. */
@media (min-width: 481px) {
  .free-dl .download-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mac = native <details>. The <summary> carries the .download-btn visual; the menu
   overlays (position:absolute) so opening reflows nothing in the grid. */
.dl-mac {
  position: relative;
}
summary.dl-mac-sum {
  list-style: none;
  cursor: pointer;
}
summary.dl-mac-sum::-webkit-details-marker {
  display: none;
}
.dl-chev {
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.dl-mac[open] .dl-chev {
  transform: rotate(180deg);
}
.dl-mac-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  /* OPAQUE (not the ~3% --bg-input): as an absolute overlay this floats over the plan
     cards below, so a translucent bg would bleed them through and hurt legibility. */
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px var(--shadow-intensity);
}
/* The menu's display:flex overrides native <details> closed-state hiding in some
   engines, so hide it explicitly when closed (the base rule reveals it on open). */
.dl-mac:not([open]) .dl-mac-menu {
  display: none;
}
.dl-mac-opt {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.dl-mac-opt:hover {
  background: var(--border-color-hover);
  color: var(--primary);
}
.support {
  margin-top: 24px;
  font-size: 0.9rem;
}
.link {
  color: var(--primary);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--bg-surface-solid);
  color: var(--text-main);
  border: 1px solid var(--border-color-hover);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 10px 30px var(--shadow-intensity);
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
