/* ============================================================
   Kit C — Component Library (depends on tokens.css)
   Hybrid: Kit A structure + Kit B fonts/shadows + corrected colors
   ============================================================ */

/* ---------- BUTTON ---------- */
.btn {
  --btn-h: 44px;
  --btn-px: var(--space-5);
  --btn-fs: var(--fs-sm);
  --btn-radius: var(--radius-md);

  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--btn-h); padding-inline: var(--btn-px);
  font-family: inherit; font-size: var(--btn-fs); font-weight: var(--fw-semibold);
  line-height: 1; letter-spacing: -0.01em;
  border: 1px solid transparent; border-radius: var(--btn-radius);
  background: transparent; color: var(--text-primary);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
}
[dir="rtl"] .btn { letter-spacing: 0; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.btn-sm { --btn-h: 36px; --btn-px: var(--space-4); --btn-fs: var(--fs-xs); --btn-radius: var(--radius-sm); }
.btn-lg { --btn-h: 52px; --btn-px: var(--space-6); --btn-fs: var(--fs-base); }
.btn-xl { --btn-h: 60px; --btn-px: var(--space-7); --btn-fs: var(--fs-lg); --btn-radius: var(--radius-lg); }

.btn-primary {
  background: var(--brand-primary); color: var(--text-on-brand);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: var(--brand-primary-hover); box-shadow: var(--shadow-brand); transform: translateY(-1px); }

.btn-secondary { background: var(--surface-1); color: var(--text-primary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-outline { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline:hover { background: var(--brand-primary-soft); }

.btn-accent { background: var(--brand-accent); color: var(--text-on-brand); }
.btn-accent:hover { background: var(--brand-accent-hover); }

.btn-inverse { background: var(--surface-inverse); color: var(--text-on-inverse); }
.btn-inverse:hover { background: var(--brand-secondary-hover); transform: translateY(-1px); }

.btn-forecast {
  background: var(--forecast); color: var(--fm-navy-900);
  box-shadow: 0 8px 24px -6px rgba(154, 205, 50, 0.45);
}
.btn-forecast:hover { background: var(--forecast-strong); transform: translateY(-1px); }

/* ---------- CTA HOVER · Green-Arrow takeover ----------
   The yellow-green Green-Arrow is the brand's signature forecast color
   (the single most probable price path drawn on every chart). On hover,
   every action button adopts it — so the most important brand color earns
   real presence across the whole UI. Dark navy text keeps AA contrast. */
.btn:hover {
  background: var(--forecast);
  color: var(--fm-navy-900) !important;   /* !important beats inline color on CTA-band buttons */
  border-color: var(--forecast);
  box-shadow: 0 10px 28px -8px rgba(154, 205, 50, 0.45);
  transform: translateY(-1px);
}

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: 22px; padding-inline: var(--space-2);
  font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text-secondary);
}
[dir="rtl"] .badge { text-transform: none; letter-spacing: 0; font-weight: var(--fw-bold); }
.badge-brand    { background: var(--brand-primary-soft); color: var(--brand-primary); }
.badge-bullish  { background: var(--bullish-soft); color: var(--bullish); }
.badge-bearish  { background: var(--bearish-soft); color: var(--bearish); }
.badge-forecast { background: var(--forecast-soft); color: var(--forecast-strong); }
.badge-success  { background: rgba(26,151,106,0.12); color: var(--state-success); }
.badge-warning  { background: var(--neutral-signal-soft); color: var(--neutral-signal); }
.badge-outline  { background: transparent; border-color: var(--border-default); color: var(--text-secondary); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; display: inline-block; }

/* ---------- CARD (Kit B hover params) ---------- */
.card {
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  transition: all var(--dur-base) var(--ease-out);
}
.card:hover { border-color: var(--border-default); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-flat { box-shadow: none; }
.card-elev { box-shadow: var(--shadow-md); }
.card-soft { background: var(--surface-1); }
.card-glow {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-glow);
}
.card-brand {
  background: var(--grad-brand);
  border: none; color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
}
.card-brand h1, .card-brand h2, .card-brand h3, .card-brand h4, .card-brand p { color: inherit; }

/* ---------- QUAD-AI CARDS (heritage product section from forecastcity.com) ---------- */
.quad-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .quad-grid { grid-template-columns: 1fr; } }

.quad-card {
  position: relative;
  padding: var(--space-9) var(--space-7) var(--space-7);
  border-radius: var(--radius-xl);
  color: #FFFFFF;
  display: flex; flex-direction: column; gap: var(--space-4);
  min-height: 480px;
  box-shadow: var(--shadow-navy);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.quad-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-navy), var(--shadow-brand); }
.quad-card.q1 { background: var(--grad-quad-1); }
.quad-card.q2 { background: var(--grad-quad-2); }
.quad-card.q3 { background: var(--grad-quad-3); }
.quad-card.q4 { background: linear-gradient(180deg, var(--fm-navy-700) 0%, var(--fm-blue-700) 100%); }

.quad-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.10);
  color: var(--forecast-on-dark);
  margin-inline: auto;
}
.quad-title {
  font-size: var(--fs-3xl); font-weight: var(--fw-bold);
  text-align: center; color: #FFFFFF;
  letter-spacing: var(--tracking-display);
  text-shadow: var(--text-shadow-on-navy);
  margin-block: var(--space-2);
}
[dir="rtl"] .quad-title { letter-spacing: 0; }
.quad-subtitle {
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  text-align: center; color: var(--forecast-on-dark);
  font-style: italic;
  margin-bottom: var(--space-5);
}
.quad-body { font-size: var(--fs-sm); color: #FFFFFF; line-height: var(--lh-normal); }
[dir="rtl"] .quad-body { line-height: var(--lh-rtl-normal); }
.quad-body p { color: #FFFFFF; }                /* override global p reset */
.quad-body strong { color: #FFFFFF; }
.quad-question {
  margin-top: auto; padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.18);
  font-size: var(--fs-sm); color: #FFFFFF; font-style: italic;
}
.quad-question p { color: #FFFFFF; }
.quad-question strong { color: var(--forecast-on-dark); font-style: normal; display: block; margin-top: 4px; font-weight: var(--fw-bold); }
/* Anything wrapped in quad-card defaults to white text — defends against future global p/h overrides */
.quad-card, .quad-card p, .quad-card span { color: #FFFFFF; }
.quad-card .quad-subtitle, .quad-card .quad-question strong { color: var(--forecast-on-dark); }

/* ---------- INPUT ---------- */
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  font-family: inherit; font-size: var(--fs-sm); color: var(--text-primary);
  background: var(--surface-canvas);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-focus); box-shadow: var(--shadow-focus-ring); outline: none; }
.textarea { min-height: 96px; resize: vertical; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-glass); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--nav-height);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.nav-brand { display: flex; align-items: center; gap: var(--space-3); font-weight: var(--fw-bold); color: var(--text-primary); font-size: var(--fs-base); letter-spacing: var(--tracking-tight); }
[dir="rtl"] .nav-brand { letter-spacing: 0; }
.nav-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--grad-brand); color: white; font-weight: var(--fw-black); font-size: 14px; letter-spacing: -0.04em;
  box-shadow: var(--shadow-glow);
}
.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-link { color: var(--text-secondary); font-size: var(--fs-sm); font-weight: var(--fw-medium); transition: color var(--dur-fast); }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
@media (max-width: 900px) { .nav-links { display: none; } }

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(var(--space-11), 10vw, var(--space-13)) clamp(var(--space-10), 8vw, var(--space-12));
  background: var(--grad-hero), var(--surface-canvas);
}
.hero-title {
  font-size: var(--fs-5xl); font-weight: var(--fw-black); letter-spacing: var(--tracking-display);
  line-height: 1.05; max-width: 20ch; text-wrap: balance;
  text-shadow: var(--text-shadow-display);   /* heritage display drop-shadow */
}
[dir="rtl"] .hero-title { letter-spacing: 0; line-height: 1.25; }
.hero-subtitle {
  margin-top: var(--space-5); font-size: var(--fs-lg); color: var(--text-secondary);
  max-width: 56ch; text-wrap: pretty; line-height: var(--lh-normal);
}
[dir="rtl"] .hero-subtitle { line-height: var(--lh-rtl-normal); }
.hero-actions { margin-top: var(--space-7); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-meta    { margin-top: var(--space-6); display: flex; gap: var(--space-5); flex-wrap: wrap; color: var(--text-tertiary); font-size: var(--fs-sm); }
.hero-meta-item { display: flex; align-items: center; gap: var(--space-2); }
.hero-meta-item svg { color: var(--bullish); }    /* now Royal Blue */

/* ---------- BENTO / FEATURE GRID ---------- */
.bento {
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(180px, auto);
}
.bento > * { grid-column: span 12; }
@media (min-width: 768px) {
  .bento > .col-6 { grid-column: span 6; }
  .bento > .col-4 { grid-column: span 4; }
  .bento > .col-8 { grid-column: span 8; }
  .bento > .col-3 { grid-column: span 3; }
  .bento > .col-9 { grid-column: span 9; }
  .bento > .row-2 { grid-row: span 2; }
}

/* .feature — Kit B exact: surface-1 bg, all-transition, hover shadow-lg + translateY(-3px) */
.feature {
  position: relative; padding: var(--space-7); border-radius: var(--radius-xl);
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: var(--space-4); overflow: hidden;
  transition: all var(--dur-base);
}
.feature:hover { border-color: var(--border-default); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-primary-soft); color: var(--brand-primary);
}
.feature-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); color: var(--text-primary); letter-spacing: var(--tracking-tight); }
[dir="rtl"] .feature-title { letter-spacing: 0; }
.feature-desc  { font-size: var(--fs-sm); color: var(--text-secondary); line-height: var(--lh-normal); }
[dir="rtl"] .feature-desc { line-height: var(--lh-rtl-normal); }

.feature-soft     { background: var(--surface-2); }
/* Kit B exact glow: subtle blue 1px border + soft brand-colored radial glow */
.feature-glow     { background: var(--surface-1); box-shadow: var(--shadow-glow); }
.feature-inverse  { background: var(--surface-inverse); color: var(--text-on-inverse); border-color: transparent; }
.feature-inverse .feature-title { color: var(--text-on-inverse); }
.feature-inverse .feature-desc { color: rgba(255,255,255,0.78); }
.feature-inverse .feature-icon { background: rgba(255,255,255,0.10); color: white; }
.feature-brand {
  background: var(--grad-brand); color: var(--text-on-brand); border: none;
  box-shadow: var(--shadow-brand);
}
.feature-brand .feature-title, .feature-brand .feature-desc { color: inherit; }
.feature-brand .feature-desc { color: rgba(255,255,255,0.86); }
.feature-brand .feature-icon { background: rgba(255,255,255,0.18); color: white; }

/* ---------- PRICING ---------- */
.pricing-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}
.price-card {
  padding: var(--space-7); border-radius: var(--radius-xl);
  background: var(--surface-canvas); border: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: var(--space-5);
}
.price-card.featured { border-color: var(--brand-primary); box-shadow: var(--shadow-brand); position: relative; }
.price-card.featured::after {
  content: "Most Popular"; position: absolute; top: -10px; inset-inline-end: var(--space-5);
  background: var(--brand-primary); color: var(--text-on-brand);
  padding: 2px var(--space-3); border-radius: var(--radius-full); font-size: 10px; font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
}
[dir="rtl"] .price-card.featured::after { content: "محبوب‌ترین"; text-transform: none; letter-spacing: 0; }
.price-name  { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-secondary); letter-spacing: var(--tracking-wide); text-transform: uppercase; }
[dir="rtl"] .price-name { text-transform: none; letter-spacing: 0; font-weight: var(--fw-bold); }
.price-value { font-size: var(--fs-4xl); font-weight: var(--fw-bold); color: var(--text-primary); letter-spacing: var(--tracking-tight); line-height: 1; font-variant-numeric: tabular-nums; }
.price-value small { font-size: var(--fs-base); color: var(--text-tertiary); font-weight: var(--fw-regular); margin-inline-start: var(--space-2); }
.price-list  { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.price-list li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.price-list li::before {
  content: ""; flex: 0 0 18px; height: 18px; margin-top: 2px;
  background-color: var(--bullish);   /* now Royal Blue */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}

/* ---------- TESTIMONIAL ---------- */
.testimonial {
  padding: var(--space-7); border-radius: var(--radius-xl);
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: var(--space-5);
}
.testimonial-quote { font-size: var(--fs-lg); line-height: var(--lh-normal); color: var(--text-primary); }
[dir="rtl"] .testimonial-quote { line-height: var(--lh-rtl-normal); }
.testimonial-meta { display: flex; align-items: center; gap: var(--space-3); margin-top: auto; }
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--grad-brand); display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: var(--fw-bold); font-size: var(--fs-sm);
}
.testimonial-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-primary); }
.testimonial-title { font-size: var(--fs-xs); color: var(--text-tertiary); }

/* ---------- LOGO STRIP ---------- */
.logo-strip { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-7); opacity: 0.7; }
.logo-strip-item { font-family: var(--font-display); font-weight: var(--fw-bold); color: var(--text-tertiary); font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); }

/* ---------- STATS ---------- */
.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat-value { font-size: var(--fs-4xl); font-weight: var(--fw-bold); color: var(--text-primary); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; line-height: 1; }
.stat-label { font-size: var(--fs-sm); color: var(--text-tertiary); }
.stat-delta { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--bullish); display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.neg { color: var(--bearish); }
.stat-delta.forecast { color: var(--forecast-strong); }

/* ---------- CHART MOCK ---------- */
.chart-mock {
  width: 100%; height: 220px; border-radius: var(--radius-lg);
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  position: relative; overflow: hidden;
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--border-subtle); }
.faq details { padding: var(--space-5) 0; border-bottom: 1px solid var(--border-subtle); }
.faq summary { cursor: pointer; list-style: none; font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: var(--fs-2xl); color: var(--text-tertiary); transition: transform var(--dur-fast); font-weight: var(--fw-regular); }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--brand-primary); }
.faq-body { margin-top: var(--space-3); color: var(--text-secondary); font-size: var(--fs-base); line-height: var(--lh-normal); }
[dir="rtl"] .faq-body { line-height: var(--lh-rtl-normal); }

/* ---------- FOOTER ---------- */
.footer { background: var(--surface-1); border-top: 1px solid var(--border-subtle); padding-block: var(--space-10) var(--space-7); }
.footer-grid { display: grid; gap: var(--space-7); grid-template-columns: 2fr repeat(3, 1fr); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h6 { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--space-4); }
[dir="rtl"] .footer-col h6 { text-transform: none; letter-spacing: 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-links a { color: var(--text-secondary); font-size: var(--fs-sm); }
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom { margin-top: var(--space-9); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); color: var(--text-tertiary); font-size: var(--fs-xs); }

/* ---------- THEME TOGGLE ---------- */
.theme-toggle { width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--surface-canvas); display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; transition: all var(--dur-fast); }
.theme-toggle:hover { background: var(--surface-2); color: var(--text-primary); }

/* ---------- SECTION HEAD ---------- */
.section-head { text-align: center; max-width: 760px; margin-inline: auto; margin-bottom: var(--space-9); }
.section-head h2 { font-size: var(--fs-4xl); margin-bottom: var(--space-3); }
.section-head p { font-size: var(--fs-lg); color: var(--text-secondary); }

/* Heritage-style heading for big section titles (Quad-AI Architecture treatment) */
.heading-heritage {
  font-size: clamp(2.5rem, 1.8rem + 3.5vw, 4.5rem);
  font-weight: var(--fw-black);
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  text-shadow: var(--text-shadow-display);
  text-align: center;
  text-wrap: balance;
  max-width: 18ch;
  margin-inline: auto;
}
[dir="rtl"] .heading-heritage { letter-spacing: 0; line-height: 1.25; }

/* ---------- ANIMATIONS ---------- */
@keyframes fm-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.anim-fade-up { animation: fm-fade-up 700ms var(--ease-out) both; }
.anim-delay-1 { animation-delay: 80ms; } .anim-delay-2 { animation-delay: 160ms; } .anim-delay-3 { animation-delay: 240ms; } .anim-delay-4 { animation-delay: 320ms; }

@keyframes fm-pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(65,105,225,0.45); } 100% { box-shadow: 0 0 0 14px rgba(65,105,225,0); } }
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--bullish); display: inline-block; }
.pulse-dot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: fm-pulse-ring 1.6s ease-out infinite; }
