/* =====================================================================
   SterlingCapitalUK — Extended design layer
   Investment plans, ROI calculator, social proof, FAQ, trust, progress.
   Depends on the CSS variables defined in css/theme.css
   ===================================================================== */

/* ---------- Section headings ---------- */
.sec-head { text-align: center; max-width: 760px; margin: 0 auto 42px; }
.sec-head .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; background: var(--accent-grad-soft);
  border: 1px solid var(--border); color: var(--accent); margin-bottom: 14px;
}
.sec-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.sec-head p { color: var(--text-2); font-size: 1.02rem; }

/* ---------- Investment plans ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 1180px) { .plans-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .plans-grid { grid-template-columns: 1fr; } }

.plan-card {
  position: relative; background: linear-gradient(165deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--r); padding: 26px 22px;
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.plan-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--plan-c, var(--accent-grad)); }
.plan-card:hover { transform: translateY(-6px); border-color: var(--border-2); box-shadow: var(--shadow); }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 50px rgba(0,184,212,.22); }
.plan-badge {
  position: absolute; top: 14px; right: 14px; font-size: .66rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-grad); color: #fff;
}
.plan-name { font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; }
.plan-roi {
  font-size: 2.7rem; font-weight: 900; line-height: 1; margin: 14px 0 2px;
  background: var(--plan-c, var(--accent-grad));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.plan-roi-lbl { font-size: .78rem; color: var(--muted); font-weight: 600; }
.plan-meta { margin: 18px 0; display: flex; flex-direction: column; gap: 9px; }
.plan-meta-row { display: flex; justify-content: space-between; font-size: .85rem; }
.plan-meta-row span:first-child { color: var(--muted); }
.plan-meta-row span:last-child { font-weight: 700; }
.plan-features { list-style: none; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-features li { display: flex; gap: 8px; font-size: .84rem; color: var(--text-2); }
.plan-features li::before { content: '✓'; color: var(--accent); font-weight: 800; }
.plan-card .btn { margin-top: auto; }
.plan-total { font-size: .8rem; color: var(--up); font-weight: 700; margin-top: 8px; text-align: center; }

/* ---------- ROI calculator ---------- */
.calc-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 820px) { .calc-wrap { grid-template-columns: 1fr; } }
.calc-form { padding: 28px; }
.calc-out {
  padding: 28px; background: linear-gradient(160deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--r);
  display: flex; flex-direction: column; justify-content: center;
}
.calc-out .big {
  font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 900; line-height: 1.1;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.calc-out .row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.calc-out .row:last-child { border: none; }
.calc-out .row span:last-child { font-weight: 700; }
.calc-range { width: 100%; margin-top: 10px; accent-color: var(--accent); cursor: pointer; }
.calc-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.calc-chip { padding: 6px 14px; border-radius: 999px; background: var(--chip); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.calc-chip:hover, .calc-chip.active { border-color: var(--accent); color: var(--accent); }

/* ---------- Trust badges ---------- */
.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 820px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }
.trust-badge { text-align: center; padding: 24px 16px; }
.trust-badge .ic { font-size: 1.9rem; margin-bottom: 10px; }
.trust-badge h4 { font-size: .95rem; margin-bottom: 4px; }
.trust-badge p { font-size: .8rem; color: var(--muted); }

/* ---------- Partner logos ---------- */
.logo-strip { display: flex; flex-wrap: wrap; gap: 26px 46px; justify-content: center; align-items: center; opacity: .72; }
.logo-strip span { font-size: 1.15rem; font-weight: 800; letter-spacing: .02em; color: var(--text-3); }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .testi-grid { grid-template-columns: 1fr; } }
.testi-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.testi-stars { color: #f5a623; letter-spacing: 2px; font-size: .95rem; }
.testi-quote { font-size: .95rem; color: var(--text-2); line-height: 1.65; }
.testi-who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.testi-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent-grad); flex-shrink: 0; }
.testi-who strong { display: block; font-size: .9rem; }
.testi-who span { font-size: .78rem; color: var(--muted); }

/* ---------- FAQ accordion ---------- */
.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--card); overflow: hidden; transition: border-color .2s; }
.faq-item.open { border-color: var(--border-2); }
.faq-q { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; font-weight: 700; font-size: .98rem; }
.faq-q .ic { transition: transform .25s ease; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq-item.open .faq-q .ic { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .32s ease; }
.faq-item.open .faq-a { max-height: 360px; }
.faq-a p { padding: 0 22px 20px; color: var(--text-2); font-size: .92rem; line-height: 1.65; }

/* ---------- Animated counters ---------- */
.counter { font-variant-numeric: tabular-nums; }

/* ---------- Wider KPI grid (dashboard / admin) ---------- */
.kpi-grid.cols-6 { grid-template-columns: repeat(6,1fr); }
@media (max-width: 1300px) { .kpi-grid.cols-6 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 720px)  { .kpi-grid.cols-6 { grid-template-columns: repeat(2,1fr); } }

.kpi-grid.cols-5 { grid-template-columns: repeat(5,1fr); }
@media (max-width: 1200px) { .kpi-grid.cols-5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 720px)  { .kpi-grid.cols-5 { grid-template-columns: repeat(2,1fr); } }

/* ---------- Progress bars ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--accent-grad); transition: width .6s ease; }

/* ---------- Investment cards (dashboard) ---------- */
.invest-card { padding: 20px; }
.invest-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.invest-card .plan-tag { font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: #fff; }
.invest-stat { display: flex; justify-content: space-between; font-size: .84rem; margin: 6px 0; }
.invest-stat span:first-child { color: var(--muted); }
.invest-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- App promo ---------- */
.app-promo { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; }
@media (max-width: 820px) { .app-promo { grid-template-columns: 1fr; } }
.app-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.app-badge { display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--border-2); font-size: .85rem; font-weight: 700; transition: border-color .2s; }
.app-badge:hover { border-color: var(--accent); }
.app-badge .ic { font-size: 1.4rem; }
.phone-mock { width: 240px; margin: 0 auto; border-radius: 32px; border: 8px solid var(--elev); background: var(--bg-2); box-shadow: var(--shadow); padding: 18px 14px; }
.phone-mock .bar { height: 8px; border-radius: 999px; background: var(--chip); margin: 8px 0; }
.phone-mock .bar.w60 { width: 60%; } .phone-mock .bar.w80 { width: 80%; } .phone-mock .bar.w40 { width: 40%; }
.phone-mock .chart { height: 90px; border-radius: 12px; margin: 14px 0; background: linear-gradient(180deg, rgba(0,184,212,.28), rgba(0,184,212,0)); border: 1px solid var(--border); }

/* ---------- Newsletter ---------- */
.newsletter { display: flex; gap: 10px; max-width: 480px; margin: 18px auto 0; }
@media (max-width: 560px) { .newsletter { flex-direction: column; } }

/* ---------- Misc ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =====================================================================
   Support, presence, announcements & targeted messaging
   ===================================================================== */

/* ---------- Presence (online / offline) ---------- */
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; }
.presence .pd { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.presence.on { color: var(--up); }
.presence.on .pd { background: var(--up); box-shadow: 0 0 0 0 rgba(22,199,132,.6); animation: pulseDot 2s infinite; }
.presence.off { color: var(--muted); }
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(22,199,132,.55); }
  70% { box-shadow: 0 0 0 8px rgba(22,199,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,199,132,0); }
}
.presence-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; border: 1px solid var(--border); background: var(--chip); }
.presence-chip.on { color: var(--up); border-color: rgba(22,199,132,.35); }
.presence-chip.off { color: var(--muted); }

/* ---------- Customer support view (dashboard) ---------- */
.support-shell { display: grid; grid-template-columns: 1fr; gap: 0; }
.support-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.support-head .avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-grad); display: grid; place-items: center; font-size: 1.2rem; color: #fff; }
.support-thread { display: flex; flex-direction: column; gap: 12px; padding: 20px; min-height: 320px; max-height: 460px; overflow-y: auto; }
.support-thread .day { text-align: center; font-size: .72rem; color: var(--muted); margin: 6px 0; }
.sup-msg { max-width: 78%; padding: 11px 15px; border-radius: 16px; font-size: .9rem; line-height: 1.45; position: relative; }
.sup-msg .who { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .7; margin-bottom: 3px; }
.sup-msg.user { background: var(--accent-grad); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.sup-msg.admin { background: var(--pink-grad); color: #fff; align-self: flex-start; border-bottom-left-radius: 5px; }
.sup-msg.bot { background: var(--chip); align-self: flex-start; border-bottom-left-radius: 5px; }
.sup-msg .ts { font-size: .66rem; opacity: .65; margin-top: 4px; display: block; }
.support-input { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.support-input input { flex: 1; }
.support-empty { text-align: center; color: var(--muted); padding: 46px 20px; }

/* ---------- Support chat image attachments ---------- */
.sup-attach { padding: 0 14px; font-size: 1.15rem; line-height: 1; }
.sup-preview { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--chip); }
.sup-preview img { max-height: 84px; max-width: 130px; border-radius: 10px; border: 1px solid var(--border); object-fit: cover; }
.sup-preview .pmeta { flex: 1; font-size: .8rem; color: var(--muted); word-break: break-word; }
.sup-msg .sup-img { display: block; margin-top: 8px; width: 100%; max-width: 240px; border-radius: 10px; cursor: zoom-in; border: 1px solid rgba(255,255,255,.18); }
.chat-msg .chat-img { display: block; margin-top: 6px; width: 100%; max-width: 220px; border-radius: 10px; cursor: zoom-in; border: 1px solid rgba(255,255,255,.15); }

/* ---------- Admin deposit-wallet editor ---------- */
.wallet-edit { border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin-bottom: 14px; background: var(--chip); }
.wallet-edit .dash-grid-2 { gap: 14px; }
.wallet-edit .field { margin-bottom: 12px; }

/* ---------- Announcement "official template" ---------- */
.announcement {
  position: relative; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  background: linear-gradient(165deg, var(--card), var(--card-2)); margin-bottom: 14px;
}
.announcement .ann-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  background: var(--accent-grad); color: #fff;
}
.announcement .ann-head .brand-mark { background: rgba(255,255,255,.22); }
.announcement .ann-head .ann-ttl { font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.announcement .ann-head .ann-sub { font-size: .72rem; opacity: .9; }
.announcement .ann-body { padding: 18px 20px; font-size: .92rem; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; }
.announcement .ann-subj { font-weight: 800; font-size: 1.05rem; color: var(--text); margin-bottom: 8px; }
.announcement .ann-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.announcement.unread { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(0,184,212,.35); }

/* Announcement popup modal */
.ann-overlay { position: fixed; inset: 0; background: rgba(3,8,20,.62); backdrop-filter: blur(3px); z-index: 400; display: grid; place-items: center; padding: 20px; }
.ann-modal { width: 100%; max-width: 520px; animation: popIn .28s ease; }
.ann-modal .announcement { margin: 0; box-shadow: var(--shadow); }
.ann-modal .ann-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 18px; }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Admin broadcast recipient selector ---------- */
.bc-recip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bc-recip button { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--chip); color: var(--text-2); font-weight: 700; font-size: .82rem; cursor: pointer; transition: all .2s; }
.bc-recip button.active { background: var(--accent-grad); color: #fff; border-color: transparent; }
.bc-users { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.bc-users .bc-user { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.bc-users .bc-user:hover { background: var(--chip); }
.bc-users .bc-user input { width: 16px; height: 16px; accent-color: var(--accent); }
.bc-users .bc-user .coin { width: 30px; height: 30px; font-size: .72rem; }
.bc-users .bc-user .em { font-size: .76rem; color: var(--muted); }
.bc-count { font-size: .8rem; color: var(--accent); font-weight: 700; }
.bc-preview-lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; margin: 6px 0 8px; }

/* Admin support inbox rows */
.sup-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: all .18s; }
.sup-row:hover { background: var(--chip); border-color: var(--border); }
.sup-row.active { background: var(--accent-grad-soft); border-color: var(--accent); }
.sup-row .meta { flex: 1; min-width: 0; }
.sup-row .meta .nm { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.sup-row .meta .lm { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-badge { background: var(--pink); color: #fff; font-size: .68rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 6px; }

/* Chat widget: support-agent replies */
.chat-msg.agent { background: var(--pink-grad); color: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
