/* course-access.css — Estilos unificados para seleção de módulos e ponte de abertura/retomada
   Identidade oficial Criação Ilimitada: sem gradientes, sem excesso de cards/pills, sem microtítulos.
   Responsivo, acessível, foco visível, textos legíveis. */

@font-face {
  font-family: Poppins;
  src: url('./assets/fonts/poppins-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url('./assets/fonts/poppins-600-latin.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url('./assets/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #992429;
  --brand-deep: #3a0e11;
  --brand-dark: #5c1519;
  --brand-soft: #faeeef;
  --ink: #221c1b;
  --body: #493f3d;
  --muted: #6b5f5d;
  --paper: #faf7f6;
  --surface: #fff;
  --line: #e6dddc;
  --focus: #992429;
  --positive: #46654f;
  --positive-soft: #e6eee8;
  --warning: #7c4d00;
  --warning-soft: #fdf3e2;
  --radius: 2px;
  font-family: Inter, system-ui, sans-serif;
  color: var(--body);
  background: var(--paper);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

p {
  line-height: 1.6;
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  border-radius: var(--radius);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* Shell / container */
.shell,
.wrap {
  max-width: 1120px;
  padding: 0 32px 72px;
  margin: 0 auto;
}

/* Header bar */
.bar {
  min-height: 76px;
  padding: 16px 0 14px;
  border-top: 2px solid var(--brand);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.brand {
  display: block;
  width: 188px;
  height: 40px;
  flex: none;
  background: url('./assets/brand/logo-criacao.svg') left center / contain no-repeat;
  text-indent: -9999px;
  overflow: hidden;
}

.brand span {
  display: none;
}

.back,
.report-link {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.back:hover,
.report-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}


/* Hero / Course Header */
.hero {
  border-top: 1px solid var(--line);
  padding: 48px 0 42px;
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 48px;
  align-items: end;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin: 0 0 18px;
  max-width: 650px;
}

.hero p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 560px;
}

/* Course summary + progress */
.summary {
  border-left: 1px solid var(--line);
  padding-left: 26px;
}

.summary strong {
  font-size: 2.6rem;
  letter-spacing: -0.06em;
  display: block;
  color: var(--brand);
  font-family: Poppins, Inter, sans-serif;
  font-weight: 500;
}

.summary span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.progress {
  height: 6px;
  background: #f2d6d7;
  border-radius: 0;
  margin-top: 22px;
  overflow: hidden;
}

.progress i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--brand);
  border-radius: 0;
  transition: width 300ms ease;
}

/* Modules list */
.modules {
  border-top: 1px solid var(--line);
}

.module {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.module:last-child {
  border-bottom: none;
}

.number {
  font-family: Poppins, Inter, sans-serif;
  font-size: 2rem;
  letter-spacing: -0.05em;
  color: var(--brand);
  font-weight: 500;
  flex-shrink: 0;
}

.module h2 {
  font-size: 1.18rem;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}

.module p {
  color: var(--muted);
  margin: 0;
  font-size: 0.94rem;
}

.module-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 140px;
}

.status {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.status.completed {
  color: var(--positive);
}

.status.current {
  color: var(--brand);
}

.status.failed {
  color: var(--brand);
}

.status.available {
  color: var(--muted);
}

.launch {
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.launch:hover,
.launch:focus-visible {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Launch page specific */
.launch-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 24px;
  text-align: center;
}

.launch-page .shell {
  max-width: 640px;
  padding: 0;
}

.launch-message {
  margin-bottom: 24px;
}

.launch-message h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 12px;
}

.launch-message p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.launch-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.launch-loading p {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.launch-error {
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 520px;
  text-align: left;
}

.launch-error h2 {
  color: var(--brand);
  margin: 0 0 12px;
  font-size: 1.4rem;
}

.launch-error p {
  color: var(--body);
  margin: 0 0 16px;
}

.launch-error .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.launch-error .ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.launch-error .ghost:hover,
.launch-error .ghost:focus-visible {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.launch-error .primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.launch-error .primary:hover,
.launch-error .primary:focus-visible {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* Context bar (appears on launch page) */
.context-bar {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.context-bar .label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.context-bar .value {
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 500;
  font-family: Poppins, Inter, sans-serif;
}

/* Navigation note */
.note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Help strip for explanation */
.help-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: -16px 0 34px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
}

.help-strip strong,
.help-strip span {
  display: block;
}

.help-strip strong {
  font-family: Poppins, Inter, sans-serif;
  color: var(--ink);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 4px;
}

.help-strip span {
  font-size: 0.9rem;
  color: var(--muted);
}

.help-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 760px) {
  .shell,
  .wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  .bar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
  }

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

  .summary {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 20px;
  }

  .module {
    grid-template-columns: 56px 1fr;
    gap: 16px;
  }

  .module-action {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    margin-top: 8px;
  }

  .status {
    margin-right: 0;
  }

  .launch {
    flex: 1;
    text-align: center;
  }

  .help-strip {
    flex-direction: column;
    align-items: flex-start;
    margin: -12px 0 28px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(2rem, 7vw, 3.5rem);
  }

  .number {
    font-size: 1.6rem;
  }

  .module h2 {
    font-size: 1.05rem;
  }

  .module p {
    font-size: 0.88rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  :root {
    --brand: #6b1a1e;
    --brand-dark: #4a1215;
    --line: #b8b0ad;
    --muted: #554f4d;
  }

  .launch {
    border-width: 2px;
  }

  .progress {
    background: var(--line);
  }
}

/* Print */
@media print {
  .launch,
  .back,
  .help-strip,
  .spinner {
    display: none !important;
  }

  .module {
    break-inside: avoid;
  }
}
