/* SteamPay shared styles — dark (default) + light */
:root,
[data-theme="dark"] {
  --bg: #060a14;
  --bg2: #0a1020;
  --card: linear-gradient(165deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 16, 32, 0.98) 100%);
  --card-border: rgba(59, 130, 246, 0.22);
  --text: #ffffff;
  --muted: #94a3b8;
  --muted2: #64748b;
  --input-bg: rgba(15, 23, 42, 0.65);
  --input-border: rgba(59, 130, 246, 0.25);
  --nav: #cbd5e1;
  --footer-link: #94a3b8;
  --header-border: rgba(255, 255, 255, 0.06);
  --modal-overlay: rgba(2, 6, 23, 0.78);
  --hero-1: rgba(59, 130, 246, 0.22);
  --hero-2: rgba(139, 92, 246, 0.12);
  --hero-3: rgba(6, 182, 212, 0.06);
  --shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg2: #e2e8f0;
  --card: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  --card-border: rgba(59, 130, 246, 0.18);
  --text: #0f172a;
  --muted: #475569;
  --muted2: #64748b;
  --input-bg: #ffffff;
  --input-border: rgba(148, 163, 184, 0.45);
  --nav: #334155;
  --footer-link: #64748b;
  --header-border: rgba(15, 23, 42, 0.08);
  --modal-overlay: rgba(15, 23, 42, 0.45);
  --hero-1: rgba(59, 130, 246, 0.12);
  --hero-2: rgba(139, 92, 246, 0.08);
  --hero-3: rgba(6, 182, 212, 0.05);
  --shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.12);
}

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

body {
  background: var(--bg);
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

.hero-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--hero-1), transparent),
    radial-gradient(ellipse 50% 30% at 100% 0%, var(--hero-2), transparent),
    radial-gradient(ellipse 40% 40% at 0% 50%, var(--hero-3), transparent),
    var(--bg);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.06), var(--shadow);
}

.input-field,
.select-field,
textarea.input-field {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  transition: all 0.25s ease;
  color: var(--text);
  border-radius: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
}
.input-field:focus,
.select-field:focus,
textarea.input-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.input-field::placeholder { color: var(--muted2); }

.btn-primary {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  color: #fff !important;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.55);
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(59, 130, 246, 0.7);
}

.nav-link {
  color: var(--nav);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.footer-link {
  color: var(--footer-link);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-link:hover { color: #60a5fa; }
.footer-link svg, .nav-link svg { width: 14px; height: 14px; opacity: 0.75; flex-shrink: 0; }

.prose-doc { white-space: pre-wrap; line-height: 1.7; color: var(--muted); font-size: 0.9rem; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(6, 10, 20, 0.85);
  border-bottom: 1px solid var(--header-border);
}
footer.site-footer {
  border-top: 1px solid var(--header-border);
  margin-top: auto;
}

#themeToggle {
  width: 36px; height: 36px;
  border-radius: 0.75rem;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: 0.15s;
}
#themeToggle:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

[data-theme="light"] .text-white { color: #0f172a !important; }
[data-theme="light"] .text-slate-300,
[data-theme="light"] .text-slate-400 { color: #475569 !important; }
[data-theme="light"] .text-slate-500 { color: #64748b !important; }
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10 { border-color: rgba(15, 23, 42, 0.08) !important; }
[data-theme="light"] .bg-white\/5 { background: rgba(15, 23, 42, 0.04) !important; }
[data-theme="light"] .bg-slate-900\/30 { background: rgba(241, 245, 249, 0.85) !important; }

[data-theme="dark"] .text-white { color: #ffffff !important; }
[data-theme="dark"] .text-slate-300 { color: #cbd5e1 !important; }
[data-theme="dark"] .text-slate-400 { color: #94a3b8 !important; }
[data-theme="dark"] .text-slate-500 { color: #64748b !important; }

.link-icon { width: 1em; height: 1em; opacity: 0.7; vertical-align: -0.15em; margin-right: 0.3rem; }


/* Extra light-theme coverage */
[data-theme="light"] .bg-gradient-to-r.from-blue-400.to-purple-400 {
  /* keep gradient text readable */
}
[data-theme="light"] .shadow-blue-500\/30 { --tw-shadow-color: rgba(59,130,246,0.15); }
[data-theme="light"] .prose-doc { color: #334155; }
[data-theme="light"] .card { color: #0f172a; }
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3 { color: #0f172a; }
[data-theme="light"] .text-blue-400 { color: #2563eb !important; }
[data-theme="light"] .text-amber-400, [data-theme="light"] .text-amber-300 { color: #d97706 !important; }
[data-theme="light"] .text-emerald-400 { color: #059669 !important; }
[data-theme="light"] .text-red-400 { color: #dc2626 !important; }
[data-theme="light"] .border-white\/5 { border-color: rgba(15,23,42,0.08) !important; }
[data-theme="light"] header.site-header { background: rgba(241,245,249,0.9); }
[data-theme="light"] .btn-ghost {
  border-color: rgba(15,23,42,0.12);
  color: #334155;
}
[data-theme="light"] details { background: #fff; border: 1px solid rgba(15,23,42,0.08); border-radius: 0.75rem; padding: 0.75rem 1rem; }
[data-theme="light"] .amount-btn { background: #fff; border-color: rgba(148,163,184,0.4); color: #0f172a; }
[data-theme="light"] .modal-box { background: #fff; color: #0f172a; }
[data-theme="light"] .modal-header { border-color: rgba(15,23,42,0.08); }

/* Full light theme polish for internal pages */
[data-theme="light"] body,
[data-theme="light"] .hero-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59,130,246,.10), transparent),
    radial-gradient(ellipse 50% 30% at 100% 0%, rgba(139,92,246,.06), transparent),
    #f1f5f9 !important;
  color: #0f172a;
}
[data-theme="light"] .card {
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.15) !important;
  box-shadow: 0 10px 30px -12px rgba(15,23,42,0.12) !important;
  color: #0f172a;
}
[data-theme="light"] .site-header {
  background: rgba(255,255,255,0.9) !important;
  border-bottom-color: rgba(15,23,42,0.08) !important;
}
[data-theme="light"] .site-footer {
  border-top-color: rgba(15,23,42,0.08) !important;
  background: #f8fafc;
}
[data-theme="light"] .nav-link { color: #334155 !important; }
[data-theme="light"] .nav-link:hover, [data-theme="light"] .nav-link.active { color: #0f172a !important; }
[data-theme="light"] .footer-link { color: #64748b !important; }
[data-theme="light"] .footer-link:hover { color: #2563eb !important; }
[data-theme="light"] .text-white { color: #0f172a !important; }
[data-theme="light"] .text-slate-300,
[data-theme="light"] .text-slate-400 { color: #475569 !important; }
[data-theme="light"] .text-slate-500 { color: #64748b !important; }
[data-theme="light"] .input-field,
[data-theme="light"] .select-field,
[data-theme="light"] textarea.input-field {
  background: #fff !important;
  color: #0f172a !important;
  border-color: rgba(148,163,184,0.5) !important;
}
[data-theme="light"] #langMenu {
  background: #fff !important;
  border-color: rgba(15,23,42,0.1) !important;
  color: #0f172a;
}
[data-theme="light"] .lang-opt:hover { background: rgba(15,23,42,0.04) !important; }
[data-theme="light"] .btn-ghost {
  border-color: rgba(15,23,42,0.12);
  color: #334155;
  background: #fff;
}
[data-theme="light"] #themeToggle {
  background: #fff;
  border-color: rgba(148,163,184,0.45);
  color: #475569;
}
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3 { color: #0f172a; }
[data-theme="light"] .prose-doc { color: #334155; }
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10 { border-color: rgba(15,23,42,0.08) !important; }
[data-theme="light"] .bg-white\/5 { background: rgba(15,23,42,0.04) !important; }


/* Sticky header site-wide */
header.site-header,
header.site-header-sticky,
body > header,
#site-header-root header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(6, 10, 20, 0.85);
  border-bottom: 1px solid var(--header-border, rgba(255,255,255,0.06));
}
[data-theme="light"] header.site-header,
[data-theme="light"] header.site-header-sticky,
[data-theme="light"] body > header,
[data-theme="light"] #site-header-root header {
  background: rgba(241, 245, 249, 0.9);
}


/* Prevent layout jump while header/footer load */
#site-header-root {
  min-height: 5rem; /* h-20 */
  display: block;
}
#site-footer-root {
  min-height: 12rem;
  display: block;
}
header.site-header {
  min-height: 5rem;
}

/* Smooth user stats modal */
#userStatsModal.modal-overlay,
#userStatsModal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 1rem;
}
#userStatsModal.open,
#userStatsModal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
#userStatsModal .modal-panel,
#userStatsModal [role="dialog"] {
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
  max-width: 28rem;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(15,23,42,.98), rgba(10,16,32,.98));
  border: 1px solid rgba(59,130,246,.25);
}
#userStatsModal.open .modal-panel,
#userStatsModal.open [role="dialog"],
#userStatsModal[aria-hidden="false"] .modal-panel,
#userStatsModal[aria-hidden="false"] [role="dialog"] {
  transform: translateY(0) scale(1);
  opacity: 1;
}
[data-theme="light"] #userStatsModal [role="dialog"] {
  background: #fff;
  border-color: rgba(15,23,42,.12);
  color: #0f172a;
}


/* FAQ + legal documents */
.faq-item {
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(165deg, rgba(15,23,42,.92), rgba(10,16,32,.96));
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.faq-item[open], .faq-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 30px -12px rgba(59,130,246,.25);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .faq-q {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.faq-item summary .faq-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .55rem;
  background: rgba(59,130,246,.18);
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.faq-item summary .faq-chevron {
  color: #64748b;
  transition: transform .2s ease;
  flex-shrink: 0;
  margin-top: .15rem;
}
.faq-item[open] summary .faq-chevron { transform: rotate(180deg); color: #60a5fa; }
.faq-item .faq-a {
  padding: 0 1.15rem 1.15rem 3.65rem;
  color: #94a3b8;
  font-size: .9rem;
  line-height: 1.65;
}
.faq-item .faq-a p { margin: 0 0 .6rem; }
.faq-item .faq-a p:last-child { margin-bottom: 0; }

.legal-doc {
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(165deg, rgba(15,23,42,.92), rgba(10,16,32,.96));
  border-radius: 1.1rem;
  padding: 1.5rem 1.35rem;
}
.legal-doc h1, .legal-doc .legal-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.legal-doc .legal-meta {
  font-size: .8rem;
  color: #64748b;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.legal-body {
  color: #cbd5e1;
  font-size: .95rem;
  line-height: 1.75;
}
.legal-body h2, .legal-body h3 {
  color: #fff;
  font-weight: 700;
  margin: 1.35rem 0 .65rem;
}
.legal-body h2 { font-size: 1.15rem; }
.legal-body h3 { font-size: 1.02rem; }
.legal-body p { margin: 0 0 .85rem; }
.legal-body ul, .legal-body ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.legal-body ul { list-style: disc; }
.legal-body ol { list-style: decimal; }
.legal-body li { margin-bottom: .35rem; }
.legal-body a { color: #60a5fa; text-decoration: underline; }
.legal-body strong, .legal-body b { color: #e2e8f0; }

[data-theme="light"] .faq-item,
[data-theme="light"] .legal-doc {
  background: #fff;
  border-color: rgba(15,23,42,.1);
  box-shadow: 0 8px 24px -12px rgba(15,23,42,.12);
}
[data-theme="light"] .faq-item summary { color: #0f172a; }
[data-theme="light"] .faq-item .faq-a { color: #64748b; }
[data-theme="light"] .legal-body { color: #334155; }
[data-theme="light"] .legal-body h2,
[data-theme="light"] .legal-body h3 { color: #0f172a; }
