/* Chimeratool storefront design system ------------------------------- */
:root {
  --bg: #070b16;
  --bg-elevated: #0d1326;
  --bg-card: #111a33;
  --bg-card-hover: #141f3d;
  --border: #22304f;
  --border-soft: #1a253f;
  --text: #eef1fb;
  --text-muted: #9aa5c4;
  --text-faint: #6b7592;
  --blue: #4f8cff;
  --blue-bright: #6ea8ff;
  --purple: #9b5cff;
  --purple-bright: #b184ff;
  --gradient-brand: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  --gradient-glow: radial-gradient(60% 60% at 50% 0%, rgba(107, 140, 255, 0.18) 0%, rgba(155, 92, 255, 0.06) 45%, transparent 80%);
  --success: #3ddc97;
  --warning: #ffb648;
  --danger: #ff6b81;
  --info: #4f8cff;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 24px rgba(3, 6, 16, 0.55);
  --shadow-pop: 0 16px 48px rgba(3, 6, 16, 0.65);
  --focus-ring: 0 0 0 3px rgba(110, 168, 255, 0.55);
  --container: 1180px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Sora', var(--font-sans);
}

:root[data-theme='light'] {
  --bg: #f5f7fc;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f3fb;
  --border: #dfe4f2;
  --border-soft: #e8ebf5;
  --text: #131a2c;
  --text-muted: #4d5876;
  --text-faint: #7d87a3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; color: var(--text-muted); }
code, pre { font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; }
code { background: var(--bg-elevated); border: 1px solid var(--border-soft); padding: 0.15em 0.4em; border-radius: 6px; font-size: 0.9em; }

/* Accessible focus ring everywhere, including keyboard-only nav */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: 10px 16px; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- nav */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 11, 22, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
:root[data-theme='light'] .site-header { background: rgba(255,255,255,0.86); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; max-width: var(--container); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand img, .brand .logo-mark { height: 32px; width: 32px; border-radius: 8px; }
.logo-mark { background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.9rem; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.94rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg-card); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 10px; }

.disclaimer-bar { background: linear-gradient(90deg, rgba(79,140,255,0.12), rgba(155,92,255,0.12)); border-bottom: 1px solid var(--border-soft); font-size: 0.82rem; color: var(--text-muted); text-align: center; padding: 8px 16px; }

/* ------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border-soft); margin-top: 80px; padding: 48px 0 32px; color: var(--text-faint); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: var(--text); font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--text-faint); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------------- hero */
.hero { position: relative; padding: 76px 0 56px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -20% -10% auto -10%; height: 480px; background: var(--gradient-glow); pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-bright); background: rgba(79,140,255,0.12); border: 1px solid rgba(79,140,255,0.3); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { margin-bottom: 18px; }
.hero .lead { font-size: 1.1rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-pop); }

/* --------------------------------------------------------------- grid */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; }

/* --------------------------------------------------------------- card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.card:hover { border-color: rgba(110,168,255,0.4); transform: translateY(-3px); background: var(--bg-card-hover); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }

.product-card { display: flex; flex-direction: column; gap: 14px; position: relative; }
.product-card .thumb { aspect-ratio: 16/10; border-radius: var(--radius-sm); background: linear-gradient(135deg, rgba(79,140,255,0.16), rgba(155,92,255,0.16)); display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border-soft); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--purple-bright); font-weight: 700; }
.product-card h3 { margin: 2px 0 4px; }
.product-card .desc { font-size: 0.92rem; margin-bottom: 4px; flex: 1; }
.product-card .price-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--text); }
.price small { font-size: 0.7em; color: var(--text-faint); font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; }
.badge-brand { background: var(--gradient-brand); color: #fff; }
.badge-outline { border-color: var(--border); color: var(--text-muted); }
.badge-success { background: rgba(61,220,151,0.14); color: var(--success); border-color: rgba(61,220,151,0.3); }
.badge-warning { background: rgba(255,182,72,0.14); color: var(--warning); border-color: rgba(255,182,72,0.3); }
.badge-danger { background: rgba(255,107,129,0.14); color: var(--danger); border-color: rgba(255,107,129,0.3); }
.badge-info { background: rgba(79,140,255,0.14); color: var(--blue-bright); border-color: rgba(79,140,255,0.3); }
.badge-demo { background: repeating-linear-gradient(45deg, rgba(255,182,72,0.18), rgba(255,182,72,0.18) 6px, rgba(255,182,72,0.28) 6px, rgba(255,182,72,0.28) 12px); color: #ffcd7a; border-color: rgba(255,182,72,0.5); }

/* ------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 8px 24px rgba(107,120,255,0.35); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(107,120,255,0.45); text-decoration: none; }
.btn-secondary { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--blue-bright); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-card); text-decoration: none; }
.btn-danger { background: rgba(255,107,129,0.14); color: var(--danger); border-color: rgba(255,107,129,0.35); }
.btn-danger:hover { background: rgba(255,107,129,0.22); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }

.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.4s; } }

/* --------------------------------------------------------------- forms */
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field-hint { font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }
.field-error { font-size: 0.82rem; color: var(--danger); margin-top: 4px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'], input[type='date'], input[type='tel'], input[type='url'], textarea, select {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  padding: 11px 14px; border-radius: 10px; font-size: 0.95rem; font-family: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, textarea:hover, select:hover { border-color: var(--blue-bright); }
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
fieldset { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; margin: 0 0 18px; }
legend { padding: 0 8px; font-weight: 700; font-family: var(--font-display); }

.input-invalid { border-color: var(--danger) !important; }
[aria-invalid='true'] { border-color: var(--danger); }

/* ---------------------------------------------------------------- alerts */
.alert { border-radius: var(--radius); padding: 14px 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.alert-info { background: rgba(79,140,255,0.1); border-color: rgba(79,140,255,0.3); color: var(--blue-bright); }
.alert-success { background: rgba(61,220,151,0.1); border-color: rgba(61,220,151,0.3); color: var(--success); }
.alert-warning { background: rgba(255,182,72,0.1); border-color: rgba(255,182,72,0.3); color: var(--warning); }
.alert-danger { background: rgba(255,107,129,0.1); border-color: rgba(255,107,129,0.3); color: var(--danger); }

/* ----------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; }
tr:hover td { background: rgba(255,255,255,0.015); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); }
.table-wrap table { min-width: 640px; }

/* ------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 24px 32px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--gradient-brand); box-shadow: 0 0 0 4px rgba(79,140,255,0.15); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 16px; bottom: -8px; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t-when { font-size: 0.78rem; color: var(--text-faint); }
.timeline .t-msg { font-weight: 600; margin-top: 2px; }

/* ------------------------------------------------------------- stat tile */
.stat-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-tile .stat-label { font-size: 0.78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-tile .stat-value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 800; margin-top: 6px; }
.stat-tile .stat-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* --------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--blue); }

/* -------------------------------------------------------------- misc */
.muted { color: var(--text-faint); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--border-soft); border: none; margin: 24px 0; }
.copy-field { display: flex; gap: 8px; align-items: center; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; word-break: break-all; }
.copy-field button { flex-shrink: 0; }
.qr-box { width: 176px; height: 176px; border-radius: var(--radius); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.78rem; color: var(--text-faint); padding: 10px; background: var(--bg-elevated); }
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 37%, var(--bg-card) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }
* { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }

.countdown { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--warning); }
.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; }

/* ------------------------------------------------------------- admin shell */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--bg-elevated); border-right: 1px solid var(--border-soft); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .brand { padding: 8px 10px 20px; }
.admin-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.admin-nav a:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: rgba(79,140,255,0.12); color: var(--blue-bright); }
.admin-nav .nav-section { font-size: 0.72rem; text-transform: uppercase; color: var(--text-faint); letter-spacing: 0.05em; padding: 16px 12px 6px; }
.admin-main { padding: 28px 32px 60px; max-width: 1240px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; display: none; }
  .admin-sidebar.open { display: block; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links.open { display: flex; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-elevated); flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border-soft); }
  .grid-3, .grid-4, .grid-2, .form-row { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 36px; }
  .footer-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 20px 16px 48px; }
}
