:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --primary: #0057d9;
  --primary-dark: #003c91;
  --accent: #18b581;
  --text: #1f2933;
  --muted: #6b7785;
  --surface: #ffffff;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef2ff 0%, #fafbff 45%, #f7f9fc 100%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.25rem, 2.5vw, 3.5rem) clamp(0.75rem, 4vw, 4rem);
  gap: clamp(1.5rem, 2vw, 3rem);
}

.hero {
  width: min(1280px, 96vw);
  background: radial-gradient(110% 110% at 20% 20%, rgba(0, 87, 217, 0.18) 0%, rgba(0, 124, 255, 0.05) 100%);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 87, 217, 0.18), rgba(24, 181, 129, 0.12));
  opacity: 0.8;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero__branding {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  max-width: 100%;
  flex-wrap: wrap;
}

.hero__logo {
  width: clamp(96px, 14vw, 160px);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 18px 28px rgba(0, 30, 105, 0.25));
}

.hero__text {
  max-width: clamp(320px, 55vw, 620px);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.65);
  color: var(--primary-dark);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(2.25rem, 5vw, 3rem);
  letter-spacing: -0.015em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
}

.banner {
  width: min(1280px, 96vw);
  border-radius: 16px;
  padding: 0.9rem 1.4rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 18px 32px rgba(0, 30, 105, 0.09);
}

.banner--testing {
  background: linear-gradient(135deg, rgba(0, 87, 217, 0.12), rgba(24, 181, 129, 0.1));
  color: var(--primary-dark);
  border: 1px solid rgba(0, 87, 217, 0.25);
}

.site-footer {
  width: min(1280px, 96vw);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding-bottom: 1rem;
}

.site-footer p {
  margin: 0;
}

.card {
  width: min(1280px, 96vw);
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(2rem, 4vw, 3.25rem);
  box-shadow: var(--shadow);
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form label {
  font-weight: 600;
  color: var(--text);
}

.form input,
.form select {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form input:focus,
.form select:focus {
  border-color: rgba(0, 87, 217, 0.65);
  box-shadow: 0 0 0 4px rgba(0, 87, 217, 0.15);
  outline: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: none;
  padding: 0.85rem 1.8rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.button--primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 87, 217, 0.28);
}

.button--secondary {
  background: rgba(0, 87, 217, 0.12);
  color: var(--primary-dark);
}

.button--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(107, 119, 133, 0.35);
}

.button:hover {
  transform: translateY(-1px);
}

.overview {
  display: grid;
  gap: 2rem;
}

.overview__highlight {
  background: linear-gradient(135deg, rgba(0, 87, 217, 0.11), rgba(24, 181, 129, 0.09));
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.overview__time {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: #ffffff;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--primary-dark);
}

.overview__details ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.trainer {
  background: rgba(0, 87, 217, 0.08);
  padding: 1rem;
  border-radius: 12px;
}

.training {
  display: grid;
  gap: 2.5rem;
}

.training__progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--muted);
}

.progress {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: width 0.4s ease;
}

.training__player h2 {
  margin-top: 0;
}

.training__description {
  color: var(--muted);
  line-height: 1.6;
}

.player {
  width: min(100%, 900px);
  margin: 1.5rem auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
  position: relative;
  aspect-ratio: 16 / 9;
}

.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.quiz {
  background: rgba(0, 87, 217, 0.04);
  padding: 1.75rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz__question {
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 1.35rem;
  margin: 1rem 0;
  background: #ffffff;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.quiz__number {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 87, 217, 0.1);
  color: var(--primary-dark);
  font-weight: 600;
}

.quiz__prompt {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
}

.quiz__answers {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz__option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.quiz__option span {
  line-height: 1.45;
  word-break: break-word;
}

.quiz__option:hover {
  background: rgba(0, 87, 217, 0.08);
}

.quiz__error {
  color: #b81e1e;
  font-weight: 600;
}

.quiz__question--incorrect {
  border-color: rgba(184, 30, 30, 0.5);
  box-shadow: 0 16px 40px rgba(184, 30, 30, 0.18);
}

.certificate {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.certificate--ready {
  background: linear-gradient(135deg, rgba(24, 181, 129, 0.12), rgba(0, 87, 217, 0.06));
  padding: 2.5rem;
  border-radius: var(--radius);
}

.spinner {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(0, 87, 217, 0.12);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.96);
  color: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .hero,
  .card {
    padding: 1.75rem;
  }

  .hero__branding {
    justify-content: center;
  }

  .hero__text {
    text-align: center;
  }

  .player {
    border-radius: 16px;
  }
}

@media (min-width: 640px) {
  .form__row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (min-width: 900px) {
  .overview {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 960px) {
  .training {
    grid-template-columns: minmax(220px, 260px) minmax(540px, 900px);
    align-items: start;
    justify-content: center;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
  }

  .training__progress {
    position: sticky;
    top: clamp(1.5rem, 3vh, 3rem);
    align-self: flex-start;
    justify-self: stretch;
  }

  .training__player {
    grid-column: 2;
    justify-self: center;
    width: min(100%, 900px);
  }

  .quiz {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 900px);
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1.5rem;
  }

  .overview__highlight {
    padding: 1.25rem;
  }

  .quiz {
    padding: 1.25rem;
  }

  .button,
  .quiz button,
  .training__player .button,
  #begin-training {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .quiz__header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .quiz__number {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
}

/* Center the video across the whole card on wide screens */
@media (min-width: 960px) {
  .training {
    grid-template-columns: minmax(220px, 260px) 1fr; /* sidebar + free column */
  }

  .training__player {
    grid-column: 1 / -1;      /* span both columns (drops below sidebar) */
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .player {
    max-width: 900px;
    width: 100%;
    margin: 1.5rem auto;       /* keeps box centered */
  }

  /* keep quiz centered too */
  .quiz {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 900px);
  }
}
