/**
 * DomainHost — Homepage engage layer
 * Interactive quiz, finder, coupons, duel, FX toggle
 */

:root {
  --eg-brand: #0f766e;
  --eg-soft: #ecfdf5;
  --eg-ink: #0f172a;
  --eg-muted: #64748b;
  --eg-border: #e2e8f0;
  --eg-radius: 16px;
}

/* ---------- Firm ticker (always animate) ---------- */
.nk-firms-ticker-section {
  padding-bottom: 0.5rem;
}

.nk-firms-ticker-section .nk-marquee-wrap {
  overflow: hidden !important;
  width: 100%;
  padding: 0.35rem 0 0.75rem;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.nk-firms-ticker-section .nk-marquee {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.75rem;
  width: max-content !important;
  animation: nk-scroll 32s linear infinite !important;
  will-change: transform;
}

.nk-firms-ticker-section .nk-marquee-wrap:hover .nk-marquee {
  animation-play-state: paused !important;
}

.nk-firms-ticker-section .nk-company-pill {
  flex: 0 0 auto;
}

@keyframes nk-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-33.333%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .nk-firms-ticker-section .nk-marquee {
    animation: nk-scroll 60s linear infinite !important;
    animation-duration: 60s !important;
    animation-iteration-count: infinite !important;
  }
}

/* ---------- Quiz ---------- */
.eg-quiz {
  background: linear-gradient(165deg, #f0fdfa 0%, #fff 45%, #f8fafc 100%);
  border: 1px solid var(--eg-border);
  border-radius: 20px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
}

.eg-quiz__progress {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.eg-quiz__dot {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.25s ease;
}

.eg-quiz__dot.is-on {
  background: var(--eg-brand);
}

.eg-quiz__step[hidden] {
  display: none !important;
}

.eg-quiz__q {
  font-family: var(--nk-display, system-ui);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--eg-ink);
}

.eg-quiz__hint {
  color: var(--eg-muted);
  font-size: 0.92rem;
  margin-bottom: 1.1rem;
}

.eg-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.eg-choice {
  appearance: none;
  border: 1px solid var(--eg-border);
  background: #fff;
  border-radius: 14px;
  padding: 1rem 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
  min-height: 88px;
}

.eg-choice:hover,
.eg-choice.is-selected {
  border-color: #99f6e4;
  background: var(--eg-soft);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
}

.eg-choice__icon {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--eg-soft);
  color: var(--eg-brand);
  margin-bottom: 0.55rem;
  font-size: 1rem;
}

.eg-choice strong {
  display: block;
  font-size: 0.95rem;
  color: var(--eg-ink);
  margin-bottom: 0.15rem;
}

.eg-choice span {
  font-size: 0.78rem;
  color: var(--eg-muted);
  line-height: 1.35;
}

.eg-quiz__nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}

.eg-results {
  display: grid;
  gap: 0.75rem;
}

.eg-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--eg-border);
  border-radius: 14px;
  background: #fff;
  text-decoration: none !important;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.eg-result:hover {
  border-color: #99f6e4;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.1);
}

.eg-result__name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--eg-ink);
}

.eg-result__meta {
  font-size: 0.8rem;
  color: var(--eg-muted);
  margin-top: 0.2rem;
}

.eg-result__price {
  font-weight: 800;
  color: var(--eg-brand);
  font-size: 1.05rem;
  white-space: nowrap;
}

.eg-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--eg-muted);
}

/* ---------- Coupons ---------- */
.eg-coupon-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 260px);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.eg-coupon {
  scroll-snap-align: start;
  border: 1px dashed #99f6e4;
  background: linear-gradient(145deg, #fff 0%, #f0fdfa 100%);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 132px;
}

.eg-coupon__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.eg-coupon__provider {
  font-weight: 750;
  font-size: 0.88rem;
  color: var(--eg-ink);
}

.eg-coupon__off {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--eg-brand);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.eg-coupon__scope {
  font-size: 0.78rem;
  color: var(--eg-muted);
  flex: 1;
}

.eg-coupon__row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.eg-coupon__code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid var(--eg-border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  letter-spacing: 0.02em;
}

.eg-coupon__copy {
  min-height: 38px !important;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.8rem !important;
}

.eg-coupon__copy.is-copied {
  background: #059669 !important;
  border-color: #059669 !important;
}

/* ---------- Finder ---------- */
.eg-finder {
  border: 1px solid var(--eg-border);
  border-radius: var(--eg-radius);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.eg-finder__bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.eg-finder__bar label {
  display: block;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 0.3rem;
}

.eg-finder__live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
  color: var(--eg-muted);
}

.eg-finder__live strong {
  color: var(--eg-brand);
}

.eg-finder__list {
  display: grid;
  gap: 0;
  max-height: 420px;
  overflow-y: auto;
}

.eg-finder__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr 0.9fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none !important;
  color: inherit;
  transition: background 0.12s ease;
}

.eg-finder__row:hover {
  background: var(--eg-soft);
}

.eg-finder__row strong {
  font-size: 0.92rem;
  color: var(--eg-ink);
}

.eg-finder__row .muted {
  font-size: 0.78rem;
  color: var(--eg-muted);
}

.eg-finder__price {
  font-weight: 800;
  color: var(--eg-brand);
}

/* ---------- Duel ---------- */
.eg-duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.eg-duel__card {
  border: 1px solid var(--eg-border);
  border-radius: 16px;
  background: #fff;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  text-align: left;
  width: 100%;
}

.eg-duel__card:hover {
  border-color: #99f6e4;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.12);
  transform: translateY(-3px);
}

.eg-duel__card.is-won {
  border-color: var(--eg-brand);
  background: var(--eg-soft);
}

.eg-duel__card.is-lost {
  opacity: 0.55;
}

.eg-duel__vs {
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  background: var(--eg-ink);
  color: #fff;
  letter-spacing: 0.04em;
}

.eg-duel__badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eg-brand);
}

.eg-duel__title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--eg-ink);
  margin: 0;
}

.eg-duel__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0;
}

.eg-duel__specs span {
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-weight: 650;
}

.eg-duel__price {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--eg-brand);
  margin-top: auto;
}

.eg-duel__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.eg-duel__score {
  font-size: 0.85rem;
  color: var(--eg-muted);
}

.eg-duel__score strong {
  color: var(--eg-ink);
}

/* ---------- Tools playground ---------- */
.eg-tools {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.85rem;
}

.eg-tool {
  border: 1px solid var(--eg-border);
  border-radius: 16px;
  background: #fff;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 170px;
}

.eg-tool h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: var(--eg-ink);
}

.eg-tool p {
  font-size: 0.85rem;
  color: var(--eg-muted);
  margin: 0;
  flex: 1;
}

.eg-tool__row {
  display: flex;
  gap: 0.45rem;
}

.eg-tool__row input {
  flex: 1;
  min-width: 0;
}

.eg-tool__out {
  font-size: 0.82rem;
  color: var(--eg-brand);
  font-weight: 700;
  min-height: 1.2em;
}

/* ---------- FX toggle ---------- */
.eg-fx {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.eg-fx button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.8rem;
  color: var(--eg-muted);
  cursor: pointer;
  min-height: 34px;
}

.eg-fx button.is-active {
  background: #fff;
  color: var(--eg-brand);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.nk-table .price[data-try],
.eg-price[data-try] {
  font-variant-numeric: tabular-nums;
}

/* ---------- Section polish ---------- */
.eg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

@media (max-width: 991.98px) {
  .eg-finder__bar {
    grid-template-columns: 1fr 1fr;
  }

  .eg-finder__row {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .eg-finder__row > *:nth-child(n+3):not(.eg-finder__price):not(:last-child) {
    display: none;
  }

  .eg-duel {
    grid-template-columns: 1fr;
  }

  .eg-duel__vs {
    justify-self: center;
  }

  .eg-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .eg-finder__bar {
    grid-template-columns: 1fr;
  }

  .eg-choices {
    grid-template-columns: 1fr 1fr;
  }
}

[data-theme="dark"] .eg-quiz,
[data-theme="dark"] .eg-finder,
[data-theme="dark"] .eg-coupon,
[data-theme="dark"] .eg-duel__card,
[data-theme="dark"] .eg-tool,
[data-theme="dark"] .eg-result,
[data-theme="dark"] .eg-choice {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .eg-quiz {
  background: linear-gradient(165deg, #0b1220 0%, #0f172a 100%);
}

[data-theme="dark"] .eg-finder__bar {
  background: #0b1220;
}

[data-theme="dark"] .eg-choice:hover,
[data-theme="dark"] .eg-choice.is-selected,
[data-theme="dark"] .eg-result:hover,
[data-theme="dark"] .eg-duel__card:hover,
[data-theme="dark"] .eg-duel__card.is-won {
  background: rgba(15, 118, 110, 0.15);
  border-color: #0d9488;
}

[data-theme="dark"] .eg-quiz__q,
[data-theme="dark"] .eg-result__name,
[data-theme="dark"] .eg-duel__title,
[data-theme="dark"] .eg-tool h3,
[data-theme="dark"] .eg-coupon__provider {
  color: #f1f5f9;
}

[data-theme="dark"] .eg-fx {
  background: #1e293b;
}

[data-theme="dark"] .eg-fx button.is-active {
  background: #0f172a;
}
