/* Connect-specific styles on top of the shared Launchpad theme (site.css). */

/* ---------- Messages ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; max-width: 1160px; }
.pub-main > .flash { margin: 0 auto 14px; }
.flash .bi { margin-top: 2px; }
.flash.ok { background: var(--soft); color: var(--brand-ink); }
.flash.err { background: var(--red-soft); color: var(--red); }
.flash.warn { background: var(--amber-soft); color: var(--amber); }
.flash a { color: inherit; font-weight: 700; }

/* ---------- App pages ----------
   The shell (floating sidebar + top bar) is Launchpad's, in site.css. Pages fill the width next to the sidebar,
   lined up with the top bar's 24px side margins. */
body.app-body { background: var(--bg); }
.cx-page { padding: 16px 24px 40px; width: 100%; }
.cx-page > .flash { max-width: none; }
.side a.sitem { text-decoration: none; }
[data-bs-theme=light] .side .plan-chip:not(.pro) { background: var(--lane); color: var(--muted); }
@media (max-width: 900px) { .cx-page { padding: 12px 14px 32px; } }

/* ---------- Dashboard ---------- */
.cx-hello { display: flex; align-items: center; gap: 16px; background: var(--brand-grad); color: #fff; border-radius: 16px; padding: 18px 22px; margin-bottom: 16px; box-shadow: 0 8px 24px -10px rgba(63, 171, 53, .6); flex-wrap: wrap; }
.cx-hello h2 { color: #fff; font: 600 20px Poppins, Inter, sans-serif; margin: 0 0 2px; }
.cx-hello p { margin: 0; opacity: .92; }
.cx-hello-ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 22px; flex: 0 0 46px; }
.cx-hello.off { background: linear-gradient(135deg, #5b5f5a, #3c3c3b); box-shadow: var(--shadow-md); }
.cx-hello .btn-light { color: var(--charcoal); }
.cx-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .cx-grid { grid-template-columns: 1fr; } }
.cx-share { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.cx-qr { width: 180px; height: 180px; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 6px; flex: 0 0 180px; }
.min-w-0 { min-width: 0; }
.cx-sub { font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cx-sub .bi { color: var(--brand-ink); }
.panel hr { border-color: var(--line); opacity: 1; margin: 18px 0; }
.cx-preview-panel { position: sticky; top: 16px; }
.cx-phone { margin: 0 auto; width: 100%; max-width: 360px; height: 640px; border-radius: 34px; border: 10px solid var(--charcoal); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--bg); }
.cx-phone iframe { width: 100%; height: 100%; border: 0; }
.cx-pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--lane); color: var(--muted); }
.cx-pill.ok { background: var(--soft); color: var(--brand-ink); }

/* ---------- Forms ---------- */
/* Edit my card: card details stacked on the left, blocks on the right (Bootstrap row / col-xl-6). */
.cx-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cx-stack .panel, .cx-blocks { padding: 18px 20px; }
.cx-stack .panel .ph, .cx-blocks .ph { margin-bottom: 14px; align-items: center; }
.cx-stack .panel h3 .bi, .cx-blocks h3 .bi { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; margin-right: 10px; background: var(--soft); color: var(--brand-ink); font-size: 14px; vertical-align: middle; }
.cx-stack .panel h3, .cx-blocks h3 { display: flex; align-items: center; }
.cx-count { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--lane); border-radius: 99px; padding: 1px 8px; }

/* Top bar "Card on / off" switch */
.cx-live-switch { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.cx-live-switch .form-check-input { margin: 0; cursor: pointer; }
.cx-live-switch.on { background: var(--soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); color: var(--brand-ink); }
@media (max-width: 520px) { .cx-live-text { display: none; } }
.cx-photo-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.cx-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: 0 0 84px; border: 1px solid var(--line); }
/* Referrals */
.auth-referral { display: flex; align-items: center; gap: 10px; background: var(--soft); color: var(--brand-ink); border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; font-size: 14px; }
.auth-referral b { color: var(--ink); }
.cx-ref-code { font: 700 30px/1.1 Poppins, Inter, sans-serif; letter-spacing: .12em; color: var(--ink); background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--brand) 55%, var(--line)); border-radius: 12px; padding: 12px 16px; text-align: center; margin-bottom: 12px; }
.cx-ref-table { width: 100%; }
.cx-ref-table td, .cx-ref-table th { padding: 10px 6px; border-bottom: 1px solid var(--line2); }
.cx-ref-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.cx-ref-table tr:last-child td { border-bottom: 0; }
.cx-ref-table td:first-child { color: var(--ink); font-weight: 600; }

/* Blocks on Edit my card: a summary tile each, edited in a side panel (offcanvas) */
.cx-blocks { scroll-margin-top: calc(var(--tbh, 72px) + 10px); }
.cx-blocks-empty { display: flex; align-items: center; gap: 10px; padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.cx-btiles { display: flex; flex-direction: column; gap: 10px; }
.cx-btile { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--surface-2); scroll-margin-top: calc(var(--tbh, 72px) + 10px); transition: border-color .15s, box-shadow .15s; }
.cx-btile:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); box-shadow: var(--shadow-sm); }
.cx-btile:target { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cx-btile.empty { border-style: dashed; background: transparent; }
.cx-btile-img { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 22px; }
.cx-btile-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cx-btile-img img[hidden], .cx-btile-img .bi[hidden] { display: none; }
.cx-btile-img.lg { flex-basis: 120px; width: 120px; height: 60px; }
.cx-btile-body { flex: 1; min-width: 0; }
.cx-btile-body h4 { font-size: 14.5px; font-weight: 600; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-btile-body p { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-btile-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--brand-ink); background: var(--soft); border-radius: 99px; padding: 2px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-btile-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.cx-btile-move { display: flex; gap: 4px; }
@media (max-width: 520px) { .cx-btile { flex-wrap: wrap; } .cx-btile-actions { width: 100%; justify-content: flex-end; } }

.cx-offcanvas { --bs-offcanvas-width: 480px; background: var(--surface); border-left: 1px solid var(--line); }
.cx-offcanvas-form { display: flex; flex-direction: column; height: 100%; }
.cx-offcanvas .offcanvas-header { padding: 18px 20px; border-bottom: 1px solid var(--line2); }
.cx-offcanvas .offcanvas-title { font: 600 17px Poppins, Inter, sans-serif; }
.cx-offcanvas .offcanvas-body { padding: 20px; }
.cx-offcanvas-foot { display: flex; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line2); background: var(--surface-2); }
.cx-block-img { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.cx-avatar-wrap { flex: 0 0 84px; }
.cx-avatar[hidden], .cx-avatar.empty[hidden], .cx-logo-thumb[hidden] { display: none; }
.cx-avatar.empty { display: grid; place-items: center; background: var(--lane); color: var(--muted); font-size: 34px; }
.cx-logo-thumb { max-height: 36px; max-width: 120px; border-radius: 6px; border: 1px solid var(--line); background: #fff; padding: 3px; }
.cx-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cx-link-row { display: grid; grid-template-columns: 150px 1.4fr 1fr 38px; gap: 8px; width: 100%; }
@media (max-width: 640px) { .cx-link-row { grid-template-columns: 1fr 38px; } .cx-link-row > :nth-child(2), .cx-link-row > :nth-child(3) { grid-column: 1 / -1; } .cx-link-row > :nth-child(4) { grid-row: 1; grid-column: 2; } }
.form-control-color { width: 56px; height: 38px; padding: 4px; }

/* ---------- Billing ---------- */
.cx-dev { margin-top: 18px; border: 1px dashed var(--amber); background: var(--amber-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; color: var(--amber); }
.cx-dev span { color: var(--body); font-size: 13px; }

/* ---------- Landing page phone mock ---------- */
.lp-phone { width: 280px; margin: 0 auto; background: var(--surface); border: 10px solid var(--charcoal); border-radius: 36px; padding: 0 16px 20px; box-shadow: var(--shadow-lg); text-align: center; overflow: hidden; transform: rotate(-2deg); }
.lp-band { height: 92px; margin: 0 -16px; background: var(--brand-grad); }
.lp-avatar { width: 78px; height: 78px; margin: -40px auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--charcoal); color: #fff; font: 700 26px Poppins, sans-serif; border: 4px solid var(--surface); }
.lp-name { display: block; font: 700 18px Poppins, sans-serif; color: var(--ink); }
.lp-role { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.lp-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.lp-actions .bi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--brand-ink); }
.lp-actions .bi-whatsapp { color: #25d366; }
.lp-save { background: var(--brand-grad); color: #fff; font-weight: 700; border-radius: 12px; padding: 11px; margin-bottom: 10px; display: flex; gap: 8px; justify-content: center; }
.lp-link { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.lp-link .bi { color: var(--brand-ink); }

/* ---------- Red trash buttons (photo, logo, block image, links) ---------- */
.cx-file-row { display: flex; gap: 8px; align-items: center; }
.cx-file-row > .form-control { flex: 1; min-width: 0; }
.btn.cx-trash { flex: 0 0 auto; width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); background: var(--red-soft); color: var(--red); transition: background .15s, color .15s, border-color .15s; }
.btn.cx-trash:hover, .btn.cx-trash:focus-visible { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- "Are you sure?" popup (cxConfirm in site.js) ---------- */
.cx-confirm { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 16px; background: rgba(20, 22, 19, .55); backdrop-filter: blur(3px); animation: cx-fade .15s ease; }
.cx-confirm.out { animation: cx-fade .15s ease reverse forwards; }
.cx-confirm-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px 22px; text-align: center; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); animation: cx-pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.cx-confirm.out .cx-confirm-box { animation: none; }
.cx-confirm-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--red-soft); color: var(--red); box-shadow: 0 0 0 8px color-mix(in srgb, var(--red-soft) 50%, transparent); }
.cx-confirm h2 { font: 600 19px Poppins, Inter, sans-serif; margin: 0 0 6px; color: var(--ink); }
.cx-confirm p { color: var(--muted); font-size: 14px; margin: 0; }
.cx-confirm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.cx-confirm .btn-danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.cx-confirm .btn-danger:hover, .cx-confirm .btn-danger:focus-visible { filter: brightness(.92); }
@keyframes cx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cx-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cx-confirm, .cx-confirm-box { animation: none !important; } }

/* Top bar switch: Bootstrap's form-switch adds left padding for its label; there isn't one here. */
.cx-live-switch .form-check { padding-left: 0; min-height: 0; display: flex; }

/* Wallet buttons (black, like Apple's and Google's own) */
.btn.cx-wallet-btn { background: #000; color: #fff; border: 1px solid #000; border-radius: 10px; padding: 8px 16px; }
.btn.cx-wallet-btn:hover { background: #222; color: #fff; }
[data-bs-theme=dark] .btn.cx-wallet-btn { border-color: rgba(255, 255, 255, .25); }

/* ---------- Contacts ---------- */
.cx-contact-search { max-width: 260px; height: 36px; padding: 6px 12px; }
.cx-contacts { display: flex; flex-direction: column; }
.cx-contact { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line2); }
.cx-contact:first-child { border-top: 0; }
.cx-contact[hidden] { display: none; }
.cx-contact-av { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--brand-grad, linear-gradient(135deg, #6ab43e, #3fab35)); color: #fff; font-weight: 700; }
.cx-contact.off .cx-contact-av { background: var(--lane); color: var(--muted); filter: grayscale(1); }
.cx-contact-body { flex: 1; min-width: 0; }
.cx-contact-body b { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-contact-body > span:not(.cx-pill) { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-contact-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cx-contact-actions .btn-icon.btn-sm, .cx-contact-actions .cx-trash { width: 34px; height: 34px; }
@media (max-width: 640px) { .cx-contact { flex-wrap: wrap; } .cx-contact-actions { width: 100%; justify-content: flex-start; padding-left: 60px; } }
.cx-newdot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- Legal pages (privacy, EULA) ---------- */
.auth-legal { font-size: 12.5px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.legal { max-width: 820px; margin: 0 auto; padding: 8px 0 24px; color: var(--body); line-height: 1.65; }
.legal-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); margin: 0 0 6px; }
.legal h1 { font: 700 clamp(28px, 4vw, 36px)/1.2 Poppins, Inter, sans-serif; color: var(--ink); margin: 0 0 6px; }
.legal-updated { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; }
.legal-toc a { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.legal-toc a:hover { border-color: var(--brand); }
.legal section { scroll-margin-top: 90px; margin-bottom: 26px; }
.legal h2 { font: 600 20px/1.3 Poppins, Inter, sans-serif; color: var(--ink); margin: 26px 0 10px; }
.legal h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 16px 0 6px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal b { color: var(--ink); }
.legal-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.legal-table th, .legal-table td { padding: 10px 12px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: top; }
.legal-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 600px) { .legal-table { display: block; overflow-x: auto; } }
.cx-trial { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--brand-ink); font-size: 14px; margin-bottom: 16px; }
.cx-trial b { color: var(--ink); }
.cx-trial .bi { font-size: 17px; line-height: 1.3; }
