:root {
    --brand: #C23B5E;
    --brand-light: #fbeaf0;
    --brand-mid: #ed93b1;
    --brand-dark: #721428;
    --accent: #7F77DD;
    --accent-light: #EEEDFE;
    --bg: #fafafa;
    --surface: #ffffff;
    --border: rgba(0,0,0,0.10);
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --text-hint: #9b9b9b;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 16px rgba(194,59,94,0.07);
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
  }
  
  /* NAV */
  nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .nav-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .nav-logo span { color: var(--accent); }
  .nav-links { display: flex; gap: 8px; }
  .nav-btn {
    padding: 7px 16px;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 500;
  }
  .nav-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand-mid); }
  .nav-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
  
  /* PAGES */
  .page { display: none; min-height: calc(100vh - 60px); }
  .page.active { display: block; }
  
  /* HERO */
  .hero {
    max-width: 680px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem;
    text-align: center;
  }
  .hero-badge {
    display: inline-block;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 99px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  .hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -1px;
  }
  .hero h1 em { color: var(--brand); font-style: normal; }
  .hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: #15803d;
    margin-bottom: 2rem;
    text-align: left;
  }
  .privacy-note svg { flex-shrink: 0; }
  
  /* TRAIL CARDS */
  .trails-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
  }
  /* Preview da home tem 7 cards — usa 3 colunas em telas maiores */
  .trails-grid--preview {
    grid-template-columns: repeat(3, 1fr);
  }
  .trail-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.18s;
    text-align: left;
    position: relative;
    overflow: hidden;
  }
  .trail-card:hover { border-color: var(--brand-mid); }
  .trail-card.selected { border-color: var(--brand); background: var(--brand-light); }
  .trail-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: var(--brand);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
  }
  .trail-icon { font-size: 1.8rem; margin-bottom: 8px; }
  .trail-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
  .trail-card p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
  
  /* BUTTONS */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 99px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
  }
  .btn-primary {
    background: var(--brand);
    color: #fff;
  }
  .btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
  .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
  .btn-secondary {
    background: transparent;
    color: var(--brand);
    border: 2px solid var(--brand);
  }
  .btn-secondary:hover { background: var(--brand-light); }
  .btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    padding: 10px 20px;
    font-size: 14px;
  }
  .btn-ghost:hover { background: #f5f5f5; }
  .btn-full { width: 100%; }
  
  /* FORM */
  .form-group { margin-bottom: 1.25rem; }
  .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
  }
  .form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand);
  }
  .select-wrapper { position: relative; }
  .select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 12px;
  }
  
  /* CHOICE BUTTONS */
  .choice-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 1.25rem;
  }
  .choice-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .choice-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .choice-btn {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    font-weight: 500;
  }
  .choice-btn:hover { border-color: var(--brand-mid); background: var(--brand-light); }
  .choice-btn.selected { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }
  
  /* QUESTION CARD */
  .question-wrap {
    max-width: 580px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
  }
  .q-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
  }
  .q-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
  }
  .q-progress-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 99px;
    transition: width 0.35s ease;
  }
  .q-progress-text { font-size: 12px; color: var(--text-hint); white-space: nowrap; }
  .q-trail-badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .q-text {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    color: var(--text);
  }
  .q-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
  }
  
  /* MULTI-SELECT HINT */
  .multi-hint {
    font-size: 12px;
    color: var(--text-hint);
    margin-bottom: 10px;
    font-style: italic;
  }

  /* OPEN TEXT (textarea) */
  .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
  }
  .form-textarea:focus {
    outline: none;
    border-color: var(--brand);
  }
  .form-textarea::placeholder { color: var(--text-hint); }

  /* SCALE INPUT */
  .scale-wrap { margin-bottom: 1.5rem; }
  .scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-hint);
    margin-bottom: 6px;
  }
  .scale-btns { display: flex; gap: 6px; }
  .scale-btn {
    flex: 1;
    padding: 10px 4px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-muted);
  }
  .scale-btn:hover { border-color: var(--brand-mid); }
  .scale-btn.selected { border-color: var(--brand); background: var(--brand); color: #fff; }
  
  /* CODE DISPLAY */
  .code-card {
    background: var(--surface);
    border: 2px solid var(--brand-mid);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 2rem auto;
    max-width: 420px;
  }
  .code-card h3 { font-size: 15px; color: var(--text-muted); margin-bottom: 12px; font-weight: 500; }
  .code-display {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--brand);
    margin-bottom: 16px;
  }
  .copy-btn {
    background: var(--brand-light);
    color: var(--brand);
    border: none;
    padding: 8px 20px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
  }
  .copy-btn:hover { background: var(--brand); color: #fff; }
  
  /* RESULT */
  .result-wrap {
    max-width: 580px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
  }
  .match-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--brand-light);
    border: 4px solid var(--brand);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
  }
  .match-pct { font-size: 2.8rem; font-weight: 800; color: var(--brand); line-height: 1; }
  .match-label { font-size: 13px; color: var(--brand); font-weight: 500; }
  .result-breakdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.5rem 0;
    text-align: left;
  }
  .breakdown-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .breakdown-row:last-child { border-bottom: none; }
  .breakdown-icon { font-size: 1.2rem; }
  .breakdown-label { flex: 1; font-size: 14px; font-weight: 500; }
  .breakdown-bar-wrap { width: 100px; height: 8px; background: #f0f0f0; border-radius: 99px; overflow: hidden; }
  .breakdown-bar { height: 100%; background: var(--brand); border-radius: 99px; }
  .breakdown-pct { font-size: 13px; font-weight: 700; color: var(--brand); min-width: 36px; text-align: right; }
  
  /* TOAST */
  .toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999;
    transition: transform 0.3s;
    white-space: nowrap;
  }
  .toast.show { transform: translateX(-50%) translateY(0); }
  
  /* CENTER LAYOUT */
  .center-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
  }
  
  /* SECTION TITLE */
  .section-title {
    text-align: center;
    margin-bottom: 2rem;
  }
  .section-title h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
  .section-title p { font-size: 15px; color: var(--text-muted); }
  
  /* PLAN BADGE */
  .plan-lock {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-top: 1rem;
  }
  
  /* WHATSAPP hint */
  .wpp-hint {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  @media (max-width: 480px) {
    .hero h1 { font-size: 1.9rem; }
    .trails-grid { grid-template-columns: 1fr; }
    .trails-grid--preview { grid-template-columns: 1fr 1fr; }
    .choice-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  }