/* ══════════════════════════════════════════════════════════════
   FORALA shared theme layer — brand polish on top of page styles.
   Loaded AFTER page css on: index, buy, profile, admin.
   Tokens honor runtime --primary (AppConfig) with purple fallback.
   Rule: gradient hairline borders + depth shadows. No outer color glow.
   ══════════════════════════════════════════════════════════════ */
:root {
  --fr-primary: var(--primary, #c795ed);
  --fr-primary-2: #8b5cf6;
  --fr-ink: var(--text-main, #f4f2fa);
  --fr-muted: var(--text-muted, #94a3b8);
  --fr-card: var(--card-bg, rgba(255, 255, 255, 0.03));
  --fr-border: var(--border-color, rgba(255, 255, 255, 0.08));
  --fr-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Form text visibility (black-on-dark inputs look empty) ── */
input, select, textarea {
  color: var(--fr-ink);
}
/* Kill native password reveal eyes (Edge/Chrome duplicate our custom toggle) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-contacts-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}
input::placeholder, textarea::placeholder {
  color: var(--fr-muted);
  opacity: 0.75;
}

/* ── Typography: tight Inter grotesque for headlines (ref-style).
   Unbounded lives ONLY in the pill logo. Mono for codes. ── */
.hero .title, .buy-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.price-amount, .bento-card-val, .stat-value, .hero-stat b, .stat-item b,
#walletBalanceText, #modalUserWalletBalance {
  font-variant-numeric: tabular-nums;
}
.key-pill, #hwidModalValue, #modalActKeyCode,
#generatedKeysText, code, .mono, .receipt-value, #refCodeText {
  font-family: var(--fr-mono);
}
.nav-pill-logo-text {
  font-family: var(--fr-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}

/* ── Pill blur upgrade (Dimasic-style frosted pill) ── */
.navbar-pill {
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
}

/* ── Buttons: sheen sweep on primary CTAs, depth shadow on hover ── */
.btn-primary, .btn-buy, .btn-pay-new, .btn-action-primary, .btn-save,
.bento-action-btn, .bento-btn-download, .modal-submit-btn {
  position: relative;
  overflow: hidden;
  transition: transform 160ms var(--fr-ease-out), box-shadow 250ms var(--fr-ease-out), filter 200ms;
}
.btn-primary:hover, .btn-buy:hover, .btn-pay-new:hover, .btn-action-primary:hover,
.bento-action-btn:hover, .bento-btn-download:hover, .modal-submit-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary::after, .btn-buy::after, .btn-pay-new::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn-primary:hover::after, .btn-buy:hover::after, .btn-pay-new:hover::after { left: 130%; }

/* ── Framing: gradient hairline borders (no glow).
   1px transparent border + surface in padding-box, gradient in border-box. ── */
.prod-tile, .price-card, .product-card, .mods-card {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-bg, rgba(22, 22, 26, 0.9)), var(--card-bg, rgba(22, 22, 26, 0.9))) padding-box,
    linear-gradient(140deg, rgba(199, 149, 237, 0.55), rgba(255, 255, 255, 0.08) 26%, rgba(255, 255, 255, 0.06) 74%, rgba(139, 92, 246, 0.5)) border-box;
}
.bento-card {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bento-card-bg, rgba(18, 18, 24, 0.75)), var(--bento-card-bg, rgba(18, 18, 24, 0.75))) padding-box,
    linear-gradient(140deg, rgba(199, 149, 237, 0.5), rgba(255, 255, 255, 0.07) 26%, rgba(255, 255, 255, 0.06) 74%, rgba(139, 92, 246, 0.45)) border-box;
}
/* Hot / highlighted cards: stronger stroke */
.price-card.hot, .product-card.card-highlight, .bento-beta-card {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-bg, rgba(22, 22, 26, 0.9)), var(--card-bg, rgba(22, 22, 26, 0.9))) padding-box,
    linear-gradient(140deg, rgba(199, 149, 237, 0.9), rgba(199, 149, 237, 0.25) 40%, rgba(139, 92, 246, 0.7)) border-box;
}
/* Cards: hover lift + depth */
.product-card, .bento-card, .stat-card, .admin-card {
  transition: transform 220ms var(--fr-ease-out), border-color 220ms, box-shadow 250ms var(--fr-ease-out);
}
.prod-tile, .price-card {
  transition: transform 220ms var(--fr-ease-out), box-shadow 250ms var(--fr-ease-out);
}
.prod-tile:hover, .price-card:hover, .product-card:hover, .bento-card:hover {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translateY(-3px);
}
.card-highlight, .popular-card {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

/* ── Role pills: ring instead of glow ── */
.bento-role-pill.role-beta, .role-pill.Beta {
  border: 1px solid rgba(245, 158, 11, 0.55);
}
.bento-role-pill.role-admin, .role-pill.Admin {
  border: 1px solid rgba(199, 149, 237, 0.6);
}

/* ── Hero (landing) ── */
.hero {
  position: relative;
  overflow: hidden;
}
/* Ambient page glow: fixed, full-bleed, never has edges */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 380px at 50% -80px, rgba(199, 149, 237, 0.1), transparent 70%),
    radial-gradient(560px 340px at 88% 22%, rgba(139, 92, 246, 0.07), transparent 70%),
    radial-gradient(560px 340px at 12% 40%, rgba(199, 149, 237, 0.05), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero .title {
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1.02;
}
.hero .subtitle {
  font-size: clamp(15px, 2vw, 18px);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}
.hero-scroll-cue {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  opacity: 0.6;
}
.hero-scroll-cue span {
  width: 22px;
  height: 36px;
  border-radius: 12px;
  border: 1.5px solid var(--fr-muted);
  position: relative;
  display: block;
}
.hero-scroll-cue span::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: var(--fr-primary);
  animation: cueDrop 1.8s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}
@keyframes cueDrop {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
/* ── Hero live feed (real activations, rotating line) ── */
.hero-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--fr-muted);
}
.hero-live .pulse-dot { width: 6px; height: 6px; }
.hero-live b { color: var(--fr-ink); font-weight: 700; }
#heroLiveText { transition: opacity 250ms var(--fr-ease-out); }
#heroLiveText.swap { opacity: 0; }

/* ── Section titles ── */
.mods-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(26px, 3.4vw, 38px);
  text-align: center;
  color: var(--fr-ink);
}
.mods-sub { text-align: center; color: var(--fr-muted); font-size: 14px; margin: 8px 0 20px; }

/* ── Centered containers: explicit width is mandatory.
   Bare `margin: 0 auto` collapses in this layout — every centered
   max-width block gets width: calc(100% - 48px). ── */
.prod-strip, .mods-showcase, .price-preview, .stats-band, .faq-teaser {
  width: calc(100% - 48px);
  box-sizing: border-box;
}
.cta-section { width: calc(100% - 48px); box-sizing: border-box; }
.prod-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 34px 24px 6px;
}
.prod-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px;
  border-radius: 18px;
  text-decoration: none;
}
.prod-tile-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(199, 149, 237, 0.12);
  border: 1px solid rgba(199, 149, 237, 0.28);
  color: var(--fr-primary);
  margin-bottom: 6px;
}
.prod-tile-icon svg { width: 17px; height: 17px; }
.prod-tile-name { font-size: 15px; font-weight: 800; color: var(--fr-ink); }
.prod-tile-desc { font-size: 12.5px; color: var(--fr-muted); line-height: 1.45; }
.prod-tile-price { font-size: 14px; font-weight: 800; color: var(--fr-ink); font-variant-numeric: tabular-nums; }
.prod-tile-price:empty { display: none; }
.prod-tile-go { font-size: 12.5px; font-weight: 700; color: var(--fr-primary); margin-top: 6px; }
@media (max-width: 900px) {
  .prod-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .prod-strip { grid-template-columns: 1fr; }
}

/* ── Modules showcase (landing) ── */
.mods-showcase { max-width: 1100px; margin: 0 auto; padding: 44px 24px 6px; }
.mods-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 22px;
  overflow: hidden;
}
.mods-list { display: flex; flex-direction: column; padding: 12px; gap: 6px; }
.mod-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fr-ink);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 180ms var(--fr-ease-out), border-color 180ms;
}
.mod-row:hover { background: rgba(255, 255, 255, 0.03); }
.mod-row.active { background: rgba(199, 149, 237, 0.1); border-color: rgba(199, 149, 237, 0.35); }
.mod-row-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(199, 149, 237, 0.12);
  border: 1px solid rgba(199, 149, 237, 0.28);
  color: var(--fr-primary);
}
.mod-row-icon svg { width: 17px; height: 17px; }
.mod-row-name { font-size: 14.5px; font-weight: 700; flex: 1; }
.mod-state {
  font-family: var(--fr-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--fr-muted);
  min-width: 30px;
  text-align: right;
}
.mods-state-badge {
  font-family: var(--fr-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 8px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  transition: color 200ms var(--fr-ease-out), background 200ms var(--fr-ease-out), border-color 200ms var(--fr-ease-out);
}
.mods-state-badge.off {
  color: #8b8b98;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--fr-border);
}
.mods-detail { transition: opacity 200ms var(--fr-ease-out); }
.mods-detail.swap { opacity: 0; }
.mod-feat { transition: opacity 200ms var(--fr-ease-out); }
.mods-detail.swap .mod-feat { opacity: 0; }
.mod-switch {
  width: 40px; height: 23px; flex-shrink: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--fr-border);
  position: relative;
  transition: background 200ms var(--fr-ease-out), border-color 200ms;
}
.mod-switch .mod-knob {
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #8b8b98;
  transition: transform 200ms var(--fr-ease-out), background 200ms;
}
.mod-switch.on { background: rgba(74, 222, 128, 0.25); border-color: rgba(74, 222, 128, 0.5); }
.mod-switch.on .mod-knob { transform: translateX(17px); background: #4ade80; }
.mods-detail {
  padding: 26px;
  border-left: 1px solid var(--fr-border);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
}
.mods-detail-name { font-family: 'Inter', system-ui, sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.mods-detail-desc { font-size: 13.5px; color: var(--fr-muted); line-height: 1.55; }
.mods-feats { display: flex; flex-direction: column; margin-top: 6px; border-top: 1px solid var(--fr-border); }
.mod-feat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--fr-border);
  font-size: 13px;
}
.mod-feat span { color: var(--fr-muted); }
.mod-feat b { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .mods-card { grid-template-columns: 1fr; }
  .mods-detail { border-left: none; border-top: 1px solid var(--fr-border); }
}

/* ── Pricing preview (landing) ── */
.price-preview { max-width: 1100px; margin: 0 auto; padding: 44px 24px 6px; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.price-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 24px 22px;
  border-radius: 20px;
  text-decoration: none;
}
.price-card-term { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fr-primary); }
.price-card-price { font-family: 'Inter', system-ui, sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--fr-ink); font-variant-numeric: tabular-nums; }
.price-card-name { font-size: 13px; color: var(--fr-muted); }
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }

/* ── FAQ teaser (landing, native details) ── */
.faq-teaser { max-width: 1100px; width: calc(100% - 48px); margin: 0 auto; padding: 44px 24px 6px; box-sizing: border-box; }
.faq-teaser .mods-title { margin-bottom: 18px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.faq-item { width: 100%; }
.faq-item {
  border-radius: 16px;
  background: var(--fr-card);
  border: 1px solid var(--fr-border);
  overflow: hidden;
  transition: border-color 200ms var(--fr-ease-out);
}
.faq-item[open] { border-color: rgba(199, 149, 237, 0.4); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fr-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(199, 149, 237, 0.12);
  border: 1px solid rgba(199, 149, 237, 0.3);
  color: var(--fr-primary);
  font-size: 17px;
  font-weight: 400;
  transition: transform 260ms var(--fr-ease-out), background 200ms;
}
.faq-item[open] summary::after { transform: rotate(45deg); background: rgba(199, 149, 237, 0.22); }
/* Animated open: grid-rows trick */
.faq-item .faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms var(--fr-ease-out);
}
.faq-item[open] .faq-a { grid-template-rows: 1fr; }
.faq-item .faq-a > div { overflow: hidden; }
.faq-item .faq-a p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--fr-muted);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 240ms var(--fr-ease-out), transform 240ms var(--fr-ease-out);
}
.faq-item[open] .faq-a p { opacity: 1; transform: none; }

/* ── Stat cards / pills ── */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(199, 149, 237, 0.7), transparent);
  opacity: 0.7;
}

/* ── Admin cockpit: mono numbers, micro headers ── */
.admin-table th {
  font-family: var(--fr-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fr-muted);
  white-space: nowrap;
}
.admin-table td .key-pill, .admin-table td b {
  font-variant-numeric: tabular-nums;
}
#keysBody .key-pill, #logsBody td:first-child {
  font-family: var(--fr-mono);
  font-size: 12px;
}

/* ── Cabinet icon chips ── */
.bento-card-head > svg.lucide, .bento-card-head > i.fa-brands {
  background: rgba(199, 149, 237, 0.12);
  border: 1px solid rgba(199, 149, 237, 0.25);
  border-radius: 9px;
  padding: 5px;
  box-sizing: content-box;
}

/* ── Buy cards: gradient top edge ── */
.product-card { position: relative; overflow: hidden; }
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(199, 149, 237, 0.75), transparent);
}
.product-card.card-highlight::before {
  background: linear-gradient(90deg, transparent, #c795ed, transparent);
}

/* ── CTA pack card ── */
.cta-pack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: 18px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(199,149,237,0.14), rgba(139,92,246,0.06));
  border: 1px solid rgba(199,149,237,0.35);
  transition: transform 220ms var(--fr-ease-out), border-color 220ms, box-shadow 250ms var(--fr-ease-out);
}
.cta-pack:hover {
  transform: translateY(-3px);
  border-color: rgba(199,149,237,0.6);
  box-shadow: 0 14px 36px rgba(0,0,0,0.35);
}
.cta-pack-name { font-size: 19px; font-weight: 800; color: var(--fr-ink); }
.cta-pack-desc { font-size: 13px; color: var(--fr-muted); }
/* CTA balance + button case */
.cta-box { gap: 40px; }
.cta-left { flex: 1 1 auto; max-width: 600px; }
.cta-left .btn-primary { text-transform: none; letter-spacing: 0; }
.cta-right { flex: 0 0 320px; }
.cta-pack { width: 100%; }
@media (max-width: 900px) {
  .cta-right { flex: 1 1 auto; width: 100%; }
}

/* ── AspectGuard credit (footer, own row, aligned with copyright) ── */
.ag-credit-row {
  text-align: left;
  font-size: 12px;
  color: var(--fr-muted);
  padding: 0;
  margin-top: 14px;
}
.ag-sep { opacity: 0.5; margin: 0 2px; }
.ag-credit {
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(100deg, #cfb3f5, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ag-credit:hover {
  filter: brightness(1.1);
  animation: agBreathe 3s ease-in-out infinite;
}
@keyframes agBreathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.light-theme .ag-credit {
  background: linear-gradient(100deg, #7c3aed, #4c1d95);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.light-theme .ag-credit:hover {
  animation: agBreathe 3s ease-in-out infinite;
  filter: brightness(1.05);
}
@media (prefers-reduced-motion: reduce) {
  .ag-credit:hover { animation: none; }
}

/* ── Light theme tuning ── */
.light-theme .product-card:hover, .light-theme .bento-card:hover { box-shadow: 0 14px 34px rgba(139, 92, 246, 0.16); }

@media (prefers-reduced-motion: reduce) {
  .btn-primary::after, .btn-buy::after, .btn-pay-new::after { display: none; }
}
