/* Curso IA — Fundamentos de IA / Formação 2026
   Implementação do design "Página de módulos com DevIA". */

:root {
  --bg: #0b0b0b;
  --surface: #0d0d0d;
  --raised: #1a1a1a;
  --raised-hover: #1f1f1f;
  --avatar: #2c2c2c;

  --accent: #60ff30;
  --accent-soft: rgba(96, 255, 48, 0.1);
  --accent-dim: rgba(96, 255, 48, 0.35);
  --live: #ff3030;

  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-faint: rgba(255, 255, 255, 0.4);
  --line: rgba(255, 255, 255, 0.1);

  --sans: "Albert Sans", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-card: 18px;
  --radius-row: 14px;
  --shell: 1400px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: var(--sans);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  opacity: 0.8;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.mono {
  font-family: var(--mono);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

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

@keyframes dcRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dcBlink {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  font-family: var(--mono);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.course-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.spacer {
  flex: 1;
}

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  color: var(--text-faint);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-pill__value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--avatar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ------------------------------------------------------------- page grid */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 44px 32px 180px;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: flex-start;
}

.main {
  flex: 1 1 520px;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 110px;
  align-self: flex-start;
  flex: 1 1 300px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------------------------------------------------------- resume card */

.resume {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.resume__player {
  position: relative;
  min-height: 280px;
  background: var(--raised);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
}

.resume__player:hover {
  background: var(--raised-hover);
}

.resume__glow,
.resume__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.resume__glow {
  opacity: 0.5;
  background:
    radial-gradient(70% 60% at 50% 100%, rgba(48, 176, 255, 0.2) 0%, rgba(48, 176, 255, 0) 65%),
    radial-gradient(60% 50% at 20% 10%, rgba(96, 255, 48, 0.1) 0%, rgba(96, 255, 48, 0) 70%);
}

.resume__grid {
  opacity: 0.1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 56px 56px;
}

.play {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.play::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 22px solid var(--bg);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 5px;
}

.resume__duration {
  position: absolute;
  left: 22px;
  bottom: 20px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.resume__body {
  padding: 38px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.resume__kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.resume__title {
  margin: 14px 0 0;
  font-weight: 800;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.resume__summary {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

.resume__meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------ meters */

.meter {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.meter--thin {
  height: 3px;
}

.meter--resume {
  margin-top: 26px;
}

.meter__fill {
  height: 100%;
  background: var(--accent);
}

/* ----------------------------------------------------------- modules */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 64px 0 0;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-weight: 800;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.section-head__meta {
  font-size: 15px;
  color: var(--text-faint);
}

.modules {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.module {
  border-bottom: 1px solid var(--line);
  padding: 30px 4px;
}

.module--current {
  background: var(--surface);
}

.module__row {
  display: flex;
  align-items: flex-start;
  gap: 26px;
}

.module__number {
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  color: var(--accent);
  min-width: 74px;
}

.module--locked .module__number {
  color: var(--accent-dim);
}

.module__body {
  flex: 1;
  min-width: 0;
}

.module__title {
  margin: 0;
  font-weight: 700;
  font-size: 23px;
  line-height: 1.2;
}

.module--locked .module__title {
  color: var(--text-muted);
}

.module__summary {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

.module--locked .module__summary {
  color: var(--text-faint);
}

.module__progress {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.module__progress .meter {
  flex: 1;
  max-width: 320px;
}

.module__count {
  font-size: 13px;
  color: var(--text-faint);
}

.badge {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--done {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--current {
  background: var(--accent);
  color: var(--bg);
}

.badge--plain {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-faint);
  white-space: nowrap;
  padding-top: 8px;
}

/* ------------------------------------------------------------ lessons */

.lessons {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  padding: 0;
}

.lesson {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-row);
  text-align: left;
  transition: background 0.15s ease;
}

.lesson:hover {
  background: var(--raised);
}

.lesson--current {
  background: var(--raised);
}

.lesson--current:hover {
  background: var(--raised-hover);
}

.lesson__status {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  background: var(--accent);
  color: var(--bg);
}

.lesson--current .lesson__status {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
}

.lesson--todo .lesson__status {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lesson__index {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
}

.lesson__title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson__time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

.lesson--current .lesson__index,
.lesson--current .lesson__time {
  color: var(--accent);
}

.lesson--current .lesson__title {
  color: var(--text);
  font-weight: 500;
}

/* ------------------------------------------------------------ sidebar */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 24px;
}

.stat {
  margin-top: 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--accent);
}

.stat__value {
  font-weight: 800;
  font-size: 52px;
  line-height: 1;
}

.stat__unit {
  font-weight: 800;
  font-size: 24px;
}

.card .meter {
  margin-top: 16px;
}

.stat-list {
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.stat-list > div {
  display: flex;
  justify-content: space-between;
}

.stat-list strong {
  color: var(--text);
  font-weight: 400;
}

.live-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--live);
}

.live__title {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.live__when {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  margin-top: 18px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
}

.btn:hover {
  opacity: 0.85;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.7;
}

.link-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}

.link-list a {
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.link-list a span:last-child {
  color: var(--text-faint);
}

/* --------------------------------------------------------------- chat */

.dock {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.chat {
  width: 392px;
  max-width: calc(100vw - 56px);
  height: min(620px, calc(100vh - 140px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dcRise 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat[hidden] {
  display: none;
}

.chat__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat__mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 900;
  font-size: 13px;
}

.chat__id {
  flex: 1;
  min-width: 0;
}

.chat__name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
}

.chat__tagline {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 3px;
}

.chat__close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}

.chat__close:hover {
  background: var(--raised);
  color: var(--text);
}

.chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  display: flex;
}

.msg--assistant {
  justify-content: flex-start;
}

.msg--user {
  justify-content: flex-end;
}

.msg__bubble {
  max-width: 86%;
  border-radius: var(--radius-row);
  padding: 12px 15px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg--assistant .msg__bubble {
  background: var(--raised);
  border: 1px solid var(--line);
  color: rgba(255, 255, 255, 0.9);
}

.msg--user .msg__bubble {
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 2px;
}

.typing[hidden] {
  display: none;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: dcBlink 1s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.suggestions {
  padding: 0 20px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions[hidden] {
  display: none;
}

.chip {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
}

.chip:hover {
  background: var(--raised);
  color: var(--text);
}

.chat__composer {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat__input {
  flex: 1;
  min-width: 0;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
}

.chat__input:focus {
  border-color: rgba(96, 255, 48, 0.6);
}

.chat__send {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.chat__send:hover {
  opacity: 0.85;
}

.chat__send:active {
  transform: scale(0.97);
  opacity: 0.7;
}

.chat__send:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.fab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.fab:hover {
  opacity: 0.88;
}

.fab:active {
  transform: scale(0.97);
  opacity: 0.7;
}

.fab__mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 900;
  font-size: 13px;
}

.fab__label {
  font-weight: 700;
  font-size: 15px;
}

/* -------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .site-nav,
  .course-label,
  .site-header .divider {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header__inner {
    padding: 14px 18px;
    gap: 14px;
  }

  .shell {
    padding: 28px 18px 140px;
    gap: 40px;
  }

  .resume__body {
    padding: 28px 24px;
  }

  .section-head h2 {
    font-size: 34px;
  }

  .module__row {
    gap: 16px;
    flex-wrap: wrap;
  }

  .module__number {
    font-size: 30px;
    min-width: 52px;
  }

  .dock {
    right: 16px;
    bottom: 16px;
  }

  .chat {
    max-width: calc(100vw - 32px);
  }

  .fab__label {
    display: none;
  }

  .fab {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
