/* ============================================================
   REX Scammers Awareness Site - styles.css
   Theme aligned with Complete Sync (emqxonline.com)
   Slate gradient · Inter · purple accent · glass cards
   ============================================================ */

:root {
  --slate-950: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-mute: #64748b;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --bg: var(--slate-950);
  --bg-elev: rgba(30, 41, 59, 0.8);
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-inset: #0f172a;
  --bg-callout: rgba(245, 158, 11, 0.1);
  --border: rgba(51, 65, 85, 0.5);
  --border-strong: #334155;
  --accent: #667eea;
  --accent-2: #764ba2;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-glow: 0 4px 15px rgba(102, 126, 234, 0.3);
  --accent-strong: #5a67d8;
  --warn: #f59e0b;
  --warn-strong: #d97706;
  --danger: #ef4444;
  --danger-strong: #b91c1c;
  --ok: #10b981;
  --link: #a5b4fc;
  --link-hover: #c7d2fe;
  --bubble-me: rgba(102, 126, 234, 0.22);
  --bubble-them: rgba(15, 23, 42, 0.65);
  --bubble-fwd: rgba(15, 23, 42, 0.85);
  --shadow-1: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 10px 30px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-gradient);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--link-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw + 1rem, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin: .25em 0; }
hr { border: 0; border-top: 1px solid var(--border-strong); margin: 2.5rem 0; }
code, kbd, samp {
  font-family: 'Consolas', 'Monaco', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 2px 8px;
  color: #cbd5e1;
}
pre code { display: block; padding: 1em; overflow-x: auto; }

.container { width: 92%; max-width: var(--maxw); margin: 0 auto; }
.container--narrow { max-width: 820px; }

/* ---------- Top bar (Complete Sync header style) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-gradient);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-strong);
}
.topbar__inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
}
.brand__dot {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  box-shadow: var(--accent-glow);
  flex-shrink: 0;
}
.nav { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.nav a:hover {
  color: var(--accent);
  background: rgba(71, 85, 105, 0.3);
  border-color: var(--slate-600);
}
@media (max-width: 640px) {
  .nav { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: var(--accent-glow);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  color: #fff;
}
.btn--danger {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: var(--accent-glow);
}
.btn--danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--slate-600);
}
.btn--ghost:hover {
  background: rgba(71, 85, 105, 0.3);
  border-color: var(--accent);
  color: var(--accent);
}
.btn--sm { padding: .5rem .85rem; font-size: .85rem; border-radius: 8px; }

/* ---------- Sections ---------- */
section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-strong);
}
section:first-of-type { border-top: 0; }
.section__eyebrow {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent);
  padding: .35rem .75rem;
  border: 1px solid rgba(102, 126, 234, 0.35);
  background: rgba(102, 126, 234, 0.1);
  border-radius: 20px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.section__lead { font-size: 1.1rem; color: var(--text-dim); max-width: 75ch; }

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 4rem; border-top: 0; }
.hero__alert {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: .4rem .85rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.hero h1 { color: #fff; }
.hero__sub { font-size: 1.15rem; color: var(--text-dim); max-width: 70ch; margin-bottom: 1.5rem; }
.hero__handles {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hero__handles li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-dim);
  font-family: 'Consolas', 'Monaco', ui-monospace, Menlo, monospace;
  transition: all 0.2s;
}
.hero__handles li:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}
.hero__handles strong { color: #fff; font-weight: 600; }
.hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero__meta { margin-top: 1.5rem; color: var(--text-mute); font-size: .85rem; }

/* ---------- Callouts ---------- */
.callout {
  border-left: 4px solid var(--warn);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left-width: 4px;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}
.callout--danger {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}
.callout--ok {
  border-left-color: var(--ok);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}
.callout strong { color: #fff; }

/* ---------- Numbered steps (stat-card style) ---------- */
.steps { counter-reset: stepc; list-style: none; padding: 0; margin: 0; }
.steps > li {
  counter-increment: stepc;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.5rem 4.5rem;
  margin: .75rem 0;
  box-shadow: var(--shadow-1);
  transition: all 0.3s;
}
.steps > li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.steps > li::before {
  content: counter(stepc);
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--accent-glow);
}
.steps h3 { margin: 0 0 .35rem; color: #fff; }
.steps p { margin: 0; color: var(--text-dim); }

/* ---------- Red flags grid ---------- */
.flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.flag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  transition: all 0.3s;
}
.flag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(102, 126, 234, 0.3);
}
.flag__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  font-size: 1.1rem;
  margin-bottom: .75rem;
}
.flag h3 { margin: 0 0 .35rem; font-size: 1rem; color: #fff; }
.flag p { margin: 0; color: var(--text-dim); font-size: .94rem; }

/* ---------- Chat ---------- */
.chat-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-1);
}
.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
  color: var(--text-dim);
  font-size: .9rem;
}
.chat {
  max-height: 620px;
  overflow-y: auto;
  padding: .75rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-700) transparent;
  background: var(--bg-inset);
  border-radius: 12px;
  border: 1px solid var(--border-strong);
}
.chat[data-expanded="true"] { max-height: none; }
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: var(--slate-700); border-radius: 8px; }

.chat__day {
  text-align: center;
  margin: 1rem 0;
  font-size: .8rem;
  color: var(--text-mute);
}
.chat__day span {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid var(--border-strong);
  padding: .25rem .75rem;
  border-radius: 999px;
  color: var(--text-dim);
}

.msg {
  display: block;
  max-width: 78%;
  padding: .75rem 1rem;
  border-radius: 14px;
  margin: .35rem 0;
  box-shadow: var(--shadow-1);
  position: relative;
  border: 1px solid rgba(51, 65, 85, 0.4);
}
.msg__name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .15rem;
}
.msg__text { margin: 0; word-wrap: break-word; }
.msg__text a { color: var(--link); }
.msg__time {
  display: block;
  margin-top: .35rem;
  font-size: .72rem;
  color: var(--text-mute);
  text-align: right;
}
.msg--them {
  background: var(--bubble-them);
  border-top-left-radius: 4px;
  margin-right: auto;
}
.msg--me {
  background: var(--bubble-me);
  border-color: rgba(102, 126, 234, 0.25);
  border-top-right-radius: 4px;
  margin-left: auto;
}
.msg--me .msg__name { color: #c7d2fe; }
.msg--forward .msg__name { color: #fca5a5; }
.msg__fwd {
  margin-top: .4rem;
  padding: .5rem .65rem;
  border-left: 3px solid var(--slate-600);
  background: var(--bubble-fwd);
  border-radius: 8px;
  font-size: .94rem;
}
.msg__fwd-name {
  font-size: .75rem;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: .15rem;
}
.msg__photo {
  display: block;
  margin: .35rem 0 .25rem;
  border-radius: 10px;
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
  border: 1px solid var(--border-strong);
}
.msg__reply {
  font-size: .8rem;
  color: var(--text-mute);
  border-left: 2px solid var(--accent);
  padding: .15rem .5rem;
  margin-bottom: .35rem;
  background: rgba(102, 126, 234, 0.08);
  border-radius: 0 6px 6px 0;
}
.msg + .msg.msg--them.msg--joined,
.msg + .msg.msg--me.msg--joined { margin-top: .15rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5); }
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(71, 85, 105, 0.5);
  color: #fff;
  border: 1px solid var(--slate-600);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.lightbox__close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Contact card ---------- */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-2);
  transition: all 0.3s;
}
.contact-card:hover { box-shadow: var(--shadow-card-hover); }
.contact-card h2 { color: #fff; margin-top: 0; }
.contact-card__email {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Consolas', 'Monaco', ui-monospace, Menlo, monospace;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  color: var(--accent);
  margin: .5rem 0 1rem;
}
.contact-card__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.contact-card details { margin-top: 1rem; }
.contact-card summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* ---------- Tutorial accordions ---------- */
.tutorial { display: grid; gap: 1rem; }
.phase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}
.phase:hover { border-color: rgba(102, 126, 234, 0.25); }
.phase[open] {
  border-color: rgba(102, 126, 234, 0.45);
  box-shadow: var(--shadow-card-hover);
}
.phase > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 600;
  transition: background 0.2s;
}
.phase > summary:hover { background: rgba(51, 65, 85, 0.25); }
.phase > summary::-webkit-details-marker { display: none; }
.phase > summary::after {
  content: "+";
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dim);
}
.phase[open] > summary::after { content: "−"; color: var(--accent); }
.phase__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: var(--accent-glow);
}
.phase__title { color: #fff; }
.phase__title small {
  display: block;
  color: var(--text-mute);
  font-weight: 400;
  font-size: .82rem;
  margin-top: .15rem;
}
.phase__body { padding: 0 1.35rem 1.35rem; }
.phase__body ul { margin: .5rem 0 1rem; }
.phase__body h4 { margin: 1.25rem 0 .35rem; color: #fff; }

.task { display: flex; gap: .65rem; align-items: flex-start; padding: .25rem 0; }
.task input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: .25rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.task label { color: var(--text-dim); }
.task input:checked + label { color: var(--text-mute); text-decoration: line-through; }

.template {
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1rem;
  margin: .75rem 0;
}
.template pre {
  margin: .5rem 0 .75rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .9rem;
  color: var(--text-dim);
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-strong);
  padding: 2.5rem 0;
  color: var(--text-mute);
  font-size: .9rem;
  text-align: center;
}
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---------- Utilities ---------- */
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--slate-800);
  color: #fff;
  border: 1px solid rgba(102, 126, 234, 0.4);
  padding: .65rem 1.15rem;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 1100;
  font-size: .92rem;
}
.toast[data-show="true"] { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  section { padding: 3rem 0; }
  .hero { padding: 3rem 0; }
  .steps > li { padding-left: 3.75rem; }
  .steps > li::before { width: 2rem; height: 2rem; font-size: .95rem; left: 1rem; top: 1rem; }
  .msg { max-width: 92%; }
  .brand__dot { width: 32px; height: 32px; }
}
