/* =========================================================
   copytrading.css — /copytrading page
   Uses the tokens from the base CSS (:root).
   Every class is prefixed .ct- so nothing clashes with home.css / faq.css
   ========================================================= */

[hidden] {
  display: none !important;
}

.ct-page section[id] {
  scroll-margin-top: calc(var(--header-h, 72px) + 12px);
}

.ct-page h3 {
  margin-top: 0;
}

.ct-page :focus-visible {
  outline: 2px solid var(--brand-b);
  outline-offset: 2px;
}

.ct-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
}

/* ---------- Shared ---------- */
.ct-card {
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
}

.ct-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--brand-b);
  font-size: 1.1rem;
}

/* Reveal: JS only hides elements still below the fold */
.ct-reveal {
  transition: opacity .6s ease, transform .5s ease, border-color .25s ease, box-shadow .25s ease;
}

/* =========================================================
   1. HERO
   ========================================================= */
.ct-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .9rem;
}

.ct-trust li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-trust .icon {
  color: var(--green);
}

/* =========================================================
   2. WHAT IS COPY TRADING
   ========================================================= */
.what-note {
  color: var(--muted);
  font-size: .92rem;
}

/* =========================================================
   5. QUANTITY MODES + CALCULATOR
   ========================================================= */
.ct-modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.ct-mode {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  /* diagram reacts to card width */
  padding: 20px;
  background: linear-gradient(180deg, var(--white-04), transparent 60%), var(--surface);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.ct-mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ct-mode-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ct-mode .ct-ico {
  width: 38px;
  height: 38px;
  font-size: 1rem;
  border-radius: var(--r-xs);
}

.ct-mode>p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.55;
}

/* ----- colour tones (hard RGB values, never fall back to grey) ----- */
.tone-green {
  --tone: 74, 222, 128;
}

.tone-blue {
  --tone: 96, 165, 250;
}

.tone-pink {
  --tone: 244, 114, 182;
}

/* ----- diagram ----- */
.ct-flow {
  display: flex;
  align-items: center;
  min-height: 164px;
  /* 3 rows × 44 + 2 gaps × 8 + 16 padding */
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-2);
}

.ct-flow-node {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

/* avatar: takes the row tone, grey if none */
.ct-flow-av {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: .8rem;
  color: rgb(var(--tone, 148, 163, 184));
  background: rgba(var(--tone, 148, 163, 184), .14);
  border: 1px solid rgba(var(--tone, 148, 163, 184), .4);
}

.ct-flow-text {
  display: grid;
  line-height: 1.2;
  min-width: 0;
}

.ct-flow-text b {
  font-size: .82rem;
  color: var(--head);
  white-space: nowrap;
}

.ct-flow-text small {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* lots badge */
.ct-lot {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  font-size: .74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--tone, 148, 163, 184));
  background: rgba(var(--tone, 148, 163, 184), .12);
  border: 1px solid rgba(var(--tone, 148, 163, 184), .32);
}

/* master */
.ct-flow-master {
  position: relative;
  flex: 0 0 auto;
}

.ct-flow-master .ct-flow-av {
  color: var(--on-brand);
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--brand-a-16);
}

.ct-flow-master::after {
  /* master → trunk */
  content: '';
  position: absolute;
  top: 50%;
  right: -18px;
  width: 18px;
  height: 1px;
  background: var(--line-2);
}

/* children + tree lines */
.ct-flow-branch {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  flex: 1 1 0;
  min-width: 0;
  margin: 0 0 0 18px;
  padding-left: 18px;
}

.ct-flow-branch::before {
  /* trunk: first row centre → last row centre */
  content: '';
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: var(--line-2);
}

.ct-flow-row {
  position: relative;
  min-width: 0;
}

.ct-flow-row .ct-flow-node {
  min-width: 0;
}

.ct-flow-row::before {
  /* trunk → child */
  content: '';
  position: absolute;
  top: 50%;
  left: -18px;
  width: 18px;
  height: 1px;
  background: var(--line-2);
}

.ct-flow-row::after {
  /* coloured junction dot */
  content: '';
  position: absolute;
  top: 50%;
  left: -21px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: rgb(var(--tone, 148, 163, 184));
}

.ct-flow-row:hover .ct-flow-node {
  background: rgba(var(--tone, 148, 163, 184), .06);
  transform: translateX(2px);
}

/* very narrow card → stack */
@container (max-width: 299px) {
  .ct-flow {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
  }

  .ct-flow-master::after {
    display: none;
  }

  .ct-flow-branch {
    align-self: stretch;
    margin: 10px 0 0 21px;
    padding-left: 20px;
  }

  .ct-flow-branch::before {
    top: -10px;
    bottom: 22px;
  }

  .ct-flow-row::before {
    left: -20px;
    width: 20px;
  }

  .ct-flow-row::after {
    left: -23px;
  }
}

/* ----- calculator ----- */
.ct-calc {
  padding: 20px;
  border-color: var(--line-2);
}

.ct-calc h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.ct-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ct-calc label {
  display: grid;
  gap: 6px;
  font-size: .875rem;
  color: var(--muted);
}

.ct-calc input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
}

.ct-calc input:focus {
  border-color: var(--blue-65);
  outline: 0;
  box-shadow: 0 0 0 3px var(--blue-14);
}

.ct-calc-out {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.ct-calc-out>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ct-calc-out dt {
  font-size: .875rem;
  color: var(--text-80);
}

.ct-calc-out dt small {
  margin-left: 6px;
  color: var(--muted);
}

.ct-calc-out dd {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
  color: var(--head);
  white-space: nowrap;
}

/* =========================================================
   6. BUILT FOR EVERY TRADER
   ========================================================= */
.ct-aud {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.ct-aud-card {
  padding: 24px;
}

.ct-aud-card:hover {
  transform: translateY(-2px);
}

.ct-aud-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ct-aud-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.ct-aud-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ct-aud-card li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
}

.ct-aud-card li .icon {
  margin-top: 3px;
  color: var(--green);
}

/* =========================================================
   CTA
   ========================================================= */
.ct-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: clamp(24px, 5vw, 48px) clamp(20px, 5vw, 56px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background:
    radial-gradient(700px 380px at 0% 0%, var(--brand-a-16), transparent 60%),
    radial-gradient(700px 380px at 100% 100%, var(--white-04), transparent 60%),
    var(--surface);
}

.ct-cta h2 {
  margin-bottom: .35em;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.ct-cta .lead {
  margin-bottom: 0;
}

.ct-cta .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ct-cta .btn {
  width: 100%;
  justify-content: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 479px) {
  .ct-trust {
    font-size: .875rem;
    gap: 8px 12px;
  }

  .ct-calc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ct-calc-grid label:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 640px) {
  .ct-aud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1019px) {
  .ct-flow {
    min-height: 0;
  }

  /* cards stack, no equal height needed */
}

@media (min-width: 900px) {
  .ct-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ct-calc {
    grid-column: 1 / -1;
  }

  .ct-cta {
    grid-template-columns: minmax(0, 1.2fr) auto;
    gap: 40px;
  }

  .ct-cta .btn-row {
    flex-wrap: nowrap;
  }
}

@media (min-width: 1020px) {
  .ct-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px;
  }

  .ct-aud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ct-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ct-calc {
    grid-column: auto;
  }

  .ct-mode>p {
    min-height: calc(1.55em * 3);
  }

  /* keeps dashed dividers level */
}

@media (prefers-reduced-motion: reduce) {

  .ct-reveal,
  .ct-flow-node {
    transition: none !important;
  }

  .ct-flow-node {
    transform: none !important;
  }
}