/* ============================================================
   Trixo Market — Components
   buttons, cards, badges, tabs, accordion, carousel, ticker,
   tables, forms, stats, modal
   ============================================================ */

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.8rem 1.5rem;
  min-height: 46px;
  font-weight: var(--fw-semibold);
  font-size: 0.95rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 6px 18px rgba(238,49,66,0.28); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--sh-accent); transform: translateY(-2px); }
.btn--secondary { border-color: var(--border-strong); color: #fff; background: rgba(255,255,255,0.02); }
.btn--secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn--ghost { color: var(--text-muted); padding-inline: 0.9rem; }
.btn--ghost:hover { color: #fff; }
.btn--lg { padding: 1rem 1.9rem; min-height: 54px; font-size: 1.05rem; }
.btn--sm { padding: 0.5rem 1rem; min-height: 38px; font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ---------------- Badges / chips / pills ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 0.3rem 0.7rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); background: var(--accent-soft); color: var(--accent); }
.badge--up { background: var(--up-soft); color: var(--up); }
.badge--down { background: var(--down-soft); color: var(--down); }
.badge--neutral { background: var(--surface-3); color: var(--text-muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 0.45rem 0.9rem; border-radius: var(--r-pill); border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-muted); transition: all var(--t-fast); cursor: pointer; }
.chip:hover, .chip[aria-selected="true"] { color: #fff; border-color: var(--accent); background: var(--accent-soft); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med);
  height: 100%;
}
.card--hover:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--sh-md); }
.card__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); margin-bottom: var(--sp-4); }
.card__icon svg { width: 26px; height: 26px; }
.card h3, .card h4 { margin-bottom: var(--sp-3); }
.card p { font-size: 0.95rem; }
.card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-4); color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.card__link svg { width: 16px; height: 16px; transition: transform var(--t-fast); }
.card__link:hover svg { transform: translateX(4px); }
html[dir="rtl"] .card__link:hover svg { transform: translateX(-4px); }

/* media card (academy / news) */
.media-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.media-card__img { aspect-ratio: 16/10; width: 100%; object-fit: cover; background: var(--surface-2); }
.media-card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
/* Badges/eyebrows are inline pills; in a column flex body the default
   align-items:stretch blows them out to full width, so pin them to the start. */
.media-card__body > .badge,
.media-card__body > .eyebrow { align-self: flex-start; }
.media-card__meta { display: flex; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-dim); }

/* ---------------- Stats ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
@media (max-width: 768px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: var(--sp-5) var(--sp-3); }
.stat__num { font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); font-weight: var(--fw-bold); line-height: 1; background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { margin-top: var(--sp-3); color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------------- Tabs ---------------- */
.tabs__list { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-bottom: var(--sp-6); }
.tabs__tab { padding: 0.6rem 1.2rem; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-muted); font-weight: var(--fw-medium); transition: all var(--t-fast); }
.tabs__tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; animation: fade-in var(--t-med) var(--ease); }

/* ---------------- Accordion (FAQ) ---------------- */
.accordion { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.accordion__item + .accordion__item { border-top: 1px solid var(--border); }
.accordion__btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); padding: var(--sp-5); text-align: start; font-weight: var(--fw-semibold); font-size: 1.05rem; }
.accordion__btn .ico { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); transition: transform var(--t-fast); }
.accordion__btn[aria-expanded="true"] .ico { transform: rotate(45deg); }
.accordion__panel { max-height: 0; overflow: hidden; transition: max-height var(--t-med) var(--ease); }
.accordion__panel > div { padding: 0 var(--sp-5) var(--sp-5); color: var(--text-muted); }

/* ---------------- Carousel ---------------- */
.carousel { position: relative; }
.carousel__track { display: flex; gap: var(--sp-5); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: var(--sp-3); scrollbar-width: none; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide { scroll-snap-align: start; flex: 0 0 auto; width: min(360px, 80%); }
.carousel__nav { display: flex; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-5); }
.carousel__btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); color: #fff; display: grid; place-items: center; transition: all var(--t-fast); }
.carousel__btn:hover { background: var(--accent); border-color: var(--accent); }
.carousel__btn svg { width: 20px; height: 20px; }
html[dir="rtl"] .carousel__btn svg { transform: scaleX(-1); }

/* ---------------- Ticker (marquee) ---------------- */
.ticker { background: var(--bg-pure); border-block: 1px solid var(--border); overflow: hidden; }
.ticker__track { display: flex; gap: var(--sp-6); white-space: nowrap; padding-block: var(--sp-3); width: max-content; animation: ticker-scroll 40s linear infinite; }
html[dir="rtl"] .ticker__track { animation-direction: reverse; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.ticker__sym { color: var(--text); font-weight: var(--fw-semibold); }
.ticker__price { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ticker__chg { font-variant-numeric: tabular-nums; }
.ticker__chg.up { color: var(--up); }
.ticker__chg.down { color: var(--down); }
.ticker__chg.flash { animation: chg-flash 600ms var(--ease); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data th, table.data td { padding: var(--sp-4) var(--sp-5); text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data thead th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); background: var(--surface-2); }
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: var(--surface); }
table.data td.num { font-variant-numeric: tabular-nums; }

/* ---------------- Forms ---------------- */
.field { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.field label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.field input, .field textarea, .field select {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.85rem 1rem;
  min-height: 48px;
  color: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------------- Steps ---------------- */
.steps { counter-reset: step; display: grid; gap: var(--sp-6); }
.step { display: flex; gap: var(--sp-5); }
.step__num { counter-increment: step; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: var(--fw-bold); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-strong); }
.step__num::before { content: counter(step); }

/* ---------------- Trader / leaderboard card ---------------- */
.trader-card { display: flex; flex-direction: column; gap: var(--sp-4); }
.trader-card__top { display: flex; align-items: center; gap: var(--sp-3); }
.trader-card__avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 2px solid var(--accent); }
.trader-card__name { font-weight: var(--fw-semibold); }
.trader-card__handle { font-size: var(--fs-sm); color: var(--text-dim); }
.trader-card__stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.trader-card__stat .k { font-size: var(--fs-xs); color: var(--text-dim); }
.trader-card__stat .v { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* ---------------- Logo / trust bar ---------------- */
.logo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-7); }
.logo-bar > * { color: var(--text-dim); opacity: 0.75; transition: opacity var(--t-fast), color var(--t-fast); font-weight: var(--fw-semibold); }
.logo-bar > *:hover { opacity: 1; color: var(--text-muted); }

/* ---------------- Pricing / VIP tiers ---------------- */
.tier { position: relative; }
.tier--featured { border-color: var(--accent); box-shadow: var(--sh-accent); }
.tier__flag { position: absolute; inset-block-start: -12px; inset-inline-start: 50%; transform: translateX(-50%); }
html[dir="rtl"] .tier__flag { transform: translateX(50%); }
.tier__price { font-family: var(--font-display); font-size: 2.4rem; font-weight: var(--fw-bold); }
.tier__list { display: grid; gap: var(--sp-3); margin: var(--sp-5) 0; }
.tier__list li { display: flex; gap: var(--sp-3); align-items: flex-start; color: var(--text-muted); font-size: 0.95rem; }
.tier__list svg { width: 18px; height: 18px; color: var(--up); flex-shrink: 0; margin-top: 3px; }

/* ---------------- Modal ---------------- */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--sp-5); background: rgba(0,0,0,0.7); opacity: 0; visibility: hidden; transition: opacity var(--t-med), visibility var(--t-med); }
.modal[data-open="true"] { opacity: 1; visibility: visible; }
.modal__box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-7); max-width: 460px; width: 100%; transform: scale(0.96); transition: transform var(--t-med) var(--ease-out); }
.modal[data-open="true"] .modal__box { transform: scale(1); }

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-dim); padding-top: calc(var(--header-h) + var(--sp-5)); }
.breadcrumbs a:hover { color: var(--text-muted); }
.breadcrumbs .sep { opacity: 0.5; }

/* ---------------- Device mockups ---------------- */
.device-phone { border: 10px solid #1a1a1f; border-radius: 34px; background: #000; box-shadow: var(--sh-lg); overflow: hidden; max-width: 280px; }
.device-phone img { width: 100%; display: block; }
.device-browser { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: var(--sh-lg); }
.device-browser__bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.device-browser__bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.device-browser img { width: 100%; display: block; }

/* product screenshot (rounded, framed) */
.media-shot { width: 100%; height: auto; display: block; border-radius: var(--r-lg); border: 1px solid var(--border-strong); box-shadow: var(--sh-lg); }

/* star rating (inline SVG) */
.testi__stars { display: inline-flex; gap: 3px; }
.testi__stars svg { width: 15px; height: 15px; }

/* ---------------- App-store badges (real images) ---------------- */
.app-badges { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.app-badges a { display: inline-flex; transition: transform var(--t-fast) var(--ease); }
.app-badges a:hover { transform: translateY(-2px); }
.app-badges img { height: 44px; width: auto; display: block; border-radius: 8px; }

/* ---------------- Payment-method strip ---------------- */
.pay-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-7); }
.pay-strip img {
  height: 30px; width: auto; display: block;
  background: #fff; border-radius: 6px; padding: 5px 8px;   /* uniform white chips so every brand logo stays legible on any theme */
  opacity: 0.92; transition: opacity var(--t-fast), transform var(--t-fast);
}
.pay-strip img:hover { opacity: 1; transform: translateY(-1px); }

/* ---------------- Award strip (real image + star pills) ---------------- */
.award-strip { display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); }
.award-strip__img {
  height: clamp(200px, 16vw + 120px, 320px); width: auto; max-width: 100%;
  border-radius: var(--r-lg);
  filter: drop-shadow(0 18px 50px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 28px var(--accent-glow));
}
.award-strip__pills { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-3) var(--sp-4); }
.award-pill { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 0.55rem 1rem; border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text-muted); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.award-pill svg { width: 18px; height: 18px; color: #f4c150; flex-shrink: 0; }

/* ============================================================
   Light-theme component fixes — repair hardcoded #fff that the
   token cascade can't reach (.theme-light = whole page,
   .section--light = single band on a dark page).
   ============================================================ */
.section--light { background: var(--surface-light); color: var(--text); }

.theme-light .btn--secondary,
.section--light .btn--secondary { color: var(--text); background: rgba(15, 18, 26, 0.03); border-color: var(--border-strong); }
.theme-light .btn--secondary:hover,
.section--light .btn--secondary:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-light .btn--ghost:hover { color: var(--text); }
.theme-light .hero-stats .v,
.section--light .hero-stats .v { color: var(--text); }
.theme-light .carousel__btn { color: var(--text); }
.theme-light .carousel__btn:hover { color: #fff; }

/* header on a light page */
.theme-light .site-header.is-scrolled { background: rgba(255, 255, 255, 0.86); border-bottom-color: var(--border); }
.theme-light .brand { color: var(--text); }
.theme-light .nav-link:hover,
.theme-light .nav-link[aria-expanded="true"] { color: var(--text); }
.theme-light .hamburger span,
.theme-light .hamburger span::before,
.theme-light .hamburger span::after { background: var(--text); }

/* footer on a light page */
.theme-light .footer-col a:hover,
.theme-light .socials a:hover,
.theme-light .drawer__sub a:hover { color: var(--text); }
.theme-light .risk-bar { background: var(--surface-2); border-top-color: var(--border); }

/* prose for legal / article pages */
.prose { max-width: 780px; }
.prose h2 { margin-top: var(--sp-8); margin-bottom: var(--sp-4); }
.prose h3 { margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.prose p, .prose li { color: var(--text-muted); margin-bottom: var(--sp-4); }
.prose ul { list-style: disc; padding-inline-start: var(--sp-6); }
.prose ul li { margin-bottom: var(--sp-2); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
