/**
 * SPYERA Live Chat widget — styles.
 * Ported from spyera-design/Footer.dc.html. Uses the theme's design tokens
 * (--accent, --surface, --hero-bg, …) with hard fallbacks so it renders even
 * if a token is missing. Light/dark follow the theme's data-theme switch.
 */

.sc-root { font-family: 'Manrope', system-ui, sans-serif; }
.sc-root *, .sc-root *::before, .sc-root *::after { box-sizing: border-box; }
.sc-hidden { display: none !important; }

/* ---- Launcher --------------------------------------------------------- */
.sc-launcher {
	position: fixed; right: 24px; bottom: 24px;
	width: 60px; height: 60px; border-radius: 50%;
	border: none; background: var(--accent, #CC3D38); color: #fff; cursor: pointer;
	box-shadow: 0 14px 34px rgba(204,61,56,.42);
	z-index: 2147483001;
	display: inline-flex; align-items: center; justify-content: center;
	transition: transform .15s ease, box-shadow .15s ease;
}
.sc-launcher:hover { transform: translateY(-1px); box-shadow: 0 18px 40px rgba(204,61,56,.5); }
.sc-launcher:focus-visible { outline: 2px solid var(--accent, #CC3D38); outline-offset: 3px; }

/* ---- Panel ------------------------------------------------------------ */
.sc-panel {
	position: fixed; right: 24px; bottom: 98px;
	width: 366px; max-width: calc(100vw - 32px);
	height: 532px; max-height: calc(100vh - 130px);
	background: var(--surface, #fff);
	border: 1px solid var(--border, #E4EAF0);
	border-radius: 20px;
	box-shadow: 0 30px 70px rgba(15,40,60,.32);
	z-index: 2147483000;
	display: flex; flex-direction: column; overflow: hidden;
	animation: scChatIn .22s ease;
}
@keyframes scChatIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---- Header ----------------------------------------------------------- */
.sc-hd { position: relative; background: var(--hero-bg, #0B1B2B); color: #EAF2F5; padding: 20px 20px 18px; overflow: hidden; flex: 0 0 auto; }
.sc-hd__glow { position: absolute; inset: 0; background: radial-gradient(360px 160px at 100% 0%, rgba(204,61,56,.32), transparent 65%); }
.sc-hd__row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sc-hd__left { display: flex; align-items: center; gap: 11px; }
.sc-hd__ic { width: 38px; height: 38px; border-radius: 11px; background: var(--accent, #CC3D38); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sc-hd__name { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 16px; }
.sc-hd__status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #B9C6CF; }
.sc-hd__dot { width: 7px; height: 7px; border-radius: 50%; background: #57C97E; }
.sc-hd__close { width: 30px; height: 30px; border-radius: 8px; border: none; background: rgba(255,255,255,.1); color: #EAF2F5; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sc-hd__close:hover { background: rgba(255,255,255,.18); }

/* ---- Steps (email / otp) --------------------------------------------- */
.sc-step { flex: 1; padding: 26px 22px; display: flex; flex-direction: column; overflow-y: auto; }
.sc-step__ic { width: 52px; height: 52px; border-radius: 14px; background: rgba(204,61,56,.10); color: var(--accent-strong, #A82F2B); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.sc-step__title { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 19px; color: var(--text, #0C1826); margin-bottom: 8px; }
.sc-step__sub { font-size: 14px; line-height: 1.6; color: var(--text-muted, #5A6B7B); margin: 0 0 20px; }
.sc-step__sub b { color: var(--text, #0C1826); }
.sc-label { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--text-muted, #5A6B7B); margin-bottom: 7px; }

.sc-input { height: 48px; border: 1.5px solid var(--border, #E4EAF0); border-radius: 12px; padding: 0 14px; font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; color: var(--text, #0C1826); background: var(--surface, #fff); outline: none; width: 100%; }
.sc-input:focus { border-color: var(--accent, #CC3D38); }
.sc-input::placeholder { color: #9AA7B4; }
.sc-otp-input { height: 58px; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 26px; font-weight: 600; letter-spacing: 12px; text-align: center; }

.sc-err { font-size: 12.5px; color: var(--accent, #CC3D38); font-weight: 600; margin-top: 8px; min-height: 1em; }
.sc-devhint { font-size: 12px; color: var(--text-muted, #5A6B7B); margin-top: 8px; background: rgba(47,163,107,.10); border-radius: 8px; padding: 6px 10px; }

.sc-btn { margin-top: 18px; height: 50px; border: none; background: var(--accent, #CC3D38); color: #fff; border-radius: 12px; font-family: 'Manrope', system-ui, sans-serif; font-weight: 800; font-size: 15px; cursor: pointer; }
.sc-btn:hover { background: var(--accent-strong, #A82F2B); }
.sc-btn[disabled] { opacity: .6; cursor: default; }

.sc-turnstile { margin-top: 16px; }
.sc-legal { margin-top: auto; padding-top: 16px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted, #5A6B7B); }
.sc-legal a { color: var(--accent, #CC3D38); font-weight: 700; }

.sc-otp-actions { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.sc-linkbtn { border: none; background: none; color: var(--text-muted, #5A6B7B); font-family: 'Manrope', system-ui, sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.sc-linkbtn--accent { color: var(--accent, #CC3D38); }
.sc-linkbtn[disabled] { opacity: .5; cursor: default; }

/* ---- Chat thread ------------------------------------------------------ */
.sc-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sc-thread { flex: 1; overflow-y: auto; padding: 20px 18px; background: var(--bg, #F5F7FA); }
.sc-verified { text-align: center; font-size: 11.5px; color: var(--text-muted, #5A6B7B); margin-bottom: 16px; }
.sc-msg { display: flex; margin-bottom: 10px; }
.sc-msg--you { justify-content: flex-end; }
.sc-msg--agent { justify-content: flex-start; }
.sc-bubble { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.sc-msg--you .sc-bubble { background: var(--accent, #CC3D38); color: #fff; border: 1px solid var(--accent, #CC3D38); }
.sc-msg--agent .sc-bubble { background: var(--surface, #fff); color: var(--text, #0C1826); border: 1px solid var(--border, #E4EAF0); }
.sc-msg--agent .sc-bubble a { color: var(--accent-strong, #A82F2B); font-weight: 700; text-decoration: underline; }
.sc-msg--agent .sc-bubble strong { font-weight: 700; }

.sc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.sc-chip { border: 1px solid var(--border, #E4EAF0); background: var(--surface, #fff); color: var(--text, #0C1826); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: 'Manrope', system-ui, sans-serif; }
.sc-chip:hover { border-color: var(--accent, #CC3D38); color: var(--accent-strong, #A82F2B); }

.sc-typing { display: inline-flex; gap: 4px; padding: 12px 13px; }
.sc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted, #8CA0B3); animation: scBlink 1.2s infinite ease-in-out; }
.sc-typing span:nth-child(2) { animation-delay: .2s; }
.sc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes scBlink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ---- Composer --------------------------------------------------------- */
.sc-compose { flex: 0 0 auto; border-top: 1px solid var(--border, #E4EAF0); padding: 12px; display: flex; gap: 8px; background: var(--surface, #fff); }
.sc-compose__input { flex: 1; height: 44px; border: 1.5px solid var(--border, #E4EAF0); border-radius: 11px; padding: 0 14px; font-family: 'Manrope', system-ui, sans-serif; font-size: 14px; color: var(--text, #0C1826); background: var(--surface, #fff); outline: none; }
.sc-compose__input:focus { border-color: var(--accent, #CC3D38); }
.sc-send { width: 44px; height: 44px; border: none; background: var(--accent, #CC3D38); color: #fff; border-radius: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sc-send:hover { background: var(--accent-strong, #A82F2B); }
.sc-send[disabled] { opacity: .6; cursor: default; }

/* ---- Attachments ------------------------------------------------------ */
.sc-attach { width: 44px; height: 44px; border: 1.5px solid var(--border, #E4EAF0); background: var(--surface, #fff); color: var(--text-muted, #5A6B7B); border-radius: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sc-attach:hover { color: var(--accent, #CC3D38); border-color: var(--accent, #CC3D38); }

.sc-atts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px 0; background: var(--surface, #fff); }
.sc-att-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 8px 5px 10px; border-radius: 999px; background: var(--surface-2, #EEF2F6); color: var(--text, #0C1826); border: 1px solid var(--border, #E4EAF0); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-att-x { border: none; background: none; color: var(--text-muted, #5A6B7B); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.sc-att-x:hover { color: var(--accent, #CC3D38); }
.sc-att-err { font-size: 12px; color: var(--accent, #CC3D38); font-weight: 600; }

.sc-msg__col { max-width: 80%; display: flex; flex-direction: column; }
.sc-msg--you .sc-msg__col { align-items: flex-end; }
.sc-msg--agent .sc-msg__col { align-items: flex-start; }
.sc-msg__col .sc-bubble { max-width: 100%; }
.sc-bubble-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sc-att-thumb { max-width: 150px; max-height: 150px; border-radius: 10px; border: 1px solid var(--border, #E4EAF0); display: block; }
.sc-att-file { font-size: 12px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2, #EEF2F6); color: var(--text, #0C1826); border: 1px solid var(--border, #E4EAF0); }

/* ---- Refund card ------------------------------------------------------ */
.sc-refund { max-width: 90%; background: var(--surface, #fff); border: 1.5px solid var(--accent, #CC3D38); border-radius: 14px; padding: 14px 15px; }
.sc-refund__t { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 14px; color: var(--text, #0C1826); }
.sc-refund__amt { font-size: 18px; font-weight: 800; color: var(--accent-strong, #A82F2B); margin: 4px 0 8px; }
.sc-refund__note { font-size: 12px; line-height: 1.5; color: var(--text-muted, #5A6B7B); margin-bottom: 12px; }
.sc-refund__btns { display: flex; gap: 8px; }
.sc-refund__yes { flex: 1; height: 40px; border: none; background: var(--accent, #CC3D38); color: #fff; border-radius: 10px; font-family: 'Manrope', system-ui, sans-serif; font-weight: 800; font-size: 13.5px; cursor: pointer; }
.sc-refund__yes:hover { background: var(--accent-strong, #A82F2B); }
.sc-refund__yes[disabled] { opacity: .6; cursor: default; }
.sc-refund__no { height: 40px; padding: 0 16px; border: 1px solid var(--border, #E4EAF0); background: var(--surface, #fff); color: var(--text-muted, #5A6B7B); border-radius: 10px; font-family: 'Manrope', system-ui, sans-serif; font-weight: 700; font-size: 13.5px; cursor: pointer; }

/* ---- Header actions + overflow menu ---------------------------------- */
.sc-hd__actions { display: flex; align-items: center; gap: 8px; }
.sc-hd__btn { width: 30px; height: 30px; border-radius: 8px; border: none; background: rgba(255,255,255,.1); color: #EAF2F5; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sc-hd__btn:hover { background: rgba(255,255,255,.18); }
.sc-menu-pop { position: absolute; top: 66px; right: 16px; z-index: 6; background: var(--surface, #fff); border: 1px solid var(--border, #E4EAF0); border-radius: 12px; box-shadow: 0 14px 34px rgba(15,40,60,.22); padding: 6px; min-width: 178px; }
.sc-menu-pop__item { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; padding: 9px 10px; border-radius: 8px; font-family: 'Manrope', system-ui, sans-serif; font-size: 13.5px; font-weight: 600; color: var(--text, #0C1826); cursor: pointer; text-align: left; }
.sc-menu-pop__item:hover { background: var(--surface-2, #EEF2F6); }
.sc-menu-pop__item--danger { color: var(--accent, #CC3D38); }

/* ---- Rating step ----------------------------------------------------- */
.sc-step__ic--ok { background: rgba(87,201,126,.14); color: #2FA36B; }
.sc-stars { display: flex; gap: 6px; margin: 6px 0; }
.sc-star { border: none; background: none; padding: 2px; cursor: pointer; color: var(--border, #D9E0E7); line-height: 0; transition: color .1s ease, transform .1s ease; }
.sc-star:hover { transform: scale(1.08); }
.sc-star.is-on { color: var(--sp-star, #F5A524); }
.sc-star.is-on svg { fill: var(--sp-star, #F5A524); }
.sc-rating-comment { margin-top: 14px; height: auto; min-height: 78px; padding: 12px 14px; resize: none; line-height: 1.5; }

@media (max-width: 420px) {
	.sc-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
	.sc-launcher { right: 16px; bottom: 16px; }
}

/* Marketing consent checkbox (Phase 4c) — sits above the verify button so the opt-in is
   part of the same deliberate action as completing verification. */
.sc-consent{display:flex;align-items:flex-start;gap:8px;margin:14px 0 10px;
  font-size:13px;line-height:1.4;text-align:left;cursor:pointer;opacity:.9}
.sc-consent input{margin:2px 0 0;flex:0 0 auto;width:15px;height:15px;cursor:pointer;accent-color:#CC3D38}
.sc-consent span{flex:1 1 auto}
[dir="rtl"] .sc-consent{text-align:right}

/* Unverified verify-strip: collapsed nudge above the composer, expands to code entry. */
.sc-verify{border-top:1px solid rgba(0,0,0,.08);background:rgba(204,61,56,.04)}
.sc-verify__head{display:flex;align-items:center;gap:8px;width:100%;padding:9px 14px;
  background:none;border:0;cursor:pointer;font:inherit;font-size:12.5px;color:#7a2f2c;text-align:left}
.sc-verify__dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:#CC3D38;
  box-shadow:0 0 0 3px rgba(204,61,56,.15)}
.sc-verify__lead{flex:1 1 auto}
.sc-verify__chev{flex:0 0 auto;opacity:.6;font-size:11px}
.sc-verify__body{padding:2px 14px 12px}
.sc-verify__msg{margin:0 0 6px;font-size:12.5px;line-height:1.45}
.sc-verify__msg--muted{opacity:.75}
/* Code row. Beats the base .sc-input/.sc-btn rules, which fight a flex row:
   .sc-btn carries margin-top:18px (pushes the button below the field), the two controls
   are 50px vs 48px tall, and .sc-input is width:100% so it squeezes the button out. */
.sc-verify__row{display:flex;align-items:center;gap:8px;margin:10px 0 4px}
.sc-verify__row .sc-verify__input{
  flex:1 1 auto;width:auto;min-width:0;          /* min-width:0 lets a flex item shrink */
  height:44px;padding:0 10px;
  text-align:center;letter-spacing:.22em;font-size:16px;font-weight:600;
  font-variant-numeric:tabular-nums}
.sc-verify__row .sc-verify__input::placeholder{letter-spacing:.14em;font-weight:400}
.sc-verify__row .sc-verify__btn{
  flex:0 0 auto;width:auto;margin:0;             /* kill .sc-btn's margin-top:18px */
  height:44px;padding:0 18px;font-size:14px;white-space:nowrap}
[dir="rtl"] .sc-verify__head{text-align:right}

/* Verify strip: make the expander an obvious control, not a 6px glyph. */
.sc-verify__head{padding:11px 14px}
.sc-verify__cta{flex:0 0 auto;font-weight:600;color:#CC3D38;text-decoration:underline;
  text-underline-offset:2px;font-size:12.5px}
.sc-verify__chev{flex:0 0 auto;font-size:13px;opacity:.75;transition:transform .18s ease;line-height:1}
.sc-verify__head:hover{background:rgba(204,61,56,.06)}
.sc-verify__list{margin:2px 0 8px;padding-left:18px;font-size:12.5px;line-height:1.5}
.sc-verify__list li{margin:2px 0}
.sc-verify__list b{font-weight:600}
