/* ============================================================
   SurveyArt — design tokens
   Lấy cảm hứng từ logo: dải ruy-băng tím→hồng→xanh, nền kem sáng,
   chữ "Survey" đậm màu mực đêm. Font Space Grotesk (tiêu đề, cá tính)
   + Inter (nội dung, dễ đọc).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;

  /* ---- Surfaces ---- */
  --bg: #FAFAFC;
  --bg-secondary: #F3F4F6;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --hover: #F9FAFB;
  --input-bg: #FFFFFF;

  /* ---- Text ---- */
  --text: #111827;
  --muted: #6B7280;
  --text-subtle: #9CA3AF;

  /* ---- Brand (blue) ---- */
  --purple: #2563EB;
  --purple-rgb: 37, 99, 235;
  --secondary: #3B82F6;
  --accent-vivid: #60A5FA;
  --pink: #1D4ED8;
  --blue: #38BDF8;
  --orange: #FB923C;
  --gradient: var(--purple);

  --accent: #2563EB;      /* dùng thay cho các chỗ gọi var(--accent) trong toàn bộ view */
  --accent-dark: #1D4ED8;
  --purple-soft-text: #1E40AF;

  /* ---- Semantic (work in both themes) ---- */
  --success: #22C55E;
  --success-rgb: 34, 197, 94;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #F59E0B;
  --warning-rgb: 245, 158, 11;
  --warning-bg: rgba(245, 158, 11, 0.14);
  --warning-text: #B45309;
  --error: #EF4444;
  --error-rgb: 239, 68, 68;
  --error-bg: rgba(239, 68, 68, 0.08);

  /* legacy aliases still referenced throughout views/CSS */
  --green: var(--success);
  --red: var(--error);

  /* ---- Tinted surfaces ---- */
  --tint-purple-bg: #EFF6FF;
  --tint-purple-border: #BFDBFE;

  /* ---- Shadows (dialed back automatically in dark mode) ---- */
  --shadow-rgb: 17, 24, 39;
  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.03);
  --shadow-hover: 0 10px 28px rgba(17, 24, 39, 0.07);
  --overlay: rgba(17, 24, 39, 0.55);

  --radius: 16px;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* ---- Survey streak (kept identical in both themes: needs to pop regardless) ---- */
  --streak-orange: #FF6A00;
  --streak-orange-rgb: 255, 106, 0;
  --streak-orange-soft: #FF9142;
  --streak-yellow: #FFC400;
}

[data-theme="dark"] {
  color-scheme: dark;

  /* ---- Surfaces ---- */
  --bg: #0F172A;
  --bg-secondary: #111827;
  --card: #1E293B;
  --border: #334155;
  --hover: #273449;
  --input-bg: #111827;

  /* ---- Text ---- */
  --text: #F8FAFC;
  --muted: #CBD5E1;
  --text-subtle: #94A3B8;

  /* ---- Brand (kept vibrant in both themes) ---- */
  --purple: #3B82F6;
  --secondary: #60A5FA;
  --accent-vivid: #93C5FD;
  --accent: #3B82F6;
  --accent-dark: #93C5FD;
  --purple-soft-text: #93C5FD;

  /* ---- Semantic ---- */
  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.16);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.18);
  --warning-text: #FBBF24;
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.16);

  /* ---- Tinted surfaces ---- */
  --tint-purple-bg: rgba(59, 130, 246, 0.14);
  --tint-purple-border: rgba(59, 130, 246, 0.38);

  /* ---- Shadows: reduced, rely on border contrast instead ---- */
  --shadow-rgb: 0, 0, 0;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.4);
  --overlay: rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

/* Smooth, premium theme switching — every surface fades together, no flicker. */
html { transition: background-color 200ms ease-in-out; }
body,
.topbar, .landing-nav, .auth-wrap, .card, .stat-card, .offerwall-wrap,
input, select, textarea, button, .btn,
.badge, .verify-banner, .verified-badge, .unverified-badge, .error-box, .warning-box,
table, th, td, .site-footer, .hero-buzz, .rewards-hero, .referral-box,
.admin-tabs a, .survey-modal-inner, .survey-modal-header, .survey-modal-close,
.chat-wrap, .chat-header, .chat-messages, .chat-bubble, .chat-input-row, .chat-input-row textarea,
.chat-convo-item, .music-fab, .theme-toggle-track, .theme-toggle-thumb, svg {
  transition: background-color 200ms ease-in-out, color 200ms ease-in-out,
              border-color 200ms ease-in-out, box-shadow 200ms ease-in-out,
              fill 200ms ease-in-out, stroke 200ms ease-in-out;
}

html {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .brand, .hero h1 { font-family: var(--font-display); }

/* ==== Logo dùng chung ==== */
.logo-img { height: 32px; width: 32px; object-fit: contain; vertical-align: middle; border-radius: 8px; }
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup .brand-text {
  font-weight: 700; font-size: 19px; letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ==== Sidebar (desktop) ==== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0F1E42 0%, #142a54 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 18px 14px;
  overflow-y: auto;
  z-index: 60;
  transition: transform 220ms ease-in-out;
}

.sidebar .brand { text-decoration: none; padding: 6px 8px 18px; }
.sidebar .brand-lockup .brand-text {
  -webkit-text-fill-color: #F8FAFC; background: none; color: #F8FAFC;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-spacer { flex: 1; }

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ==== Nav items: full-width rows inside the sidebar ==== */
.nav-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(248,250,252,0.68);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  width: 100%;
  transition: background-color 200ms ease-in-out, color 200ms ease-in-out;
}
.nav-pill:hover {
  color: #F8FAFC;
  background: rgba(255,255,255,0.06);
}
.nav-pill.active {
  color: #DBEAFE;
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.28);
}
.nav-pill .nav-ico {
  position: relative;
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: inherit;
}
.nav-pill .nav-ico svg { width: 16px; height: 16px; display: block; }
.nav-pill .nav-label { white-space: nowrap; }

.nav-pill.nav-danger { color: #FCA5A5; }
.nav-pill.nav-danger .nav-ico { color: #FCA5A5; }
.nav-pill.nav-danger.active { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.3); color: #FECACA; }

.nav-pill.nav-logout { border-style: none; }
.logout-form { display: block; width: 100%; }

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.01em;
  justify-content: center;
}
.balance-pill .balance-ico { width: 15px; height: 15px; flex-shrink: 0; }

/* ==== Mobile hamburger button + overlay ==== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 70;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(var(--shadow-rgb),0.12);
  color: var(--text);
  cursor: pointer;
}
.mobile-menu-btn svg { width: 20px; height: 20px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 55;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: 264px;
    box-shadow: 0 0 40px rgba(0,0,0,0.35);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .sidebar-overlay.open { display: block; }
  .container { padding-top: 74px; }
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 32px 268px;
}
@media (max-width: 900px) {
  .container { margin: 0; padding-left: 20px; padding-right: 20px; }
  .sidebar ~ .site-footer { padding-left: 32px; }
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(var(--purple-rgb),0.08), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(14,165,233,0.08), transparent 40%),
    var(--bg);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb),0.03);
}

.card { max-width: 100%; }
.card.narrow { width: 380px; max-width: 100%; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; margin-top: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-weight: 600; font-size: 14.5px; text-decoration: none;
  transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}
.google-btn:hover { background: var(--hover); box-shadow: 0 1px 4px rgba(var(--shadow-rgb),0.12); }

.or-divider {
  display: flex; align-items: center; text-align: center; color: var(--muted);
  font-size: 12.5px; margin: 18px 0;
}
.or-divider::before, .or-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.or-divider span { padding: 0 12px; }

.verify-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: rgba(var(--purple-rgb),0.06); border: 1px solid rgba(var(--purple-rgb),0.25);
  color: var(--purple); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 20px;
  font-size: 14px;
}
.verify-banner button, .verify-banner .resend-btn {
  width: auto; padding: 8px 16px; font-size: 13px; white-space: nowrap;
}
.verified-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  color: var(--green); background: var(--success-bg); padding: 3px 10px; border-radius: 999px;
  margin-left: 8px;
}
.unverified-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  color: var(--red); background: var(--error-bg); padding: 3px 10px; border-radius: 999px;
  margin-left: 8px;
}

h1 { font-size: 27px; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 18px; color: var(--text); font-weight: 600; }
p.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 24px; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
  font-weight: 500;
}

input, select {
  width: 100%;
  padding: 11px 13px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
}
input:focus, select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(var(--purple-rgb),0.12); }
input::placeholder, textarea::placeholder { color: var(--text-subtle); }

button, .btn {
  display: inline-block;
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  text-align: center;
  font-family: var(--font-body);
  transition: filter .15s, transform .15s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
button:hover, .btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

.error-box {
  background: var(--error-bg);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
}

.switch-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.switch-link a { color: var(--purple); text-decoration: none; font-weight: 600; }

.stats-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  flex: 1;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb),0.03);
}
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-family: var(--font-display); }
.stat-card .value.accent {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.offerwall-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.offerwall-wrap iframe { display: block; border: none; width: 100%; }

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pending { background: var(--warning-bg); color: var(--warning-text); }
.badge.approved, .badge.paid { background: var(--success-bg); color: var(--green); }
.badge.rejected { background: var(--error-bg); color: var(--red); }

.warning-box {
  background: rgba(var(--purple-rgb),0.06);
  border: 1px solid rgba(var(--purple-rgb),0.35);
  color: var(--purple-soft-text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ==== Landing page công khai ==== */
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; row-gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--card);
}
.landing-nav .links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.landing-nav .links a { color: var(--muted); text-decoration: none; margin-left: 0; font-size: 14px; font-weight: 500; }
.landing-nav .links a.cta {
  background: var(--gradient); color: #fff; padding: 9px 20px; border-radius: 999px; font-weight: 600;
}

/* Trang chủ dùng nav nền tối để làm nổi bật card đăng ký; các trang tĩnh khác (privacy/terms/contact)
   vẫn giữ .landing-nav nền sáng mặc định ở trên, không bị ảnh hưởng. */
.landing-nav--home {
  background: #0B1220; border-bottom: 1px solid #0B1220; padding: 14px 28px;
}
.landing-nav--home .nav-center { display: flex; gap: 26px; }
.landing-nav--home .nav-center a {
  color: #CBD5E1; text-decoration: none; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 7px;
}
.landing-nav--home .nav-center a:hover { color: #fff; }
.landing-nav--home .nav-center svg { width: 16px; height: 16px; flex-shrink: 0; }
.landing-nav--home .links a { color: #E5E7EB; }
.landing-nav--home .links a.cta {
  background: linear-gradient(90deg, var(--accent), var(--accent-vivid)); border-radius: 999px;
}
@media (max-width: 760px) { .landing-nav--home .nav-center { display: none; } }

/* ---- Hero: bố cục 2 cột — tiêu đề bên trái, card đăng ký nhanh bên phải ---- */
.home-hero {
  max-width: 1180px; margin: 0 auto; padding: 64px 28px 76px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start;
}
.home-hero .copy h1 {
  font-size: 46px; line-height: 1.16; font-weight: 700; letter-spacing: -0.02em; margin: 0;
}
.home-hero .copy h1 .grad {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-hero .copy p.lead {
  color: var(--muted); font-size: 16.5px; line-height: 1.65; margin: 22px 0 0; max-width: 480px;
}
.stats-strip {
  display: flex; gap: 36px; margin-top: 32px; flex-wrap: wrap;
}
.stats-strip .stat-value {
  font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.stats-strip .stat-label {
  font-size: 13px; color: var(--muted); margin-top: 2px;
}

.signup-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 20px 50px rgba(var(--shadow-rgb), 0.1); overflow: hidden;
}
.signup-card .bonus-strip {
  background: linear-gradient(90deg, var(--success), #16A34A); color: #fff; text-align: center;
  padding: 11px; font-size: 13.5px; font-weight: 600;
}
.signup-card .inner { padding: 28px 26px 26px; }
.signup-card h2 { font-size: 20px; text-align: center; margin: 0 0 20px; }
.signup-card .field { position: relative; margin-bottom: 12px; }
.signup-card .field input {
  width: 100%; padding: 13px 14px 13px 42px; border-radius: 12px; border: 1px solid var(--border);
  font-size: 14.5px; background: var(--input-bg); color: var(--text);
}
.signup-card .field input::placeholder { color: var(--text-subtle); }
.signup-card .field .ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-subtle);
  display: flex;
}
.signup-card .field .ico svg { width: 17px; height: 17px; }
.signup-card .btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.signup-card .btn-primary:hover { filter: brightness(1.05); }
.signup-card .divider {
  display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text-subtle);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
}
.signup-card .divider::before, .signup-card .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.signup-card .btn-social {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 500;
  color: var(--text); margin-bottom: 4px; cursor: pointer; text-decoration: none;
}
.signup-card .btn-social:hover { background: var(--hover); }
.signup-card .terms {
  font-size: 12px; color: var(--muted); display: flex; gap: 8px; margin-top: 14px; line-height: 1.5;
}
.signup-card .terms input[type="checkbox"] {
  width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--accent); cursor: pointer;
}

/* Ẩn về mặt hình ảnh nhưng vẫn được trình đọc màn hình (screen reader) đọc được —
   dùng cho các label không cần hiển thị trực quan (ví dụ input chỉ có placeholder + icon). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.signup-card .terms a { color: var(--accent); }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; padding: 40px 20px; }
  .home-hero .copy h1 { font-size: 32px; }
}

.hero-buzz {
  background: var(--gradient);
  padding: 64px 20px 76px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-buzz .app-icon {
  width: 84px; height: 84px; border-radius: 22px; background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.hero-buzz .app-icon img { width: 52px; height: 52px; border-radius: 12px; filter: brightness(0) invert(1); }
.hero-buzz h1 {
  color: #fff; font-size: 38px; line-height: 1.25; margin: 0 0 18px; letter-spacing: -0.02em;
  max-width: 620px; margin-left: auto; margin-right: auto;
}
.hero-buzz p {
  color: rgba(255,255,255,0.88); font-size: 16px; max-width: 520px; margin: 0 auto 30px;
  line-height: 1.6;
}
.hero-buzz .btn-white {
  display: inline-block; background: #fff; color: var(--purple); font-weight: 700;
  padding: 14px 38px; border-radius: 999px; text-decoration: none; font-size: 15px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18); transition: transform .15s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
.hero-buzz .btn-white:hover { transform: translateY(-2px); }

.hero {
  max-width: 780px; margin: 0 auto; text-align: center; padding: 90px 20px 30px;
  position: relative;
}
.hero .eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--purple); background: rgba(var(--purple-rgb),0.08); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: 46px; line-height: 1.18; margin-bottom: 18px; letter-spacing: -0.03em; }
.hero h1 .grad {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 17px; margin-bottom: 32px; }
.hero .btn { display: inline-block; width: auto; padding: 14px 34px; font-size: 15px; box-shadow: 0 8px 24px rgba(var(--purple-rgb),0.25); }

.features { max-width: 940px; margin: 40px auto 0; display: flex; gap: 20px; padding: 20px 20px 90px; flex-wrap: wrap; }
.features .f {
  flex: 1; min-width: 220px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: transform .18s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
.features .f:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(var(--shadow-rgb),0.07); }
.features .f .icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; background: var(--tint-purple-bg); color: var(--purple);
}
.features .f .icon svg { width: 20px; height: 20px; display: block; }
.features .f .icon.tint-green { background: var(--success-bg); color: var(--success); }
.features .f .icon.tint-amber { background: var(--warning-bg); color: var(--warning); }
.features .f .icon.tint-red { background: var(--error-bg); color: var(--error); }
.features .f .icon.tint-neutral { background: var(--bg-secondary); color: var(--muted); }
.features .f h3 { margin: 0 0 8px; font-size: 16px; font-family: var(--font-display); }
.features .f p { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.55; }

/* dải sóng trang trí lấy cảm hứng từ chữ S trong logo */
.ribbon-decor {
  position: absolute; top: 10px; right: 6%; width: 130px; height: 130px; opacity: 0.9;
  pointer-events: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 32px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--card);
  margin-top: auto;
  flex-shrink: 0;
}
/* Trên các trang có sidebar cố định (dashboard, account, admin...), chừa lề trái
   cho footer để không bị sidebar (position: fixed, z-index cao) đè lên link Privacy/Terms.
   Chỉ áp dụng ở desktop (>900px) — trên mobile sidebar ẩn nên không cần padding này,
   nếu không sẽ đè lên rule mobile ở trên và làm lệch footer trên điện thoại. */
@media (min-width: 901px) {
  .sidebar ~ .site-footer { padding-left: 268px; }
}
.site-footer a { color: var(--muted); text-decoration: none; margin-right: 16px; }
.site-footer a:hover { color: var(--purple); }

.legal-content { max-width: 760px; margin: 0 auto; padding: 44px 20px; line-height: 1.75; }
.legal-content h2 { margin-top: 34px; font-size: 18px; color: var(--purple); font-family: var(--font-display); }
.legal-content p, .legal-content li { color: var(--muted); font-size: 14.5px; }

/* ==== Account — Rewards hero (điểm thưởng nổi bật ngay đầu trang) ==== */
.rewards-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--gradient);
  padding: 30px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: 0 16px 40px rgba(var(--purple-rgb),0.28);
}
.rewards-hero::before,
.rewards-hero::after {
  content: none;
}
.rewards-hero .rh-label {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.rewards-hero .rh-value {
  color: #fff;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.rewards-hero .rh-value span { font-size: 20px; font-weight: 600; opacity: 0.85; margin-left: 6px; }
.rewards-hero .rh-sub { color: rgba(255,255,255,0.85); font-size: 13px; margin-top: 8px; position: relative; z-index: 1; }
.rewards-hero .rh-cta {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: transform .15s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
.rewards-hero .rh-cta:hover { background: rgba(255,255,255,0.28); transform: translateY(-1px); }

/* ==== Account — Information / Preferences grid ==== */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.info-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .info-grid { grid-template-columns: 1fr; } }

.pref-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.pref-row:last-child { border-bottom: none; }
.pref-row .pref-label { font-size: 14px; font-weight: 500; color: var(--text); }
.pref-row .pref-hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pref-row select.lang-select { width: auto; min-width: 190px; margin: 0; }
.pref-row .pref-value { font-size: 14px; color: var(--muted); }

/* ==== Referral box ==== */
.referral-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.referral-box .code-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.referral-box .code-row input[readonly] { flex: 1 1 200px; }
.referral-box input[readonly] { background: var(--tint-purple-bg); color: var(--purple); font-weight: 600; border-color: var(--tint-purple-border); }
.referral-box button.copy-btn { width: auto; margin-top: 0; padding: 11px 18px; white-space: nowrap; }

/* ==== Admin ==== */
.admin-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-tabs a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--border); font-size: 13px; font-weight: 500; background: var(--card);
}
.admin-tabs a.active { background: var(--gradient); color: #fff; border-color: transparent; font-weight: 600; }
.inline-form { display: inline; }
.action-btn {
  width: auto; margin: 0 4px 4px 0; padding: 7px 14px; font-size: 12px; display: inline-block;
  border-radius: 8px;
}
.action-btn.reject { background: var(--red); }
.action-btn.paid { background: var(--green); }
.small-input { width: 90px; display: inline-block; padding: 7px 9px; }

/* ==== Thẻ mở khảo sát (thay cho nhúng iframe thẳng vào trang) ==== */
.survey-launch-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; cursor: pointer; transition: transform .15s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
.survey-launch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(var(--purple-rgb),0.12);
  border-color: rgba(var(--purple-rgb),0.35);
}
.survey-launch-card.disabled { cursor: default; opacity: 0.6; }
.survey-launch-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }
.survey-launch-icon {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 14px; background: var(--purple);
  display: flex; align-items: center; justify-content: center; color: #F8FAFC;
}
.survey-launch-icon svg { width: 26px; height: 26px; display: block; }
.survey-launch-text { flex: 1; }
.survey-launch-arrow {
  font-size: 20px; color: var(--purple); flex-shrink: 0; transition: transform .15s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
.survey-launch-card:hover .survey-launch-arrow { transform: translateX(4px); }

/* ==== Survey streak card: 7-day streak -> +20% bonus, vivid orange/yellow by design ==== */
.streak-card {
  display: flex; align-items: flex-start; gap: 18px;
  background: linear-gradient(135deg, rgba(var(--streak-orange-rgb),0.10), rgba(var(--streak-orange-rgb),0.03));
  border: 1px solid rgba(var(--streak-orange-rgb),0.28);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
}
.streak-flame {
  position: relative; width: 56px; height: 64px; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: center;
}
.streak-flame-glow {
  position: absolute; bottom: -6px; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--streak-orange-rgb),0.45) 0%, rgba(var(--streak-orange-rgb),0) 72%);
  animation: streakGlowPulse 1.6s ease-in-out infinite;
}
.streak-flame-scale {
  position: relative; width: 40px; height: 60px; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: center;
  transform-origin: 50% 100%; transition: transform 500ms ease;
}
.streak-flame-outer {
  position: absolute; bottom: 0; width: 40px; height: 60px;
  background: linear-gradient(180deg, var(--streak-yellow) 0%, var(--streak-orange-soft) 45%, var(--streak-orange) 100%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  transform-origin: 50% 100%; animation: streakFlicker1 1.1s ease-in-out infinite;
}
.streak-flame-inner {
  position: absolute; bottom: 0; width: 20px; height: 38px;
  background: linear-gradient(180deg, #FFF3B0 0%, var(--streak-yellow) 60%, var(--streak-orange-soft) 100%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  transform-origin: 50% 100%; animation: streakFlicker2 0.8s ease-in-out infinite;
}
@keyframes streakFlicker1 {
  0% { transform: scaleY(1) scaleX(1) rotate(-1deg); }
  25% { transform: scaleY(1.05) scaleX(0.96) rotate(1deg); }
  50% { transform: scaleY(0.97) scaleX(1.03) rotate(-2deg); }
  75% { transform: scaleY(1.03) scaleX(0.98) rotate(1deg); }
  100% { transform: scaleY(1) scaleX(1) rotate(-1deg); }
}
@keyframes streakFlicker2 {
  0% { transform: scaleY(1) scaleX(1); }
  30% { transform: scaleY(0.94) scaleX(1.04); }
  60% { transform: scaleY(1.06) scaleX(0.95); }
  100% { transform: scaleY(1) scaleX(1); }
}
@keyframes streakGlowPulse {
  0% { opacity: calc(var(--glow-lvl, 0.5) * 0.75); }
  50% { opacity: var(--glow-lvl, 0.5); }
  100% { opacity: calc(var(--glow-lvl, 0.5) * 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .streak-flame-outer, .streak-flame-inner, .streak-flame-glow { animation: none; }
}
.streak-card-body { flex: 1; min-width: 0; }
.streak-card-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px;
}
.streak-card-head h3 { margin: 0; font-size: 16px; font-family: var(--font-display); color: var(--text); }
.streak-count {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--streak-orange);
  white-space: nowrap;
}
.streak-count-total { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.streak-dots { display: flex; gap: 6px; margin-top: 12px; }
.streak-dot {
  width: 22px; height: 22px; border-radius: 7px; background: var(--bg-secondary);
  border: 1px solid var(--border); flex-shrink: 0;
  transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}
.streak-dot.filled {
  background: var(--streak-orange); border-color: var(--streak-orange);
  box-shadow: 0 3px 8px rgba(var(--streak-orange-rgb),0.4);
}
.streak-bonus-note {
  margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted);
}
.streak-bonus-highlight {
  display: inline-block; background: #1F1300; color: var(--streak-yellow);
  font-weight: 700; padding: 1px 8px; border-radius: 6px; margin: 0 1px;
}
@media (max-width: 640px) {
  .streak-card { padding: 18px 16px; gap: 14px; }
  .streak-dots { flex-wrap: wrap; }
}

/* ==== Available surveys: fully custom card grid (colors/layout/hover all ours) ==== */
.available-surveys-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 20px;
}
.available-surveys-head {
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 16px; margin-bottom: 16px;
}
.available-surveys-head h3 { margin: 0; font-size: 17px; font-family: var(--font-display); }
.available-surveys-hint { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.cpx-no-surveys {
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 28px 12px; margin: 0; grid-column: 1 / -1;
}

.survey-sort-group { display: flex; gap: 6px; flex-shrink: 0; }
.survey-sort-btn {
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--muted);
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.survey-sort-btn:hover { border-color: var(--accent); color: var(--text); }
.survey-sort-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==== Sort dropdown: same navy/card theme as the rest of the dashboard (not browser-default white) ==== */
.survey-sort-dropdown { position: relative; flex-shrink: 0; }
.survey-sort-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text);
  font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.survey-sort-trigger:hover, .survey-sort-trigger.open { border-color: var(--accent); }
.survey-sort-chevron { transition: transform 150ms ease; }
.survey-sort-trigger.open .survey-sort-chevron { transform: rotate(180deg); }
.survey-sort-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 5;
  min-width: 150px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.45);
}
.survey-sort-menu.open { display: block; }
.survey-sort-option {
  display: block; width: 100%; text-align: left; border: none; background: none;
  color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.survey-sort-option:hover { background: var(--bg-secondary); }
.survey-sort-option.active { color: var(--accent); font-weight: 600; }

.survey-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 900px) { .survey-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .survey-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.survey-card {
  position: relative; display: block; text-decoration: none;
  background: #24345F; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 14px 14px 12px; color: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.survey-card:hover {
  background: #263C70; border-color: rgba(255,255,255,0.22);
  transform: translateY(-3px);
  box-shadow: 0 10px 22px -8px rgba(15, 23, 42, 0.55);
}
.survey-card-payout { font-size: 19px; font-weight: 700; color: #FFFFFF; }
.survey-card-meta { font-size: 12px; color: #9CCBFF; margin: 4px 0 8px; }
.survey-card-stars { font-size: 12px; letter-spacing: 1px; color: #FFD54F; }
.survey-card-badge {
  position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; color: #4A2E04;
  background: linear-gradient(135deg, #FFD54F, #FB923C);
}
.survey-card.skeleton {
  height: 84px; background: var(--bg-secondary); border: 1px solid var(--border);
  animation: surveySkeletonPulse 1.3s ease-in-out infinite;
}
@keyframes surveySkeletonPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.survey-pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 18px;
}
.survey-page-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--accent);
  background: var(--card); color: var(--accent); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: background-color 150ms ease, color 150ms ease;
}
.survey-page-btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
.survey-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.survey-page-label { font-size: 12.5px; color: var(--muted); min-width: 40px; text-align: center; }

/* ==== Dashboard hero: balance + CTA, dark blue premium card ==== */
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 32px 30px;
  margin-bottom: 20px;
  background: var(--purple);
  color: #F8FAFC;
  box-shadow: 0 16px 40px rgba(15, 30, 66, 0.28);
}
.dash-hero-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dash-hero-greeting { font-size: 20px; font-weight: 600; font-family: var(--font-display); margin: 0; }
.dash-hero-sub { color: rgba(248,250,252,0.72); font-size: 14px; margin: 6px 0 0; max-width: 440px; }
.dash-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(248,250,252,0.12); border: 1px solid rgba(248,250,252,0.18);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #E0F2FE;
  backdrop-filter: blur(6px);
}
.dash-hero-badge.offline { color: rgba(248,250,252,0.6); }
.dash-hero-metrics { position: relative; display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.dash-hero-metric .m-label { font-size: 12.5px; color: rgba(248,250,252,0.6); text-transform: uppercase; letter-spacing: .04em; }
.dash-hero-metric .m-value { font-size: 30px; font-weight: 700; font-family: var(--font-display); margin-top: 4px; }
.dash-hero-metric .m-sub { font-size: 12.5px; color: rgba(248,250,252,0.55); margin-top: 2px; }
.dash-hero-cta { position: relative; margin-top: 26px; }
.dash-hero-cta .btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  background: #F8FAFC; color: var(--accent-dark, #1D4ED8);
  font-weight: 700; padding: 13px 26px; border-radius: 12px; font-size: 14.5px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.22); cursor: pointer; border: none;
  transition: transform .15s ease;
}
.dash-hero-cta .btn-hero:hover { transform: translateY(-1px); }
.dash-hero-cta .btn-hero svg { width: 18px; height: 18px; display: block; }
.dash-hero-cta .btn-hero.disabled { opacity: 0.55; cursor: default; pointer-events: none; }

/* ==== Quick stat tiles (below hero) ==== */
.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.quick-stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.quick-stat-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--tint-purple-bg); color: var(--purple);
}
.quick-stat-icon svg { width: 20px; height: 20px; display: block; }
.quick-stat-icon.green { background: var(--success-bg); color: var(--success); }
.quick-stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.quick-stat-card .label { color: var(--muted); font-size: 12.5px; }
.quick-stat-card .value { font-size: 18px; font-weight: 700; font-family: var(--font-display); margin-top: 2px; }

/* ==== Recent activity list (Transaction History) ==== */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint-purple-bg); color: var(--purple);
}
.activity-icon svg { width: 21px; height: 21px; display: block; }
.activity-icon.tint-green { background: var(--success-bg); color: var(--success); }
.activity-icon.tint-red { background: var(--error-bg); color: var(--error); }
.activity-icon.tint-amber { background: var(--warning-bg); color: var(--warning); }
.activity-icon.tint-neutral { background: var(--bg-secondary); color: var(--muted); }
.activity-main { flex: 1; min-width: 0; }
.activity-title { font-weight: 600; font-size: 14.5px; color: var(--text); }
.activity-sub {
  font-size: 12.5px; color: var(--muted); margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.activity-sub .dot { color: var(--text-subtle); }
.activity-points { font-weight: 700; font-size: 15px; white-space: nowrap; flex-shrink: 0; padding-left: 8px; }
.activity-points.pos { color: var(--success); }
.activity-points.neg { color: var(--error); }
.activity-empty { color: var(--muted); font-size: 14px; padding: 24px 4px; text-align: center; }

/* ==== Points → $ conversion card ==== */
.convert-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; margin-top: 20px;
}
.convert-card h3 { margin: 0 0 4px; font-size: 17px; }
.convert-card .convert-rate-note { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.convert-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.convert-input-group { flex: 1; min-width: 180px; }
.convert-input-group label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.convert-input-group input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text); font-size: 15px; font-weight: 600;
}
.convert-equals { font-size: 20px; color: var(--muted); flex-shrink: 0; margin-top: 18px; }
.convert-result {
  flex: 1; min-width: 180px; padding: 12px 14px; border-radius: 10px;
  background: var(--tint-purple-bg); border: 1px solid var(--tint-purple-border);
}
.convert-result .cr-label { font-size: 12.5px; color: var(--muted); }
.convert-result .cr-value { font-size: 20px; font-weight: 700; color: var(--purple); margin-top: 2px; font-family: var(--font-display); }
.convert-hint { font-size: 12.5px; color: var(--text-subtle); margin-top: 12px; }
.convert-hint a { color: var(--purple); font-weight: 600; text-decoration: none; }

@media (max-width: 640px) {
  .dash-hero { padding: 24px 20px; }
  .dash-hero-metrics { gap: 20px; }
  .dash-hero-metric .m-value { font-size: 24px; }
}

/* ==== Modal toàn màn hình chứa CPX offerwall ====
   Kích thước tính theo viewport (dvh/vw) để KHÔNG BAO GIỜ tràn quá màn hình,
   dù nội dung bên trong iframe dài bao nhiêu — iframe tự cuộn nội bộ. */
.survey-modal {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(var(--shadow-rgb),0.55);
  align-items: center; justify-content: center;
  padding: 20px;
}
.survey-modal.open { display: flex; }

.survey-modal-inner {
  width: min(760px, 100%);
  height: min(88dvh, 900px);
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.survey-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; /* header không co lại, phần còn lại nhường hết cho iframe */
}
.survey-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--muted); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; margin: 0; padding: 0;
}
.survey-modal-close:hover { background: var(--border); color: var(--text); }

.survey-modal-body {
  flex: 1;           /* chiếm toàn bộ chiều cao còn lại sau header, không tự set số cố định */
  min-height: 0;      /* bắt buộc để flex-child cho phép iframe con cuộn thay vì đẩy tràn container */
}
.survey-modal-body iframe {
  width: 100%; height: 100%; border: none; display: block;
}

@media (max-width: 640px) {
  .survey-modal { padding: 0; }
  .survey-modal-inner { width: 100%; height: 100dvh; border-radius: 0; }
}

/* ==== Thông báo "Hoàn thành khảo sát" / "Rời khảo sát" ====
   Hiện đè LÊN TRÊN cả survey-modal (z-index cao hơn) để dù khảo sát đang mở trong
   modal iframe hay đã mở ở tab mới, thông báo vẫn luôn xuất hiện ngay trên trang web
   của chính mình — dùng đúng bộ màu --card/--border/--text như phần còn lại của site. */
.survey-result-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(var(--shadow-rgb),0.6);
  align-items: center; justify-content: center;
  padding: 20px;
}
.survey-result-overlay.open { display: flex; animation: resultFadeIn 180ms ease-out; }
@keyframes resultFadeIn { from { opacity: 0; } to { opacity: 1; } }

.survey-result-card {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  padding: 32px 28px 26px;
  text-align: center;
  animation: resultPop 220ms cubic-bezier(.2,.9,.3,1.2);
}
@keyframes resultPop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.survey-result-icon {
  width: 76px; height: 76px; margin: 0 auto 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.survey-result-icon.success { background: var(--success-bg); color: var(--green); }
.survey-result-icon.exit { background: rgba(var(--purple-rgb),0.12); color: var(--purple); }

.survey-result-card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: var(--text); }
.survey-result-points { font-size: 28px; font-weight: 800; color: var(--green); margin: 4px 0 10px; }
.survey-result-card p { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.survey-result-tip {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font-size: 13px; color: var(--muted); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px; text-align: left;
}

.survey-result-actions { display: flex; flex-direction: column; gap: 10px; }
.survey-result-btn {
  display: block; width: 100%; padding: 12px; border-radius: 12px; font-size: 14.5px;
  font-weight: 600; cursor: pointer; border: 1px solid transparent; text-decoration: none;
}
.survey-result-btn.primary { background: var(--gradient); color: #fff; }
.survey-result-btn.secondary { background: var(--bg); border-color: var(--border); color: var(--text); }

/* ==== Phone breakpoint: giữ giao diện gọn gàng trên màn hình nhỏ ==== */
@media (max-width: 560px) {
  .container { padding: 74px 14px 22px; }
  .hero { padding: 50px 16px 24px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .features { padding: 16px 14px 60px; }
  .card { padding: 20px; }
  .stat-card { min-width: 100%; }
  .balance-pill { font-size: 12px; padding: 6px 12px; }
  th, td { padding: 8px; font-size: 13px; }
  .site-footer { flex-direction: column; text-align: center; padding: 22px 16px; }
}

/* ==== Chat: link + badge trên nav ==== */
.chat-dot {
  position: absolute; top: -1px; right: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px var(--card);
}

/* ==== Chat: khung chat của người dùng ==== */
.chat-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 68vh;
  min-height: 420px;
  overflow: hidden;
}
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header .title { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.chat-header .sub { color: var(--muted); font-size: 12.5px; }
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  max-width: 260px;
}
.chat-bubble-row { display: flex; }
.chat-bubble-row.out { justify-content: flex-end; }
.chat-bubble-row.in { justify-content: flex-start; }
.chat-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb),0.05);
}
.chat-bubble-row.out .chat-bubble {
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-row.in .chat-bubble {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-meta {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.7;
}
.chat-bubble-row.out .chat-meta { color: rgba(255,255,255,0.85); text-align: right; }
.chat-bubble-row.in .chat-meta { color: var(--muted); }
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.chat-input-row textarea {
  flex: 1;
  resize: none;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 44px;
  max-height: 120px;
  margin: 0;
}
.chat-input-row textarea:focus { outline: none; border-color: var(--purple); }
.chat-input-row button {
  width: auto;
  margin: 0;
  padding: 0 22px;
  border-radius: 12px;
  align-self: flex-end;
  height: 44px;
}

/* ==== Chat: danh sách hội thoại phía admin ==== */
.chat-convo-list { display: flex; flex-direction: column; }
.chat-convo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
}
.chat-convo-item:last-child { border-bottom: none; }
.chat-convo-item:hover { background: var(--bg); }
.chat-convo-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.chat-convo-body { flex: 1; min-width: 0; }
.chat-convo-name { font-weight: 600; font-size: 14px; }
.chat-convo-preview {
  color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.chat-convo-side { text-align: right; flex-shrink: 0; }
.chat-convo-time { color: var(--muted); font-size: 11.5px; }
.chat-convo-unread {
  display: inline-block; margin-top: 4px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 2px 8px;
}
.chat-back-link {
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px;
}
.chat-back-link:hover { color: var(--purple); }

@media (max-width: 560px) {
  .chat-wrap { height: 78vh; min-height: 380px; border-radius: 12px; }
  .chat-bubble { max-width: 86%; }
  .chat-convo-preview { max-width: 160px; }
}

/* ==== Account — Background music card ==== */
.music-card-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.music-card-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.music-card-icon svg { width: 22px; height: 22px; }
.music-card-sub { color: var(--muted); font-size: 13.5px; margin: 0; }
.music-inline-btn {
  width: auto; margin: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; font-size: 13.5px;
}
.music-inline-btn svg { width: 15px; height: 15px; }

/* ==== Nút play nhạc nổi ở góc màn hình ==== */
.music-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 1200;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(var(--purple-rgb),0.35);
  transition: transform .15s, background-color 200ms ease-in-out, border-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out, fill 200ms ease-in-out, stroke 200ms ease-in-out;
  padding: 0;
}
.music-fab svg { width: 20px; height: 20px; }
.music-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 32px rgba(var(--purple-rgb),0.42); }
.music-fab.is-playing { animation: musicPulse 1.8s ease-in-out infinite; }
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(var(--purple-rgb),0.35); }
  50% { box-shadow: 0 10px 30px rgba(var(--purple-rgb),0.55), 0 0 0 8px rgba(var(--purple-rgb),0.08); }
}

@media (max-width: 560px) {
  .music-fab { right: 16px; bottom: 16px; width: 48px; height: 48px; }
  .music-inline-btn { width: 100%; justify-content: center; }
}

/* ==== Tinted note (đổi từ inline style cứng sang token để tương thích Dark Mode) ==== */
.tinted-note {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--tint-purple-bg);
  border: 1px solid var(--tint-purple-border);
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 18px;
}
.paypal-mark-icon { width: 18px; height: 18px; display: block; object-fit: contain; flex-shrink: 0; }

/* ============================================================
   Theme toggle — animated sun/moon switch
   ============================================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
}
.theme-toggle:hover .theme-toggle-track { border-color: var(--purple); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 999px;
}
.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 50px;
  height: 27px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out;
}
.theme-toggle-track .track-ico {
  position: relative;
  z-index: 1;
  width: 13px; height: 13px;
  flex: none;
  color: var(--text-subtle);
  transition: color 200ms ease-in-out, opacity 200ms ease-in-out;
}
.theme-toggle-track .track-ico.sun { margin-left: 5px; }
.theme-toggle-track .track-ico.moon { margin-left: auto; margin-right: 5px; }
[data-theme="dark"] .theme-toggle-track .track-ico.sun { opacity: 0.45; }
.theme-toggle-track .track-ico.moon { opacity: 0.45; }
[data-theme="dark"] .theme-toggle-track .track-ico.moon { opacity: 1; color: #FBBF24; }
.theme-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 2px 6px rgba(var(--purple-rgb), 0.45);
  transform: translateX(0);
  transition: transform 200ms ease-in-out, background-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(23px); }

@media (max-width: 900px) {
  .theme-toggle { order: 1; }
}

.auth-theme-toggle {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 1300;
}

@media (prefers-reduced-motion: reduce) {
  html, body, *, *::before, *::after,
  .theme-toggle-track, .theme-toggle-thumb, .theme-toggle-thumb svg {
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   Theme toggle — glowing knob + reveal "ripple" animation
   (adds a full-screen circular wipe from the toggle's position,
   like a sun/moon rising, instead of an instant flat colour swap)
   ============================================================ */
.theme-toggle-track .track-ico.sun {
  filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.65));
}
[data-theme="dark"] .theme-toggle-track .track-ico.moon {
  filter: drop-shadow(0 0 3px rgba(147, 197, 253, 0.55));
}
.theme-toggle-thumb {
  box-shadow: 0 2px 6px rgba(var(--purple-rgb), 0.45), 0 0 10px 1px rgba(var(--purple-rgb), 0.35);
}
[data-theme="dark"] .theme-toggle-thumb {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 10px 1px rgba(147, 197, 253, 0.45);
}

.theme-ripple {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  background: var(--theme-ripple-color, #0F172A);
  transform: translate(-50%, -50%) scale(0);
  animation: themeRippleAnim 650ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes themeRippleAnim {
  to { transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-ripple { display: none; }
}

/* ============================================================
   Admin overview — monthly summary + charts
   ============================================================ */
.monthly-grid { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.monthly-card {
  flex: 1; min-width: 190px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.monthly-card .label { color: var(--muted); font-size: 12.5px; }
.monthly-card .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-family: var(--font-display); }
.monthly-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.monthly-delta.up { color: var(--green); }
.monthly-delta.down { color: var(--red); }
.monthly-delta.flat { color: var(--text-subtle); }

.charts-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 24px; align-items: stretch; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.chart-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.chart-card .chart-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.chart-card .chart-canvas-wrap { position: relative; height: 220px; }

.country-list { list-style: none; margin: 0; padding: 0; }
.country-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.country-list li:last-child { border-bottom: none; }
.country-list .flag-name { display: flex; align-items: center; gap: 8px; color: var(--text); }
.country-list .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.country-bar-track { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-secondary); margin: 0 10px; overflow: hidden; }
.country-bar-fill { height: 100%; background: var(--gradient); border-radius: 999px; }
