:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #dde3ea;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --success: #0b8f5a;
  --locked: #7b8492;
  --danger: #c0262d;
  --warning: #f59e0b;
  --action: #e11d48;
  --action-dark: #be123c;
  --focus: #2563eb;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #aab4c3;
  --line: #2f3b4d;
  --surface: #121826;
  --canvas: #080c14;
  --success: #34d399;
  --locked: #8d98a8;
  --danger: #fb7185;
  --warning: #fbbf24;
  --action: #fb3f6c;
  --action-dark: #e11d48;
  --focus: #60a5fa;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: var(--canvas);
}

.login-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.16);
  text-align: center;
}

.login-card img {
  width: min(210px, 70%);
  height: auto;
  margin-bottom: 18px;
}

html[data-theme="dark"] .login-card img {
  content: url("./assets/img/branco.png");
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.login-card p {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
}

.login-form input {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.login-form button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--focus);
  color: white;
  cursor: pointer;
  font-weight: 900;
}

.login-error {
  margin: 8px 0 0;
  color: var(--danger) !important;
  font-weight: 800;
}

.login-card a {
  color: var(--focus);
  font-weight: 800;
}

.countdown-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #151922;
  color: #f8fafc;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.18);
}

.countdown-strip strong {
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.topbar,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 0 22px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

.status-badge,
.limited-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff0d6;
  color: #8a4b00;
  font-weight: 800;
  white-space: nowrap;
}

.progress-panel,
.player-panel,
.lessons-panel,
.closed-notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
}

.closed-notice {
  margin-bottom: 20px;
  padding: 24px;
  border-color: #fecaca;
  background: #fff7f7;
}

html[data-theme="dark"] .closed-notice {
  border-color: rgba(251, 113, 133, 0.42);
  background: #2a1218;
}

.closed-notice p {
  max-width: 680px;
  color: var(--muted);
}

html[data-theme="dark"] .closed-notice p {
  color: #d7b7c0;
}

.primary-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

html[data-theme="dark"] .primary-link {
  background: #f8fafc;
  color: #111827;
}

.progress-panel {
  margin-bottom: 20px;
  padding: 18px;
}

.progress-panel > div:first-child,
.watch-meta > div:first-child,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.progress-panel span,
.watch-meta span,
.section-head span {
  color: var(--muted);
  font-weight: 700;
}

.meter {
  overflow: hidden;
  width: 100%;
  height: 12px;
  margin-top: 12px;
  border-radius: 999px;
  background: #e7ecf2;
}

.meter.small {
  height: 9px;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), #22c55e);
  transition: width 240ms ease;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-bottom: 40px;
}

.player-panel {
  height: fit-content;
  overflow: hidden;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0d14;
}

.video-player {
  width: 100%;
  height: 100%;
}

.video-player iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: white;
  text-align: center;
  background: #000000;
}

.video-overlay img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.overlay-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.video-overlay strong {
  font-size: 1.35rem;
}

.video-overlay span {
  color: #d8dee7;
}

.activate-button {
  position: relative;
  z-index: 1;
  justify-self: center;
  min-height: 46px;
  margin-top: 14px;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: #fbbf24;
  color: #111827;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.overlay-countdown {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.86);
  font-size: 0.9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.overlay-countdown span {
  color: #fbbf24 !important;
}

.watch-meta {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.offer-box,
.diagnostic-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: #fff7ed;
  border-top: 1px solid #fed7aa;
}

.diagnostic-box {
  background: #ecfdf5;
  border-top-color: #bbf7d0;
}

html[data-theme="dark"] .diagnostic-box {
  background: #0d241b;
  border-top-color: rgba(52, 211, 153, 0.34);
}

.offer-box h2,
.diagnostic-box h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.offer-box p,
.diagnostic-box p {
  margin-bottom: 0;
  color: #7c2d12;
}

html[data-theme="dark"] .diagnostic-box p {
  color: #b8f1d0;
}

html[data-theme="dark"] .diagnostic-button {
  color: #00150d;
}

.checkout-button,
.diagnostic-button {
  min-height: 48px;
  padding: 11px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--action);
  color: white;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.28);
  animation: pulseCta 1.8s ease-in-out infinite;
}

.diagnostic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  color: white;
  box-shadow: 0 10px 24px rgba(11, 143, 90, 0.24);
  text-align: center;
  text-decoration: none;
}

.checkout-button:hover {
  background: var(--action-dark);
}

.diagnostic-button:hover {
  filter: brightness(0.94);
}

.lessons-panel {
  align-self: start;
  margin-bottom: 20px;
  padding: 18px;
}

.section-head {
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
}

.lesson-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lesson-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

html[data-theme="dark"] .lesson-card {
  background: #111827;
}

.lesson-thumb {
  position: relative;
  overflow: hidden;
  align-self: start;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #dbe3ee;
}

.lesson-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.lesson-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.38));
}

.lesson-card.locked .lesson-thumb img {
  filter: grayscale(0.7);
}

.lesson-card.available {
  border-color: rgba(11, 143, 90, 0.34);
  background: #f2fbf6;
}

html[data-theme="dark"] .lesson-card.available {
  border-color: rgba(52, 211, 153, 0.36);
  background: #0d241b;
}

.lesson-card.completed {
  border-color: rgba(37, 99, 235, 0.36);
  background: #eff6ff;
}

html[data-theme="dark"] .lesson-card.completed {
  border-color: rgba(96, 165, 250, 0.36);
  background: #101d33;
}

.lesson-card.locked {
  color: var(--locked);
}

.lesson-card h3 {
  margin: 0 0 6px;
}

.lesson-card p {
  margin: 0;
  color: currentColor;
}

.lesson-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-weight: 800;
}

.watch-button {
  align-self: center;
  justify-self: stretch;
  min-width: 96px;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--focus);
  color: white;
  cursor: pointer;
  font-weight: 850;
}

.watch-button:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.fomo-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(340px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

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

.site-footer {
  display: grid;
  justify-items: center;
  gap: 30px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 34px;
  color: var(--muted);
  text-align: center;
}

.footer-logo {
  display: block;
  width: min(220px, 62vw);
  height: auto;
}

.footer-logo-dark {
  display: none;
}

html[data-theme="dark"] .footer-logo-light {
  display: none;
}

html[data-theme="dark"] .footer-logo-dark {
  display: block;
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 25px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 900;
}

@keyframes pulseCta {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .lesson-list {
    grid-template-columns: 1fr;
  }

  .offer-box,
  .diagnostic-box {
    grid-template-columns: 1fr;
  }

  .checkout-button,
  .diagnostic-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .countdown-strip {
    flex-wrap: wrap;
    font-size: 0.92rem;
  }

  .topbar,
  main {
    width: min(100% - 22px, 1180px);
  }

  .progress-panel > div:first-child,
  .watch-meta > div:first-child,
  .section-head,
  .lesson-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .progress-panel > div:first-child,
  .watch-meta > div:first-child,
  .section-head {
    flex-direction: column;
  }
}
