/**
 * AWM Simulados — page layouts (consome Design System v2 Chartglass)
 */

body.awm-atmosphere {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: clamp(12px, 3vw, 28px);
  min-height: 100vh;
  background-color: transparent;
}

#start-screen .awm-screen__heading,
#end-screen .awm-screen__heading,
#start-screen h2,
#end-screen h2 {
  color: var(--awm-color-navy);
  font-family: var(--awm-font-display);
  margin-bottom: var(--awm-space-2);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: var(--awm-tracking-tight);
}

#start-screen .awm-screen__lead,
#end-screen .awm-screen__lead,
#start-screen > p,
#end-screen > .awm-lead {
  margin-bottom: var(--awm-space-4);
  font-size: var(--awm-text-md);
  color: var(--awm-color-text-muted);
  max-width: 48ch;
}

#score-text:not(:has(.awm-score__value)) {
  font-size: var(--awm-text-2xl);
  font-family: var(--awm-font-display);
  color: var(--awm-color-navy);
  font-weight: 600;
}

#summary-area {
  margin-top: var(--awm-space-3);
  margin-bottom: var(--awm-space-4);
  width: 100%;
  text-align: left;
}

#end-screen .awm-u-actions {
  margin-bottom: var(--awm-space-3);
}

#end-screen-actions.awm-u-actions--deferred {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    max-height 0.45s ease,
    margin 0.45s ease;
}

#end-screen-actions.awm-u-actions--deferred.is-ready {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 120px;
  margin-bottom: var(--awm-space-3);
}

.site-footer__address {
  font-size: var(--awm-text-sm);
  line-height: var(--awm-leading-normal);
}

.site-footer__dev {
  margin-top: var(--awm-space-1);
}

.site-footer__link {
  color: var(--awm-color-navy-soft);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--awm-dur) var(--awm-ease), color var(--awm-dur) var(--awm-ease);
}

.site-footer__link:hover {
  color: var(--awm-color-navy);
  border-bottom-color: var(--awm-color-cyan);
}

body.is-quiz-mode .site-footer {
  display: none;
}

#quiz-screen #next-button {
  width: 100%;
  margin-top: var(--awm-space-2);
}


/* ——— Catálogo: simulados públicos em destaque ——— */
.awm-public-free {
  margin: 0 0 var(--awm-space-5);
}

.awm-public-free[hidden] {
  display: none !important;
}

.awm-public-free .awm-screen__heading {
  margin-bottom: var(--awm-space-1);
}

.awm-public-free .awm-screen__lead {
  margin-bottom: var(--awm-space-3);
}

.awm-grid--public-free {
  grid-template-columns: 1fr;
}

.awm-grid--public-free[data-count="1"] {
  grid-template-columns: 1fr;
}

.awm-grid--public-free[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.awm-grid--public-free[data-count="3"],
.awm-grid--public-free[data-count="4"],
.awm-grid--public-free[data-count="5"] {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

@media (max-width: 520px) {
  .awm-grid--public-free[data-count="2"] {
    grid-template-columns: 1fr;
  }
}

.awm-mission--public {
  grid-column: auto;
  width: 100%;
  min-height: 132px;
}

.awm-mission--public .awm-mission__top {
  flex-wrap: wrap;
  gap: 6px;
}

.awm-mission__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 6px 12px;
  font-size: var(--awm-text-xs);
  font-weight: 600;
  line-height: 1.2;
  width: auto;
  max-width: 100%;
  pointer-events: none; /* o <a> pai já navega */
}

.awm-mission--locked {
  opacity: 0.72;
  position: relative;
}

.awm-mission--locked:hover {
  border-color: var(--awm-color-border-strong, var(--awm-color-border));
  box-shadow: none;
}

.awm-mission__lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 36, 48, 0.08);
  color: var(--awm-color-navy, #0f2430);
}

html[data-theme="dark"] .awm-mission__lock {
  background: rgba(255, 255, 255, 0.1);
  color: #e8eef3;
}

/* —— Hero CNH (trânsito / preto–prata–amarelo) —— */
.awm-cnh-hero {
  --cnh-ink: #0a0a0a;
  --cnh-silver: #c8ccd4;
  --cnh-yellow: #f5c518;
  --cnh-road: #1a1c1f;
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 var(--awm-space-5);
  padding: var(--awm-space-5) var(--awm-space-4);
  padding-right: 6.5rem;
  border-radius: var(--awm-radius-lg, 16px);
  background:
    linear-gradient(135deg, rgba(10, 10, 10, 0.94) 0%, rgba(26, 28, 31, 0.92) 52%, rgba(45, 48, 54, 0.9) 100%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(245, 197, 24, 0.04) 18px,
      rgba(245, 197, 24, 0.04) 19px
    );
  border: 1px solid color-mix(in srgb, var(--cnh-yellow) 35%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(200, 204, 212, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  min-height: 148px;
}

.awm-cnh-hero__content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  padding-right: var(--awm-space-3);
}

.awm-cnh-hero__brand {
  margin: 0 0 var(--awm-space-2);
  font-family: var(--awm-font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: var(--awm-leading-tight);
  color: var(--cnh-yellow);
  text-shadow: 0 0 24px rgba(245, 197, 24, 0.25);
}

.awm-cnh-hero__content h2 {
  margin: 0 0 var(--awm-space-2);
  font-family: var(--awm-font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  line-height: var(--awm-leading-tight);
  color: #f4f5f7;
}

/* Light mode: headings globais navy não podem vencer o hero escuro */
html[data-theme="light"] .awm-cnh-hero__brand,
html:not([data-theme="dark"]) .awm-cnh-hero__brand {
  color: #f5c518;
}

html[data-theme="light"] .awm-cnh-hero__content h2,
html:not([data-theme="dark"]) .awm-cnh-hero__content h2,
html[data-theme="light"] .awm-cnh-hero h2,
html:not([data-theme="dark"]) .awm-cnh-hero h2 {
  color: #f4f5f7 !important;
}

html[data-theme="light"] .awm-cnh-hero__content p,
html:not([data-theme="dark"]) .awm-cnh-hero__content p {
  color: #c8ccd4;
}

.awm-cnh-hero__content p {
  margin: 0;
  max-width: 52rem;
  font-size: var(--awm-text-sm);
  line-height: var(--awm-leading-relaxed);
  color: color-mix(in srgb, var(--cnh-silver) 88%, #fff);
}

.awm-cnh-hero__mark {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cnh-yellow);
  opacity: 0.9;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(245, 197, 24, 0.35));
  animation: awm-cnh-pulse 3.6s ease-in-out infinite;
}

.awm-cnh-hero__stripe {
  animation: awm-cnh-dash 1.8s linear infinite;
}

@keyframes awm-cnh-pulse {
  0%, 100% { opacity: 0.75; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.04); }
}

@keyframes awm-cnh-dash {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -36; }
}

.awm-cnh-hero__road {
  position: absolute;
  inset: auto 0 0 0;
  height: 22px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45)),
    repeating-linear-gradient(
      90deg,
      #111 0,
      #111 16px,
      var(--cnh-yellow) 16px,
      var(--cnh-yellow) 28px
    );
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 520px) {
  .awm-cnh-hero {
    flex-direction: column;
    align-items: flex-start;
    padding-right: var(--awm-space-4);
    padding-top: var(--awm-space-4);
    min-height: auto;
  }

  .awm-cnh-hero__content {
    padding-right: 0;
    padding-bottom: 3.5rem;
  }

  .awm-cnh-hero__mark {
    right: 1rem;
    top: auto;
    bottom: 2.1rem;
    transform: none;
    opacity: 0.7;
  }

  .awm-cnh-hero__mark svg {
    width: 56px;
    height: 56px;
  }

  @keyframes awm-cnh-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
  }
}

.awm-exam-spotlight {
  margin-bottom: var(--awm-space-5);
}

.awm-mission--exam-spotlight {
  display: block;
  width: 100%;
  border: 2px solid color-mix(in srgb, #f5c518 45%, transparent);
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.06), color-mix(in srgb, #f5c518 8%, transparent));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  min-height: 140px;
}

.awm-catalog-topics {
  display: flex;
  flex-direction: column;
  gap: var(--awm-space-6, 2rem);
}

.awm-topic-section__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: var(--awm-space-3);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--awm-color-border, rgba(11, 58, 82, 0.12));
}

.awm-topic-section__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.awm-topic-section__title {
  margin: 0;
  font-family: var(--awm-font-display);
  font-size: var(--awm-text-lg, 1.125rem);
  color: var(--awm-color-navy);
}

.awm-topic-section__count {
  margin-left: auto;
  font-size: var(--awm-text-xs);
  color: var(--awm-color-muted, #5a7380);
}

.awm-mission--topic {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.awm-mission--topic:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--awm-color-ocean) 14%, transparent);
}

.awm-mission__station--topic {
  font-size: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--awm-color-cyan) 15%, transparent);
}

.awm-mission__progress {
  margin-top: 0.65rem;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--awm-color-navy) 10%, transparent);
  overflow: hidden;
}

.awm-mission__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--awm-color-cyan), var(--awm-color-ocean));
  transition: width 0.35s ease;
}

html[data-theme="dark"] .awm-topic-section__title {
  color: #e8eef3;
}

html[data-theme="dark"] .awm-mission--exam-spotlight {
  border-color: color-mix(in srgb, #f5c518 40%, transparent);
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.35), color-mix(in srgb, #f5c518 10%, transparent));
}

/* —— Header público CNH (preto / prata / amarelo do logo) —— */
.awm-chrome.awm-chrome--cnh,
.site-header.awm-chrome--cnh {
  --cnh-ink: #0a0a0a;
  --cnh-silver: #c8ccd4;
  --cnh-yellow: #f5c518;
  --cnh-road: #141618;
  color: #f4f5f7;
  background:
    linear-gradient(135deg, #0a0a0a 0%, #16181c 48%, #22252b 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--cnh-yellow) 45%, transparent);
  box-shadow:
    inset 0 -1px 0 rgba(245, 197, 24, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

.awm-chrome.awm-chrome--cnh::after,
.site-header.awm-chrome--cnh::after {
  background:
    linear-gradient(rgba(245, 197, 24, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 197, 24, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.55;
}

.awm-chrome.awm-chrome--cnh::before,
.site-header.awm-chrome--cnh::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    #0a0a0a 0,
    #0a0a0a 10px,
    var(--cnh-yellow) 10px,
    var(--cnh-yellow) 20px
  );
  opacity: 0.85;
}

.awm-chrome--cnh .awm-chrome__coords,
.awm-chrome--cnh .site-header__eyebrow {
  color: var(--cnh-yellow);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.awm-chrome--cnh .awm-chrome__title,
.awm-chrome--cnh .site-header__title {
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.awm-chrome--cnh .site-header__subtitle,
.awm-chrome--cnh .awm-header__subtitle {
  color: color-mix(in srgb, var(--cnh-silver) 92%, #fff);
}

.awm-chrome--cnh .site-header__subtitle-link {
  color: var(--cnh-yellow);
}

.awm-chrome--cnh .site-header__subtitle-link:hover {
  color: #ffe066;
}

.awm-chrome--cnh .awm-chrome__logo-wrap,
.awm-chrome--cnh .site-header__logo-wrap {
  border: 2px solid color-mix(in srgb, var(--cnh-yellow) 55%, #fff);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  background: #0a0a0a;
  overflow: hidden;
}

.awm-chrome--cnh .awm-student-theme-toggle,
.awm-chrome--cnh .awm-profile-chip {
  background: color-mix(in srgb, #fff 10%, transparent);
  border-color: color-mix(in srgb, var(--cnh-yellow) 35%, transparent);
  color: #f4f5f7;
}

.awm-chrome--cnh .awm-chrome__status {
  color: var(--cnh-silver);
}

html[data-theme="dark"] .awm-chrome.awm-chrome--cnh,
html[data-theme="dark"] .site-header.awm-chrome--cnh {
  background: linear-gradient(135deg, #050505 0%, #121418 55%, #1c1f24 100%);
  border-bottom-color: color-mix(in srgb, #f5c518 50%, transparent);
}

