/* TraderGain portal — layout fixes & responsive */

main {
  overflow-x: clip;
}

.site-header .container.nav-wrap,
.container {
  width: min(1180px, calc(100% - 24px));
}

.section-heading {
  max-width: 760px;
}

.catalog {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.course-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  transition: border-color .2s, transform .2s;
}

.course-card:hover {
  border-color: rgba(215, 173, 88, .35);
  transform: translateY(-2px);
}

.course-card h3,
.course-card p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.course-card p {
  flex: 1 1 auto;
}

.course-link {
  margin-top: auto;
  padding-top: 16px;
}

.academy-section .section-heading,
.academy-section .catalog {
  width: 100%;
}

.academy-cta {
  margin-top: 48px;
  padding: 0;
  width: 100%;
}

.academy-cta .cta-box {
  align-items: center;
  background: linear-gradient(115deg, #352712, #121926);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  padding: 28px 30px;
  width: 100%;
}

.lang-switcher {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

.lang-switcher label {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.lang-switcher select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font: 600 11px Manrope, sans-serif;
  max-width: 108px;
  padding: 7px 10px;
}

.form-shell,
.dashboard .container,
.page-hero .container {
  width: min(1180px, calc(100% - 24px));
}

.dashboard-actions {
  gap: 10px;
}

.module-access-card {
  width: 100%;
}

@media (max-width: 1080px) {
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards,
  .steps,
  .pricing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    gap: 32px;
    grid-template-columns: 1fr;
  }

  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .catalog,
  .cards,
  .steps,
  .pricing,
  .dash-grid,
  .footer-grid,
  .tool-list,
  .hero-grid,
  .player-layout,
  .module-list .module-card {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 56px 0;
  }

  .page-hero {
    padding: 56px 0 40px;
  }

  .page-hero h1,
  .section-heading h2,
  .hero h1 {
    letter-spacing: -0.02em;
    line-height: 1.22;
    word-spacing: 0.04em;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
    margin: 12px 0 16px;
    max-width: 100%;
  }

  .hero p {
    font-size: 1rem;
    line-height: 1.55;
    max-width: 100%;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .button {
    flex: 1 1 auto;
    justify-content: center;
    min-width: min(100%, 160px);
    text-align: center;
  }

  .academy-cta .cta-box {
    padding: 22px 18px;
  }

  .academy-cta .cta-box .button {
    margin-top: 0;
    width: 100%;
  }

  .cta-box {
    display: grid;
    gap: 16px;
  }

  .module-card {
    display: grid;
    gap: 16px;
  }

  .module-buy {
    min-width: 0;
    text-align: left;
  }

  .form-shell {
    margin: 40px auto;
    padding: 24px 20px;
    width: min(100% - 24px, 465px);
  }

  .lang-switcher select {
    max-width: 96px;
  }
}

@media (max-width: 400px) {
  .site-header .container.nav-wrap,
  .container {
    width: calc(100% - 20px);
  }
}
