/**
 * site-palette.css — Global STYLE.md tokens + shared components
 * Loaded site-wide after theme style.css.
 */

/* ============================================
   Tokens (STYLE.md + app UI slate scale)
   ============================================ */

:root {
  /* Brand colors */
  --brand-primary: var(--blue-1, #29a7e6);
  --brand-primary-dark: var(--blue-2, #0473a9);
  --brand-primary-bg: rgba(41, 167, 230, 0.08);
  --brand-cta: #f5921e;
  --brand-highlight: #faab4d;
  --brand-highlight-bg: rgba(250, 171, 77, 0.22);

  /* Neutrals (slate scale) */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic aliases */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;
  --surface-base: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f1f5f9;
  --surface-dark: #1e293b;
  --border-light: #e2e8f0;
  --border-mid: #cbd5e1;
  --border-muted: #94a3b8;

  /* Common dark-surface text helpers (used in theme already) */
  --text-on-dark: rgba(226, 232, 240, 0.92);
  --text-on-dark-muted: rgba(226, 232, 240, 0.75);

  /* Spacing & radius */
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadow scale */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Semantic / status */
  --success: #10b981;

  /* Typography */
  --tbox-font-body: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tbox-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ============================================
   Typography (site-wide)
   ============================================ */

/* Override legacy theme-wide `* { font-family: Hind; }` without breaking icon fonts. */
#header,
#content,
#footer,
#footer-copyright {
  font-family: var(--tbox-font-body);
}

#header *,
#content *,
#footer *,
#footer-copyright * {
  font-family: inherit;
}

code,
pre,
kbd,
samp,
.tbox-mono {
  font-family: var(--tbox-font-mono);
}

/* Header/footer overrides where the legacy theme hard-codes Varela Round / Hind. */
#header .phone,
#header .header-chat-btn,
#header ul.menu a,
#header ul.menu button,
#header ul.menu > li {
  font-family: var(--tbox-font-body);
}

/* ============================================
   Base colors (site-wide)
   ============================================ */

body {
  color: var(--text-primary);
}

/* Theme uses these for body copy via `#content p` / `#content div`. */
#content p,
#content div {
  color: var(--text-secondary);
}

/* Ensure hero copy remains readable on dark hero backgrounds (including legacy hero sections). */
#hero-section,
#hero-section div,
#hero-section span,
#hero-section li,
#hero-section p,
#hero-section h1,
#hero-section h2,
#hero-section h3,
#hero-section h4 {
  color: var(--text-on-dark);
}

/* Keep existing theme behavior: hero H1 is stronger. */
#hero-section h1 {
  color: #ffffff;
}

/* Hero V2: restore ink text inside the white feature cards. */
#hero-section.hero-v2 .feature-card {
  color: var(--text-primary);
}

section > h2,
.title h2,
#rdp-plans h2 {
  color: var(--text-primary);
}

/* ============================================
   Buttons (global component + legacy aliases)
   ============================================ */

.tbox-btn,
a.btn,
a.btn-lg,
button.btn,
button.btn-lg {
  display: inline-block;
  background: var(--brand-cta);
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 18px rgba(245, 146, 30, 0.22);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.tbox-btn:hover,
a.btn:hover,
a.btn-lg:hover,
button.btn:hover,
button.btn-lg:hover {
  background: var(--brand-highlight);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(245, 146, 30, 0.25);
  color: #ffffff;
}

.tbox-btn:focus-visible,
a.btn:focus-visible,
a.btn-lg:focus-visible,
button.btn:focus-visible,
button.btn-lg:focus-visible {
  outline: 3px solid rgba(41, 167, 230, 0.35);
  outline-offset: 3px;
}

.tbox-btn-secondary,
.tbox-btn.tbox-btn-secondary,
.btn-primary-cta,
a.btn.c2,
a.btn-lg.c2 {
  background: var(--brand-primary-dark);
  box-shadow: 0 6px 18px rgba(4, 115, 169, 0.18);
}

.tbox-btn-secondary:hover,
.tbox-btn.tbox-btn-secondary:hover,
.btn-primary-cta:hover,
a.btn.c2:hover,
a.btn-lg.c2:hover {
  background: var(--brand-primary);
  box-shadow: 0 10px 22px rgba(4, 115, 169, 0.2);
}

/* Preserve the legacy `.btn.blue` intent while aligning to STYLE.md tokens. */
a.btn.blue,
button.btn.blue,
button.btn-lg.blue {
  background: var(--brand-primary);
}

a.btn.blue:hover,
button.btn.blue:hover,
button.btn-lg.blue:hover {
  background: var(--brand-primary-dark);
}

/* Homepage product-card CTAs: align legacy green card CTA to brand CTA orange. */
#product-cards > div:last-child a.btn {
  background-color: var(--brand-cta);
}

#product-cards > div:last-child a.btn:hover {
  background-color: var(--brand-highlight);
}

/* Ensure product-card typography uses Rubik (theme hardcodes Hind/Open Sans). */
#product-cards p,
#product-cards li,
#product-cards a.btn {
  font-family: var(--tbox-font-body);
}

/* ============================================
   Cards + sections (new components)
   ============================================ */

.tbox-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tbox-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tbox-section {
  padding: 4rem 0;
}

.tbox-section--alt {
  background: var(--surface-subtle);
}

.tbox-section--dark {
  background: linear-gradient(135deg, var(--brand-primary-dark) 0%, #035b85 100%);
  color: #ffffff;
}

.tbox-offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .tbox-offer-grid {
    grid-template-columns: 1fr;
  }
}

.tbox-offer-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.tbox-offer-list li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tbox-offer-list li::before {
  content: "✓";
  color: var(--brand-primary-dark);
  font-weight: 800;
  line-height: 1.4;
}

.tbox-offer-code {
  margin-top: 1rem;
  color: var(--text-primary);
}

.tbox-offer-cta {
  margin-top: 1rem;
}

.tbox-rounded {
  border-radius: var(--radius-md);
}

.tbox-muted {
  color: var(--text-muted);
}

.tbox-text-center {
  text-align: center;
}

.tbox-list-none {
  list-style: none;
}

.tbox-text-danger {
  color: #ef4444;
}

#imunify360-pricing h5 {
  margin-top: 2rem;
}

.tbox-bg-success {
  background: var(--success, #10b981);
  color: #ffffff;
}

/* ============================================
   Hero V2 (global component)
   ============================================ */

#hero-section.hero-v2 {
  --tbox-hero-cta-height: 52px;
  --tbox-hero-cta-radius: 12px;

  background: linear-gradient(135deg, var(--brand-primary-dark) 0%, #045a84 50%, var(--brand-primary-dark) 100%);
  background-size: 200% 200%;
  animation: heroGradientShift 8s ease infinite;
  position: relative;
  overflow: hidden;
  padding: 60px 40px 50px;
}

@keyframes heroGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#hero-section.hero-v2::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(41, 167, 230, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(41, 167, 230, 0.1) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2329A7E6' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

#hero-section.hero-v2 .hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-v2 .hero-header {
  text-align: center;
  margin-bottom: 40px;
}

#hero-section.hero-v2 .hero-header h1 {
  font-size: 2.75rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  padding: 0;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

#hero-section.hero-v2 .hero-header .tagline {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 8px;
}

#hero-section.hero-v2 .hero-header .subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}

.hero-v2 .features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.hero-v2 .feature-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hero-v2 .feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hero-v2 .feature-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-v2 .feature-icon svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

#hero-section.hero-v2 .feature-text {
  flex: 1;
  text-align: left;
}

#hero-section.hero-v2 .feature-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  margin-top: 0;
  padding: 0;
  line-height: 1.2;
  text-align: left;
}

#hero-section.hero-v2 .feature-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
  margin: 0;
}

#hero-section.hero-v2 .trust-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

#hero-section.hero-v2 .trust-divider {
  color: rgba(255, 255, 255, 0.3);
}

#hero-section.hero-v2 .social-proof {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 32px;
  opacity: 0.9;
}

.hero-v2 .cta-zone {
  text-align: center;
}

.hero-v2 .cta-headline {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 10px;
}

.hero-v2 .cta-widget-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-v2 .cta-widget-row .jlc-wrapper {
  max-width: 340px;
  margin: 0;
  font-family: var(--tbox-font-body);
}

.hero-v2 .cta-widget-row .jlc-app {
  max-width: 340px;
  margin: 0;
  font-family: var(--tbox-font-body);
}

/* Hero CTA sizing: keep the JLC button and the expanded email form consistent. */
#hero-section.hero-v2 .jlc-wrapper .jlc-cover {
  height: var(--tbox-hero-cta-height);
  border-radius: var(--tbox-hero-cta-radius);
  overflow: hidden;
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover {
  height: var(--tbox-hero-cta-height);
  border-radius: var(--tbox-hero-cta-radius);
  overflow: hidden;
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-btn {
  height: var(--tbox-hero-cta-height);
  line-height: var(--tbox-hero-cta-height);
  border-radius: var(--tbox-hero-cta-radius);
  font-size: 0.95rem !important;
  font-weight: 700;
  padding: 0 22px;
  background-color: var(--brand-cta);
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-btn {
  height: var(--tbox-hero-cta-height);
  line-height: var(--tbox-hero-cta-height);
  border-radius: var(--tbox-hero-cta-radius);
  font-size: 0.95rem !important;
  font-weight: 700;
  padding: 0 22px;
  background-color: var(--brand-cta);
  border: none;
  cursor: pointer;
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-btn:hover,
#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-btn:focus-visible {
  background-color: var(--brand-highlight);
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-btn:hover,
#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-btn:focus-visible {
  background-color: var(--brand-highlight);
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-form .jlc-input-wrapper {
  border-radius: var(--tbox-hero-cta-radius);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background-color: rgba(255, 255, 255, 0.95);
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-form {
  border-radius: var(--tbox-hero-cta-radius);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background-color: rgba(255, 255, 255, 0.95);
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-input,
#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-sbmt {
  height: var(--tbox-hero-cta-height);
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-input,
#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-sbmt {
  height: var(--tbox-hero-cta-height);
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-sbmt {
  width: var(--tbox-hero-cta-height);
  background-color: var(--brand-primary-dark);
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-sbmt {
  width: var(--tbox-hero-cta-height);
  background-color: var(--brand-primary-dark);
  border: none;
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-form.jlc-form__valid .jlc-sbmt {
  background-color: var(--brand-cta);
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-form.jlc-form__valid .jlc-sbmt {
  background-color: var(--brand-cta);
}

#hero-section.hero-v2 .jlc-wrapper .jlc-cover .jlc-input {
  width: calc(100% - var(--tbox-hero-cta-height));
  font-size: 0.95rem;
}

#hero-section.hero-v2 .jlc-app .jlc-app-cover .jlc-input {
  width: calc(100% - var(--tbox-hero-cta-height));
  font-size: 0.95rem;
  border: none;
}

.hero-v2 .cta-subtext {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

@media (max-width: 700px) {
  .hero-v2 .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  #hero-section.hero-v2 {
    padding: 40px 24px;
  }

  #hero-section.hero-v2 .hero-header h1 {
    font-size: 2rem;
  }

  #hero-section.hero-v2 .trust-bar {
    flex-direction: column;
    gap: 12px;
  }

  #hero-section.hero-v2 .trust-divider {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hero-section.hero-v2 {
    animation: none !important;
  }
}

/* ============================================
   Inline style guardrails (transitional)
   ============================================ */

/* Inline color styles override CSS. Bring common legacy inline values back onto the STYLE.md palette. */
[style*="color: #29A7E6"],
[style*="color:#29A7E6"],
[style*="color: #29a7e6"],
[style*="color:#29a7e6"] {
  color: var(--brand-primary) !important;
}

[style*="background: #00C248"],
[style*="background:#00C248"],
[style*="background: #00c248"],
[style*="background:#00c248"],
[style*="background-color: #00C248"],
[style*="background-color:#00C248"],
[style*="background-color: #00c248"],
[style*="background-color:#00c248"] {
  background: var(--brand-cta) !important;
  background-color: var(--brand-cta) !important;
}

[style*="font-family: Hind"],
[style*="font-family:Hind"] {
  font-family: var(--tbox-font-body) !important;
}
