:root {
    --bg-deep: #001929;
    --bg-soft: #15153A;
    --bg-card: #021A2C;
    --bg-card-hover: #00101B;
    --highlight: #C3F628;
    --cyan: #00D4FF;
    --cyan-soft: rgba(0, 225, 225, 0.12);
    --purple: #7B61FF;
    --purple-soft: rgba(123, 97, 255, 0.14);
    --text-primary: #FFFFFF;
    --text-secondary: #B8B8D4;
    --text-muted: #7A7A99;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: "Red Hat Display", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 400;
    overflow-x: hidden;
    min-height: 100vh;
  }
  .gradient-mesh {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
      radial-gradient(circle at 20% 10%, rgba(0,173,226,0.10), transparent 40%),
      radial-gradient(circle at 80% 80%, rgba(136,0,247,0.14), transparent 45%),
      radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02), transparent 60%);
  }
  .content-layer { position: relative; z-index: 1; }
  .text-cyan { color: var(--cyan); }
  .text-purple { color: var(--purple); }
  .bg-cyan-soft { background: var(--cyan-soft); }
  .bg-purple-soft { background: var(--purple-soft); }
  .border-cyan { border-color: var(--cyan); }
  .border-purple { border-color: var(--purple); }

  .screen { display: none; min-height: 100vh; }
  .screen.active { display: block; animation: fadeUp 0.5s ease-out; }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Trifólio decorativo simples em SVG */
  .trifolio-mark { width: 56px; height: 56px; display: inline-block; }

  .btn-primary {
    color: var(--bg-deep);
    font-weight: 700;
    padding: 16px 32px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    letter-spacing: -0.01em;
    width: 100%;
    max-width: 420px;

    border-radius: 12px;
    border: 1px solid #9FCA1D;
    background: #C3F628;
  }
  .btn-primary:hover { border-radius: 12px;
    border: 1px solid #9FCA1D;
    background: #E6FC88; }
  .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

  .btn-secondary {
    background: transparent;
    color: var(--text-primary);
    font-weight: 500;
    padding: 14px 28px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
  }
  .btn-secondary:hover { background: rgba(255,255,255,0.06); border-color: var(--cyan); }

  .btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
  }
  .btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

  .option-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.18s ease-out;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
    text-align: left;
    width: 100%;
  }
  .option-card:hover {
    border-color: var(--cyan);
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateX(2px);
  }
  .option-card.selected {
    background: var(--cyan-soft);
    border-color: var(--cyan);
    color: var(--text-primary);
  }

  .progress-track {
    height: 4px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden;
  }
  .progress-fill { height: 100%; background: var(--cyan); transition: width 0.5s cubic-bezier(0.65,0,0.35,1); }

  /* Pillar accent colors */
  .pillar-base { --pillar: #FFFFFF; --pillar-soft: rgba(255,255,255,0.10); }
  .pillar-1    { --pillar: #00E1E1; --pillar-soft: rgba(0,225,225,0.12); }
  .pillar-2    { --pillar: #E8E8FF; --pillar-soft: rgba(232,232,255,0.10); }
  .pillar-3    { --pillar: #7B61FF; --pillar-soft: rgba(123,97,255,0.14); }

  .pillar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 18px;
  }
  .pillar-tag {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--pillar-soft);
    color: var(--pillar);
    border: 1px solid var(--pillar);
    border-color: color-mix(in srgb, var(--pillar) 30%, transparent);
  }
  .pillar-dot {
    width: 8px; height: 8px; border-radius: 999px; background: var(--pillar);
  }

  .action-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
  }
  .action-row:last-child { border-bottom: none; }
  .action-row:hover .action-text { color: var(--text-primary); }
  .action-checkbox {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-strong);
    background: transparent;
    margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
  }
  .action-row.checked .action-checkbox {
    background: var(--pillar);
    border-color: var(--pillar);
  }
  .action-row.checked .action-checkbox::after {
    content: '';
    width: 6px; height: 10px;
    border: solid var(--bg-deep);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
  }
  .action-text {
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.55;
    transition: color 0.18s;
  }
  .action-row.checked .action-text { color: var(--text-primary); }

  .dimension-tab {
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14.5px;
    font-weight: 500;
    transition: all 0.18s;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    background: transparent;
    width: 100%;
    text-align: left;
  }
  .dimension-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
  }
  .dimension-tab.active {
    background: var(--bg-card);
    border-color: var(--cyan);
    color: var(--text-primary);
  }
  .dim-count {
    font-size: 12px;
    background: rgba(255,255,255,0.08);
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--text-secondary);
  }
  .dimension-tab.active .dim-count { background: var(--cyan-soft); color: var(--cyan); }

  .expand-toggle {
    background: transparent;
    border: 1px dashed var(--border-strong);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    text-align: left;
    margin-top: 14px;
    transition: all 0.18s;
    display: flex; align-items: center; justify-content: space-between;
  }
  .expand-toggle:hover { color: var(--text-primary); border-color: var(--cyan); }
  .expand-toggle .chev { transition: transform 0.25s; }
  .expand-toggle.open .chev { transform: rotate(180deg); }

  .other-block { margin-top: 12px; }
  .other-level-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); padding: 14px 0 6px;
  }

  /* Quiz layout */
  .quiz-shell { max-width: 760px; margin: 0 auto; padding: 1.25rem 1.25rem 140px; min-height: 100vh; }
  .quiz-footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    padding: 24px 1.25rem 32px;
    display: flex; align-items: center; justify-content: center; gap: 16px;
  }

  .email-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.18s;
  }
  .email-input::placeholder { color: var(--text-muted); }
  .email-input:focus { border-color: var(--cyan); }
  .email-input.invalid { border-color: #FF8080; }

  /* Manifesto */
  .manifesto-line { font-size: clamp(20px, 2vw, 26px); line-height: 1.45; color: var(--text-secondary); margin: 0; padding: 6px 0; }
  .manifesto-line strong { color: var(--text-primary); font-weight: 600; }

  /* Modal */
  .modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px;
  }
  .modal-backdrop.open { display: flex; }
  .modal-card {
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    max-width: 920px; width: 100%;
    max-height: 86vh; overflow-y: auto;
    padding: 36px 40px;
  }

  /* Loading */
  .pulse-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--cyan);
    margin: 0 4px;
    animation: pulse 1.4s infinite ease-in-out both;
  }
  .pulse-dot:nth-child(2) { animation-delay: 0.16s; }
  .pulse-dot:nth-child(3) { animation-delay: 0.32s; }
  @keyframes pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
  }

  /* Phase badges */
  .phase-badge {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.18s;
    min-width: 50px;
    user-select: none;
  }
  .phase-30 { color: #00E1E1; border-color: rgba(0,225,225,0.45); background: rgba(0,225,225,0.10); }
  .phase-60 { color: #FFFFFF; border-color: rgba(255,255,255,0.30); background: rgba(255,255,255,0.06); }
  .phase-90 { color: #B9A8FF; border-color: rgba(123,97,255,0.45); background: rgba(123,97,255,0.14); }
  .phase-badge:hover { transform: translateY(-1px); filter: brightness(1.15); }

  .phase-section-header {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
    color: var(--text-muted);
    padding: 16px 0 10px;
    border-top: 1px dashed var(--border-subtle);
    margin-top: 10px;
  }
  .phase-section-header:first-child { border-top: none; margin-top: 0; padding-top: 4px; }
  .phase-section-header .phase-badge { cursor: default; }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

  /* Plan accordion */
  .plan-accordion {
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    transition: all 0.25s ease;
  }
  .plan-accordion:hover { border-color: var(--border-strong); }
  .plan-accordion.open { border-color: var(--acc-color, var(--border-strong)); }
  .plan-acc-header {
    display: flex; align-items: center; gap: 8px;
    padding: 16px;
    cursor: pointer;
    background: var(--bg-card);
    transition: background 0.2s;
    user-select: none;
  }
  .plan-acc-header:hover { background: var(--bg-card-hover); }
  .plan-accordion.open .plan-acc-header { background: rgba(0, 16, 27, 0.42); }
  .plan-acc-icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--acc-bg, rgba(255,255,255,0.06));
  }
  .plan-acc-icon svg { width: 20px; height: 20px; }
  .plan-acc-title {
    flex: 1;
    font-size: 16px; font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }
  .plan-acc-chevron {
    flex-shrink: 0;
    width: 20px; height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .plan-accordion.open .plan-acc-chevron { transform: rotate(180deg); }
  .plan-acc-body {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease;
    padding: 0 16px;
  }
  .plan-acc-body > div { overflow: hidden; min-height: 0; }
  .plan-accordion.open .plan-acc-body {
    grid-template-rows: 1fr;
    padding: 18px 16px 16px;
    background: rgba(0, 16, 27, 0.42);
  }
  .resumo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  @media (max-width: 768px) {
    .resumo-grid { grid-template-columns: 1fr; }
  }

  /* Plan view switch (Dimensões x Cronograma) */
  .view-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 16px 0;
    background: transparent;
    transition: background 0.2s ease;
  }
  .view-toggle-wrap.is-stuck {
    background: linear-gradient(var(--bg-deep) 70%, transparent);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  .view-toggle {
    position: relative;
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 4px;
  }
  .view-toggle-indicator {
    position: absolute;
    top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    background: var(--highlight);
    border-radius: 999px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
  }
  .view-toggle-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.25s;
    white-space: nowrap;
    text-align: center;
  }
  .view-toggle-btn.active { color: var(--bg-deep); }
  @media (max-width: 768px) {
    .view-toggle-btn {
      padding: 10px 14px;
    }
  }
  .plan-view { animation: fadeUp 0.35s ease-out; }

  /* Timeline */
  .timeline-rail {
    position: relative;
    padding-left: 28px;
  }
  .timeline-rail::before {
    content: '';
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--cyan), #FFFFFF, var(--purple));
    border-radius: 999px;
  }
  .timeline-node {
    position: relative;
    padding-bottom: 20px;
  }
  .timeline-node:last-child { padding-bottom: 0; }
  .timeline-dot {
    position: absolute;
    left: -28px; top: 4px;
    width: 16px; height: 16px;
    border-radius: 999px;
    border: 2px solid;
    background: var(--bg-soft);
  }
  .timeline-node-header {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
  }
  .timeline-node-header:hover .phase-badge { filter: brightness(1.15); }
  .timeline-node-chevron {
    flex-shrink: 0;
    width: 18px; height: 18px;
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .timeline-node.open .timeline-node-chevron { transform: rotate(180deg); }
  .timeline-node-body {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .timeline-node.open .timeline-node-body { grid-template-rows: 1fr; }
  .timeline-node-body > div { overflow: hidden; min-height: 0; }
  .timeline-check {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 0;
    font-size: 13.5px; line-height: 1.5;
    color: var(--text-secondary);
  }
  .timeline-check span:first-child { flex-shrink: 0; }