/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #FAFAFA;
  --white: #FFFFFF;
  --indigo: #4F46E5;
  --indigo-light: #EEF2FF;
  --indigo-mid: #C7D2FE;
  --green: #10B981;
  --green-light: #D1FAE5;
  --yellow-bg: #FFFBEB;
  --yellow-border: #FDE68A;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 16px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 1.125rem;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--gray-500);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-back svg {
  width: 20px;
  height: 20px;
}

.header-back:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.header-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
  white-space: nowrap;
}

.header-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.progress-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}

.progress-bar {
  width: 120px;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ===== Hero ===== */
.hero {
  padding: 8rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--indigo-light) 0%, var(--bg) 100%);
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--indigo);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ===== Timeline Section ===== */
.timeline-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.timeline {
  position: relative;
}

/* ===== Etapa ===== */
.etapa {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.etapa:last-child {
  margin-bottom: 0;
}

/* Marker (circle + line) */
.etapa-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 48px;
}

.marker-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
}

.marker-number {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--gray-400);
  transition: all 0.3s ease;
}

.marker-check {
  display: none;
  width: 24px;
  height: 24px;
  color: var(--white);
}

.marker-line {
  width: 3px;
  flex: 1;
  background: var(--gray-200);
  margin: 0.5rem 0;
  border-radius: 2px;
  transition: background 0.3s ease;
}

.etapa:last-child .marker-line {
  display: none;
}

/* Etapa states */
.etapa.current .marker-circle {
  border-color: var(--indigo);
  background: var(--indigo-light);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
  animation: pulse-ring 2s ease-in-out infinite;
}

.etapa.current .marker-number {
  color: var(--indigo);
}

.etapa.completed .marker-circle {
  border-color: var(--green);
  background: var(--green);
}

.etapa.completed .marker-number {
  display: none;
}

.etapa.completed .marker-check {
  display: block;
}

.etapa.completed .marker-line {
  background: var(--green);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0.08); }
}

/* Etapa content card */
.etapa-content {
  flex: 1;
  min-width: 0;
}

.etapa-header {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  user-select: none;
  outline: none;
}

.etapa-header:hover {
  box-shadow: var(--shadow-md);
}

.etapa-header:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.etapa.expanded .etapa-header {
  border-radius: var(--radius) var(--radius) 0 0;
}

.etapa-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.etapa-icon svg {
  width: 48px;
  height: 48px;
}

.etapa-info {
  flex: 1;
  min-width: 0;
}

.etapa-days {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.etapa-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 0.125rem;
}

.etapa-meta {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.125rem;
}

.etapa-toggle {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--gray-400);
  transition: transform 0.3s ease;
}

.etapa-toggle svg {
  width: 24px;
  height: 24px;
}

.etapa.expanded .etapa-toggle {
  transform: rotate(180deg);
}

/* Etapa body (expandable) */
.etapa-body {
  background: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.etapa.expanded .etapa-body {
  padding: 0.5rem 1.5rem 1.5rem;
  max-height: 3000px;
}

/* Sections inside etapa */
.etapa-section {
  margin-top: 1.5rem;
}

.etapa-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.etapa-section ul {
  list-style: none;
  padding: 0;
}

.etapa-section ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.etapa-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo-mid);
}

.etapa-section p {
  font-size: 0.9375rem;
  color: var(--gray-700);
  line-height: 1.6;
}

/* Glossary Tooltips */
.tip {
  position: relative;
  border-bottom: 1.5px dotted var(--indigo-mid);
  cursor: help;
  white-space: nowrap;
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #F9FAFB;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gray-900);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.tip:hover::after,
.tip:hover::before,
.tip:focus::after,
.tip:focus::before,
.tip.tip-active::after,
.tip.tip-active::before {
  opacity: 1;
}

/* Flip tooltip below when near top */
.tip.tip-flip::after {
  bottom: auto;
  top: calc(100% + 8px);
}

.tip.tip-flip::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--gray-900);
}

@media (max-width: 640px) {
  .tip::after {
    max-width: 220px;
    font-size: 0.75rem;
    left: 0;
    transform: none;
  }
  .tip::before {
    left: 16px;
    transform: none;
  }
}

.etapa-section a.tool-link {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed var(--indigo-mid);
  transition: border-color 0.15s ease;
}

.etapa-section a.tool-link:hover {
  border-bottom-color: var(--indigo);
  border-bottom-style: solid;
}

/* Pulo do Gato */
.pulo-do-gato {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

.pulo-icon {
  font-size: 1.125rem;
}

.pulo-do-gato ul li::before {
  background: #F59E0B;
}

/* Entregavel */
.entregavel {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

.entregavel h3 {
  color: #065F46;
}

.entregavel p,
.entregavel ul li {
  color: #065F46;
}

.entregavel ul li::before {
  background: var(--green);
}

/* Button - Marcar como concluída */
.btn-concluir {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-concluir:hover {
  background: #4338CA;
}

.btn-concluir:active {
  transform: scale(0.98);
}

.btn-check {
  width: 18px;
  height: 18px;
}

.etapa.completed .btn-concluir {
  background: var(--green);
}

.etapa.completed .btn-text {
  /* text changes via JS */
}

/* ===== Footer ===== */
.footer {
  background: var(--gray-900);
  color: var(--white);
  padding: 4rem 1.5rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.cronograma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.cronograma-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cronograma-dias {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--indigo-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cronograma-nome {
  font-weight: 600;
  font-size: 1rem;
}

.cronograma-foco {
  font-size: 0.875rem;
  color: var(--gray-400);
}

.footer-resultado {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-resultado h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.resultado-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.resultado-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9375rem;
  color: var(--gray-300);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero {
    padding: 6.5rem 1rem 3rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .timeline-section {
    padding: 1.5rem 0.75rem 3rem;
  }

  .etapa {
    gap: 0.75rem;
  }

  .etapa-marker {
    width: 36px;
  }

  .marker-circle {
    width: 36px;
    height: 36px;
  }

  .marker-number {
    font-size: 0.9375rem;
  }

  .marker-check {
    width: 18px;
    height: 18px;
  }

  .etapa-header {
    padding: 1rem;
    gap: 0.75rem;
  }

  .etapa-icon {
    width: 40px;
    height: 40px;
  }

  .etapa-icon svg {
    width: 40px;
    height: 40px;
  }

  .etapa-title {
    font-size: 1.0625rem;
  }

  .etapa-meta {
    display: none;
  }

  .etapa.expanded .etapa-body {
    padding: 0.5rem 1rem 1.25rem;
  }

  .etapa-section ul li {
    font-size: 0.875rem;
  }

  .pulo-do-gato,
  .entregavel {
    padding: 1rem;
  }

  .header-inner {
    padding: 0.625rem 1rem;
  }

  .header-title {
    font-size: 0.875rem;
  }

  .progress-bar {
    width: 80px;
  }

  .footer {
    padding: 3rem 1rem;
  }

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

  .resultado-items {
    grid-template-columns: 1fr;
  }
}
