/* ==========================================================================
   Assemblo — supplemental styles: resilient image tiles, utilities, print.
   Photographs load from Unsplash; if any fail (offline / file://), a branded
   gradient tile with a label shows instead of a broken-image icon.
   ========================================================================== */

/* Resilient media tile */
.media { position: relative; overflow: hidden; background: var(--navy);
  background-image: linear-gradient(135deg, #1a2c5e 0%, #0e1730 55%, #2a1c3f 100%); }
.media::after {
  content: attr(data-label); position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center; padding: 24px; text-align: center;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.4);
}
.media img { position: relative; z-index: 1; }
.media img[data-failed] { display: none; }

/* decorative grid texture */
.texture { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(77,124,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,124,255,.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 0, #000, transparent 70%);
  mask-image: radial-gradient(circle at 50% 0, #000, transparent 70%);
}

/* utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--text-dim); }
.pill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-tags span { font-family: var(--font-mono); font-size: .76rem; padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--glass-brd); background: var(--surface); color: var(--text-soft); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.text-amber { color: var(--amber); } .text-blue { color: var(--blue-bright); } .text-mint { color: var(--mint); }

/* two-up prose for legal/about */
.prose { max-width: 760px; margin-inline: auto; }
.prose h2 { margin: 40px 0 14px; } .prose h3 { margin: 28px 0 10px; }
.prose p, .prose li { color: var(--text-soft); margin-bottom: 14px; }
.prose ul { padding-left: 20px; list-style: disc; } .prose li { margin-bottom: 8px; }
.prose a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Module marketplace + builder --------------------------------- */
.mod-card { display: flex; flex-direction: column; }
.mod-card.sel { border-color: var(--blue); background: linear-gradient(180deg, rgba(77,124,255,.10), var(--surface)); box-shadow: var(--shadow-glow); }
.mod-card.core.sel { box-shadow: 0 0 0 1px rgba(70,227,176,.4), var(--shadow); border-color: var(--mint); }
.mod-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.mod-top .ic { margin-bottom: 0; }
.mod-badge { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-pill); background: rgba(255,181,71,.16); color: var(--amber); border: 1px solid rgba(255,181,71,.3); white-space: nowrap; }
.mod-badge.core-badge { background: rgba(70,227,176,.14); color: var(--mint); border-color: rgba(70,227,176,.3); }
.mod-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.mod-card p { font-size: .9rem; color: var(--text-soft); flex: 1; }
.mod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mod-price b { font-family: var(--font-display); font-size: 1.15rem; }
.mod-toggle { --pad: 9px 16px; font-size: .86rem; }
.mod-toggle.added { box-shadow: none; }

.builder-bar { position: sticky; bottom: 18px; z-index: 40; margin-top: 36px;
  background: var(--glass); backdrop-filter: blur(12px) saturate(140%); border: 1px solid var(--blue);
  border-radius: var(--r-lg); padding: 20px 26px; box-shadow: var(--shadow-glow);
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.builder-bar .bld-count { display: flex; flex-direction: column; }
.builder-bar .bld-count .n { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; }
.builder-bar .bld-count .l { font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.builder-bar .bld-rec { font-size: .9rem; color: var(--text-soft); }
.builder-bar .bld-rec b { color: var(--text); }
.builder-bar .bld-cta { display: flex; align-items: center; gap: 18px; }
.builder-bar .bld-total { text-align: right; }
.builder-bar .bld-total .t { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; line-height: 1; }
.builder-bar .bld-total .t span { font-size: .9rem; color: var(--text-dim); font-weight: 500; }

/* ---------- Login / signup ----------------------------------------------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 980px; margin: 0 auto; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--glass-brd); box-shadow: var(--shadow); }
.auth-aside { position: relative; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(160deg, #2c54d4 0%, #21306a 55%, #14224f 100%); overflow: hidden; }
.auth-aside .blob { opacity: .4; }
.auth-aside h2 { color: #fff; } .auth-aside p { color: #cdd8f3; }
.auth-aside .a-feat { display: grid; gap: 14px; margin-top: 26px; }
.auth-aside .a-feat li { display: flex; gap: 12px; align-items: center; color: #e7edff; font-size: .95rem; }
.auth-aside .a-feat .tk { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.16); }
.auth-form { padding: 48px 44px; background: var(--navy-2); }
.auth-tabs { display: flex; gap: 6px; padding: 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--glass-brd); margin-bottom: 28px; }
.auth-tabs button { flex: 1; padding: 10px; border-radius: var(--r-pill); font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--text-dim); transition: .2s; }
.auth-tabs button.on { background: var(--blue); color: #fff; }
.auth-demo-note { font-size: .78rem; color: var(--text-dim); margin-top: 16px; text-align: center; }

/* ---------- Account dashboard -------------------------------------------- */
.acc-grid { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }
.acc-side { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); padding: 22px; }
.acc-user { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.acc-av { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff; background: linear-gradient(150deg, var(--blue-bright), var(--blue-deep)); }
.acc-user b { font-family: var(--font-display); display: block; } .acc-user span { font-size: .82rem; }
.acc-nav { display: grid; gap: 4px; }
.acc-nav a { padding: 10px 14px; border-radius: var(--r-sm); color: var(--text-soft); font-weight: 500; font-size: .92rem; transition: .2s; }
.acc-nav a:hover, .acc-nav a.active { background: var(--surface-2); color: var(--text); }
.acc-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 26px; }
.acc-stat { background: var(--surface); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); padding: 22px; }
.acc-stat.hl { background: linear-gradient(160deg, rgba(77,124,255,.16), var(--surface)); border-color: var(--blue); }
.acc-stat .lbl { font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.acc-stat .val { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; display: block; margin: 8px 0 4px; }
.acc-stat .muted { font-size: .82rem; }
.acc-block { background: var(--surface); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); padding: 26px; margin-bottom: 22px; }
.acc-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.acc-block-head h3 { font-size: 1.2rem; }
.acc-mod-list { display: grid; gap: 10px; }
.acc-mod-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--navy-2); }
.acc-mod-row.owned { border-color: rgba(70,227,176,.35); background: rgba(70,227,176,.06); }
.acc-mod-row .ic { width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center; background: rgba(77,124,255,.14); border: 1px solid rgba(77,124,255,.28); color: var(--blue-bright); }
.acc-mod-row .ic svg { width: 22px; height: 22px; }
.acc-mod-meta b { font-family: var(--font-display); display: block; font-size: .98rem; } .acc-mod-meta span { font-size: .8rem; }
.acc-mod-row .btn { --pad: 8px 16px; font-size: .82rem; }
.acc-bill { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.acc-bill-row { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: .94rem; color: var(--text-soft); }
.acc-bill-row.total { background: var(--surface-2); font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: 1.05rem; border-bottom: 0; }
.acc-inv-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr auto; gap: 14px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.acc-inv-row:last-child { border-bottom: 0; }
.inv-paid { color: var(--mint); font-weight: 600; font-size: .82rem; }

@media (max-width: 880px) {
  .builder-bar { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .builder-bar .bld-cta { justify-content: center; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; }
  .acc-grid { grid-template-columns: 1fr; } .acc-side { position: static; }
  .acc-cards { grid-template-columns: 1fr; }
  .acc-inv-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Checkout / payment gateway ----------------------------------- */
.pay-grid { display: grid; grid-template-columns: 1fr 420px; gap: 30px; align-items: start; }
.pay-summary { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); padding: 28px; }
.pay-summary h3 { font-size: 1.2rem; margin-bottom: 18px; }
.order-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .94rem; color: var(--text-soft); }
.order-row b { font-family: var(--font-display); color: var(--text); font-weight: 600; }
.order-row .mini { font-size: .8rem; color: var(--text-dim); }
.order-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; margin-top: 6px; }
.order-total .lbl { font-family: var(--font-display); font-weight: 600; }
.order-total .amt { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; }
.order-total .amt span { font-size: .85rem; color: var(--text-dim); font-weight: 500; }
.secure-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: .8rem; color: var(--text-dim); }
.secure-row svg { width: 15px; height: 15px; color: var(--mint); }
.trust-cards { display: flex; gap: 7px; margin-top: 14px; opacity: .85; flex-wrap: wrap; }
.trust-cards span { font-family: var(--font-mono); font-size: .62rem; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); background: var(--navy-2); }

.pay-form { background: var(--surface); border: 1px solid var(--glass-brd); border-radius: var(--r-lg); padding: clamp(24px,4vw,40px); }
.pay-methods { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 26px; }
.pay-method { padding: 13px 8px; border-radius: var(--r); border: 1px solid var(--glass-brd); background: var(--navy-2); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: var(--text-soft); transition: .2s; cursor: pointer; }
.pay-method svg { width: 22px; height: 22px; }
.pay-method:hover { border-color: var(--blue); color: var(--text); }
.pay-method.on { border-color: var(--blue); background: rgba(77,124,255,.12); color: var(--text); box-shadow: var(--shadow-glow); }
.card-visual-row { position: relative; }
.card-brand { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--blue-bright); pointer-events: none; }
.pay-alt { text-align: center; padding: 30px 10px; }
.pay-alt .ic-big { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: rgba(77,124,255,.12); border: 1px solid rgba(77,124,255,.3); }
.pay-alt .ic-big svg { width: 32px; height: 32px; color: var(--blue-bright); }
.pay-success { text-align: center; padding: 36px 10px; }
.pay-success .check { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 22px; display: grid; place-items: center; background: rgba(70,227,176,.14); border: 1px solid rgba(70,227,176,.4); animation: popIn .5s var(--ease-out); }
.pay-success .check svg { width: 44px; height: 44px; color: var(--mint); }
.save-callout { font-size: .85rem; color: var(--text-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 11px 14px; margin: 4px 0 10px; }
.save-callout.on { color: var(--text); background: rgba(70,227,176,.1); border: 1px solid rgba(70,227,176,.35); }
.save-callout b { color: var(--mint); font-family: var(--font-display); }
@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

@media (max-width: 880px) {
  .pay-grid { grid-template-columns: 1fr; } .pay-summary { position: static; order: 2; }
  .pay-methods { grid-template-columns: repeat(2,1fr); }
}

@media print {
  .nav, .chat-fab, .chat-panel, .cookie, .to-top, .mobile-panel, .blob { display: none !important; }
  body { background: #fff; color: #000; }
}
