/* ============================================================
   LeadScale - Vanilla CSS (replaces Tailwind CDN)
   Implements every utility class used in the PHP templates.
   ============================================================ */

/* --- Design tokens (DARK is default — Amplifye-inspired) --- */
:root, [data-theme="dark"] {
  --background: 215 30% 7%;
  --foreground: 0 0% 98%;
  --card: 215 25% 11%;
  --card-foreground: 0 0% 98%;
  --primary: 165 75% 45%;
  --primary-foreground: 215 30% 7%;
  --accent-brand: 165 75% 50%;
  --secondary: 215 22% 14%;
  --secondary-foreground: 0 0% 98%;
  --muted: 215 22% 14%;
  --muted-foreground: 215 12% 65%;
  --accent: 215 22% 17%;
  --accent-foreground: 0 0% 98%;
  --border: 215 22% 18%;
  --ring: 165 75% 45%;
  --tag-bg: 165 60% 18%;
  --tag-text: 165 80% 75%;
  --success: 142 60% 55%;
  --surface-sunken: 215 28% 5%;
  --nav-bg: 215 30% 7% / 0.85;
}

/* --- Light mode tokens --- */
[data-theme="light"] {
  --background: 0 0% 100%;
  --foreground: 215 30% 12%;
  --card: 0 0% 100%;
  --card-foreground: 215 30% 12%;
  --primary: 165 75% 38%;
  --primary-foreground: 0 0% 100%;
  --accent-brand: 165 75% 38%;
  --secondary: 215 16% 96%;
  --secondary-foreground: 215 30% 12%;
  --muted: 215 16% 96%;
  --muted-foreground: 215 10% 42%;
  --accent: 215 16% 92%;
  --accent-foreground: 215 30% 12%;
  --border: 215 16% 88%;
  --ring: 165 75% 38%;
  --tag-bg: 165 60% 94%;
  --tag-text: 165 70% 30%;
  --success: 142 60% 38%;
  --surface-sunken: 215 16% 97%;
  --nav-bg: 0 0% 100% / 0.85;
}

/* Smooth theme switch */
html { color-scheme: light dark; }
body, .bg-card, .nav-bar, .features-section { transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease; }

/* Themed surfaces */
.nav-bar { background-color: hsl(var(--nav-bg)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.features-section { background-color: hsl(var(--surface-sunken)); }

/* Logo inverts in dark mode */
[data-theme="dark"] .logo-img { filter: brightness(0) invert(1); }
/* Client logos (often dark wordmarks) lighten in dark mode */
[data-theme="dark"] .client-logo { filter: brightness(0) invert(1) opacity(0.92); }

/* Hero background — radial teal glow */
.hero-section { background: hsl(var(--background)); }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 0.375rem;
  color: hsl(var(--foreground)); background: transparent; border: 0;
  cursor: pointer; padding: 0;
}
.theme-toggle:hover { background-color: hsl(var(--accent)); }
.theme-toggle svg { width: 1rem; height: 1rem; }
[data-theme="light"] .theme-toggle .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: none; }

/* Hero background decorations (radial teal glow) */
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(800px 400px at 20% 10%, hsl(var(--accent-brand) / 0.18), transparent 60%),
    radial-gradient(600px 400px at 90% 30%, hsl(var(--accent-brand) / 0.10), transparent 55%);
}
.hero-section > .max-w-7xl { position: relative; z-index: 1; }

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; border: 0 solid hsl(var(--border)); }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img, svg { display: inline-block; vertical-align: middle; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: transparent; cursor: pointer; color: inherit; }
input { font: inherit; }
table { border-collapse: collapse; }
ul { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }

/* --- Brand utilities --- */
.text-gradient,
.text-accent-brand {
  color: hsl(var(--accent-brand));
}
.bg-gradient-brand { background: hsl(var(--accent-brand)); }

/* Amplifye-inspired hero */
.hero-headline {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: hsl(var(--foreground));
}
.section-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: hsl(var(--accent-brand));
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.section-heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.pill-eyebrow {
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}
.pill-dot {
  width: 6px; height: 6px; border-radius: 9999px;
  background: hsl(var(--accent-brand));
  box-shadow: 0 0 8px hsl(var(--accent-brand) / 0.8);
}

.btn-brand {
  display: inline-flex; align-items: center; gap: .5rem;
  background: hsl(var(--accent-brand));
  color: hsl(var(--primary-foreground));
  border-radius: .6rem;
  padding: .85rem 1.4rem;
  font-size: .9rem; font-weight: 600;
  border: 1px solid hsl(var(--accent-brand));
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  text-decoration: none;
}
.btn-brand:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px hsl(var(--accent-brand) / 0.5); }

.btn-outline {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent;
  color: hsl(var(--foreground));
  border-radius: .6rem;
  padding: .85rem 1.4rem;
  font-size: .9rem; font-weight: 600;
  border: 1px solid hsl(var(--border));
  transition: background-color .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn-outline:hover { background: hsl(var(--accent)); border-color: hsl(var(--accent-brand) / 0.4); }

.btn-primary { background: hsl(var(--accent-brand)); color: hsl(var(--primary-foreground)); }

/* Hero stats */
.hero-stats {
  display: flex; gap: 3rem; margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}
.hero-stat-value {
  font-size: 2rem; font-weight: 700;
  color: hsl(var(--accent-brand));
  letter-spacing: -0.02em;
}
.hero-stat-label {
  font-size: .8rem;
  color: hsl(var(--muted-foreground));
  margin-top: .25rem;
}

/* Chat mockup */
.chat-mock {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 30px 60px -20px hsl(0 0% 0% / 0.4);
  overflow: hidden;
}
.chat-mock-header {
  display: flex; align-items: center; gap: .4rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--surface-sunken));
}
.chat-dot { width: 10px; height: 10px; border-radius: 9999px; display: inline-block; }
.chat-dot-r { background: #ff5f57; }
.chat-dot-y { background: #febc2e; }
.chat-dot-g { background: #28c840; }
.chat-mock-title { margin-left: .75rem; font-size: .8rem; color: hsl(var(--muted-foreground)); }
.chat-mock-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.chat-bubble {
  padding: .85rem 1rem;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.5;
  max-width: 85%;
}
.chat-user {
  align-self: flex-end;
  background: hsl(var(--accent-brand));
  color: hsl(var(--primary-foreground));
  border-bottom-right-radius: 4px;
}
.chat-assistant {
  align-self: flex-start;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-bottom-left-radius: 4px;
}
.chat-typing {
  align-self: flex-start; display: inline-flex; gap: 4px;
  background: hsl(var(--secondary)); padding: .8rem 1rem; border-radius: 12px;
}
.chat-typing span {
  width: 6px; height: 6px; border-radius: 9999px;
  background: hsl(var(--muted-foreground));
  animation: chat-pulse 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Feature cards — white background */
.feature-card {
  background: #ffffff;
  border: 1px solid hsl(215 16% 88%);
  color: hsl(215 30% 12%);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color .2s ease, transform .2s ease;
}
.feature-card:hover { border-color: hsl(var(--accent-brand) / 0.4); transform: translateY(-2px); }
.feature-card .text-foreground { color: hsl(215 30% 12%); }
.feature-card .text-muted-foreground { color: hsl(215 10% 42%); }
.feature-letter {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: hsl(var(--accent-brand) / 0.15);
  color: hsl(var(--accent-brand));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 1rem;
}

/* Hubs section — dark sunken container with light cards inside */
.hubs-section {
  background-color: hsl(var(--surface-sunken));
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

/* Hub cards — light surface */
.hub-card {
  background: #ffffff;
  border: 1px solid hsl(215 16% 88%);
  color: hsl(215 30% 12%);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  height: 100%;
}
.hub-card h3 { color: hsl(215 30% 12%); }
.hub-card .text-foreground { color: hsl(215 30% 12%); }
.hub-card .text-muted-foreground { color: hsl(215 10% 42%); }
.hub-card:hover {
  border-color: hsl(var(--accent-brand) / 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px hsl(var(--accent-brand) / 0.35);
}

/* Auth card — light surface */
.auth-card {
  background: #ffffff;
  border: 1px solid hsl(215 16% 88%);
  color: hsl(215 30% 12%);
  border-radius: 1rem;
  padding: 2rem;
}
.auth-card h1, .auth-card label, .auth-card .text-foreground { color: hsl(215 30% 12%); }
.auth-card .text-muted-foreground { color: hsl(215 10% 42%); }
.auth-card input,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  background: #ffffff !important;
  border: 1px solid hsl(215 16% 85%) !important;
  color: hsl(215 30% 12%) !important;
}
.auth-card input:focus,
.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  border-color: hsl(var(--accent-brand)) !important;
  box-shadow: 0 0 0 3px hsl(var(--accent-brand) / 0.2) !important;
  outline: none !important;
}
.auth-card .h-px { background-color: hsl(215 16% 88%); }
.hub-logo-wrap {
  height: 44px;
  display: flex; align-items: center;
  margin-bottom: 1rem;
}
.hub-logo-wrap .client-logo { max-height: 32px; max-width: 140px; object-fit: contain; }

/* Consent banner */
.consent-banner {
  position: fixed;
  left: 50%; bottom: 1rem;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 720px);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 25px 50px -12px hsl(0 0% 0% / 0.4);
  z-index: 100;
}
.consent-inner {
  display: flex; flex-direction: column; gap: .9rem;
}
@media (min-width: 768px) {
  .consent-inner { flex-direction: row; align-items: center; gap: 1.5rem; }
}
.consent-text strong { display: block; font-size: .9rem; margin-bottom: .25rem; color: hsl(var(--foreground)); }
.consent-text p { font-size: .8rem; color: hsl(var(--muted-foreground)); line-height: 1.5; margin: 0; }
.consent-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.consent-btn {
  border-radius: .55rem;
  padding: .55rem 1rem;
  font-size: .85rem; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.consent-btn-ghost { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.consent-btn-ghost:hover { background: hsl(var(--accent)); }
.consent-btn-primary { background: hsl(var(--accent-brand)); color: hsl(var(--primary-foreground)); }
.consent-btn-primary:hover { opacity: .9; }

.shadow-card { box-shadow: 0 1px 3px 0 rgba(0,0,0,0.04), 0 1px 2px -1px rgba(0,0,0,0.04); }
.shadow-card-hover { box-shadow: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 6px -2px rgba(0,0,0,0.04); }
.shadow-elevated { box-shadow: 0 10px 30px -8px rgba(0,0,0,0.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Layout --- */
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-md { max-width: 28rem; }
.max-w-\[240px\] { max-width: 240px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.w-fit { width: fit-content; }
.w-56 { width: 14rem; }
.w-8 { width: 2rem; }
.w-4 { width: 1rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-14 { height: 3.5rem; }
.h-36 { height: 9rem; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.hidden { display: none; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* gaps */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* spacing */
.p-1 { padding: 0.25rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-4 { padding-right: 1rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-1\.5 { padding-top: 0.375rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-1 { margin-left: 0.25rem; }

.space-y-1\.5 > * + * { margin-top: 0.375rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-12 > * + * { margin-top: 3rem; }

/* position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.top-3 { top: 0.75rem; }
.top-1\/2 { top: 50%; }
.left-3 { left: 0.75rem; }
.right-3 { right: 0.75rem; }
.-translate-y-1\/2 { transform: translateY(-50%); }
.z-40 { z-index: 40; }
.overflow-hidden { overflow: hidden; }

/* borders & radius */
.border { border-width: 1px; border-style: solid; border-color: hsl(var(--border)); }
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: hsl(var(--border)); }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: hsl(var(--border)); }
.border-y { border-top-width: 1px; border-bottom-width: 1px; border-style: solid; border-color: hsl(var(--border)); }
.border-border { border-color: hsl(var(--border)); }
.last\:border-0:last-child { border-width: 0; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* colors - bg */
.bg-card { background-color: #ffffff; color: hsl(215 30% 12%); border-color: hsl(215 16% 88%); }
.bg-background { background-color: hsl(var(--background)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-secondary\/50 { background-color: #ffffff; color: hsl(215 30% 12%); }

/* Padding above grids inside hubs/features sections */
.hubs-section .grid,
.features-section .grid { padding-top: 2.5rem; }
.bg-accent { background-color: hsl(var(--accent)); }
.bg-accent\/50 { background-color: hsl(var(--accent) / 0.5); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-tag-bg { background-color: hsl(var(--tag-bg)); }
.bg-white\/80 { background-color: rgba(255,255,255,0.8); }
.bg-white\/20 { background-color: rgba(255,255,255,0.2); }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* colors - text */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-tag-text, .bg-card .text-tag-text { color: hsl(var(--tag-text)) !important; }
.text-success { color: hsl(var(--success)); }
.text-white { color: #fff; }
.text-emerald-600 { color: #059669; }
.text-violet-600 { color: #7c3aed; }
.text-amber-600 { color: #d97706; }
.text-white\/80 { color: rgba(255,255,255,0.8); }
.placeholder\:text-muted-foreground::placeholder { color: hsl(var(--muted-foreground)); }

/* font sizes */
.text-\[10px\] { font-size: 10px; line-height: 14px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-none { line-height: 1; }
.leading-snug { line-height: 1.375; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-underline { text-decoration: none; }
.hover\:underline:hover { text-decoration: underline; }

/* object */
.object-contain { object-fit: contain; }

/* gradient backgrounds for cards */
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-from), var(--tw-to)); }
.from-blue-500.to-blue-600   { --tw-from: #3b82f6; --tw-to: #2563eb; }
.from-emerald-500.to-emerald-600 { --tw-from: #10b981; --tw-to: #059669; }
.from-violet-500.to-violet-600 { --tw-from: #8b5cf6; --tw-to: #7c3aed; }
.from-amber-500.to-amber-600 { --tw-from: #f59e0b; --tw-to: #d97706; }
.from-rose-500.to-rose-600 { --tw-from: #f43f5e; --tw-to: #e11d48; }
.from-sky-500.to-sky-600 { --tw-from: #0ea5e9; --tw-to: #0284c7; }
.from-indigo-500.to-indigo-600 { --tw-from: #6366f1; --tw-to: #4f46e5; }
.from-gray-500.to-gray-600 { --tw-from: #6b7280; --tw-to: #4b5563; }

/* transitions */
.transition-all { transition: all 200ms ease; }
.transition-colors { transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease; }
.transition-opacity { transition: opacity 200ms ease; }
.duration-200 { transition-duration: 200ms; }

/* hover/group */
.hover\:bg-accent:hover { background-color: hsl(var(--accent)); }
.hover\:bg-accent\/50:hover { background-color: hsl(var(--accent) / 0.5); }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:text-primary:hover { color: hsl(var(--primary)); }
.hover\:opacity-90:hover { opacity: 0.9; }
.hover\:-translate-y-0\.5:hover { transform: translateY(-2px); }
.hover\:shadow-card-hover:hover { box-shadow: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 6px -2px rgba(0,0,0,0.04); }

.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:text-primary { color: hsl(var(--primary)); }
.opacity-0 { opacity: 0; }

/* focus */
.outline-none { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4); }
.focus\:ring-ring:focus { box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4); }

/* inputs */
input[type="text"], input[type="search"], input:not([type]) {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

/* responsive */
@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .md\:text-5xl { font-size: 3rem; line-height: 1; }
}
@media (min-width: 1024px) {
  .lg\:block { display: block; }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* --- Additional utilities for redesigned templates --- */
.pt-20 { padding-top: 5rem; }
.pb-24 { padding-bottom: 6rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.gap-12 { gap: 3rem; }
.max-w-6xl { max-width: 72rem; }
.flex-col { flex-direction: column; }

@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* Hub page hero overrides (scoped to hub.php header) */
header.bg-secondary\/50 h1 { color: hsl(215 30% 12%) !important; }
header.bg-secondary\/50 input[name="search"] {
  background: #ffffff !important;
  color: hsl(215 30% 12%) !important;
  border: 1px solid hsl(215 16% 85%) !important;
}
header.bg-secondary\/50 input[name="search"]::placeholder { color: hsl(215 16% 45%) !important; }

/* Ensure text on white cards is dark (cards are forced white globally) */
.bg-card .text-foreground,
.bg-card h1, .bg-card h2, .bg-card h3, .bg-card p, .bg-card li, .bg-card span,
.bg-secondary\/50 .text-foreground,
.bg-secondary\/50 h1, .bg-secondary\/50 h2, .bg-secondary\/50 h3, .bg-secondary\/50 p, .bg-secondary\/50 li {
  color: hsl(215 30% 12%) !important;
}
.bg-card .text-muted-foreground,
.bg-secondary\/50 .text-muted-foreground {
  color: hsl(215 16% 40%) !important;
}

/* Legal pages (privacy policy, terms & conditions) */
.legal-content { color: hsl(215 30% 12%); line-height: 1.6; }
.legal-content h1, .legal-content h2, .legal-content h3 { color: hsl(215 30% 12%); }
.legal-content p { margin: 0.75rem 0; color: hsl(215 30% 20%); }
.legal-content ol { list-style: decimal; padding-left: 1.5rem; margin: 0.5rem 0; }
.legal-content ol ol { list-style: lower-alpha; }
.legal-content a { color: hsl(217 91% 45%); text-decoration: underline; }
.legal-content a:hover { color: hsl(217 91% 35%); }
.legal-content ol ol ol { list-style: lower-roman; }
.legal-content > ol > li { margin-top: 1rem; }
.legal-content li { margin: 0.4rem 0; color: hsl(215 30% 20%); }
.legal-content strong { color: hsl(215 30% 12%); }
.legal-content table { background: #fff; color: hsl(215 30% 12%); }
.legal-content table th { background: hsl(215 16% 95%); color: hsl(215 30% 12%); }

/* Legal table */
.legal-content .legal-table { width: 100%; border-collapse: collapse; }
.legal-content .legal-table th, .legal-content .legal-table td { border: 1px solid hsl(215 16% 80%); padding: 0.5rem 0.75rem; text-align: left; color: hsl(215 30% 12%); }
.legal-content .legal-table th { background: hsl(215 30% 95%); font-weight: 600; }

/* Topic cards */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 640px) { .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .topics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .topics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.topic-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: #ffffff;
  border: 1px solid hsl(215 16% 88%);
  border-radius: 14px;
  padding: 1rem 1.125rem;
  color: hsl(215 30% 12%);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
  overflow: hidden;
}
.topic-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(var(--accent-brand) / 0.08), transparent 60%);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.topic-card:hover {
  border-color: hsl(var(--accent-brand) / 0.55);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px hsl(var(--accent-brand) / 0.45);
}
.topic-card:hover::before { opacity: 1; }

.topic-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--accent-brand) / 0.12);
  color: hsl(var(--accent-brand));
  transition: background .2s ease, transform .2s ease;
}
.topic-card:hover .topic-icon {
  background: hsl(var(--accent-brand) / 0.18);
  transform: scale(1.05);
}
.topic-icon svg { width: 22px; height: 22px; }

.topic-body { flex: 1; min-width: 0; }
.topic-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(215 30% 12%);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}
.topic-meta {
  font-size: 0.75rem;
  color: hsl(215 10% 42%);
}
.topic-arrow {
  flex: none;
  color: hsl(var(--accent-brand));
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s ease, transform .2s ease;
  font-size: 1.1rem;
  line-height: 1;
}
.topic-card:hover .topic-arrow { opacity: 1; transform: translateX(0); }

/* Form fields inside white cards (admin upload form, etc.) — cards are forced white globally,
   so inputs must use a white background and dark text regardless of theme. */
.bg-card input[type="text"],
.bg-card input[type="email"],
.bg-card input[type="password"],
.bg-card input[type="number"],
.bg-card input[type="date"],
.bg-card input[type="search"],
.bg-card input[type="url"],
.bg-card input[type="file"],
.bg-card select,
.bg-card textarea {
  background-color: #ffffff !important;
  color: hsl(215 30% 12%) !important;
  border-color: hsl(215 16% 85%) !important;
}
.bg-card input::placeholder,
.bg-card textarea::placeholder { color: hsl(215 16% 45%) !important; }
.bg-card select option { background-color: #ffffff !important; color: hsl(215 30% 12%) !important; }
