/* Defensive guardrail — keeps view-toggling robust if a future rule
   ever sets display: flex/grid/block on .free-audit-view. */
.free-audit-view[hidden] { display: none; }

/* .email-reveal sets `display: flex`, which (author origin) overrides the UA
   `[hidden] { display: none }` — so toggling the `hidden` attribute alone would
   never hide the form. Higher-specificity [hidden] rule restores the intended
   reveal-on-click behavior for BOTH the free (#emailForm) and paid
   (#paidEmailForm) email forms. See memory feedback-hidden-attr-overridden. */
.email-reveal[hidden] { display: none; }

.free-audit-page {
  max-width: 760px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.page-h1 { font-family: var(--font-display, 'Instrument Serif', serif); font-size: 3rem; margin-bottom: 0.5rem; }
.page-sub { color: var(--text-secondary, #94a3b8); margin-bottom: 3rem; }

.intake-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-label { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label > span { font-weight: 500; }
.form-label input, .form-label select, .form-label textarea {
  background: var(--surface-1, rgba(255,255,255,0.04));
  color: var(--text-primary, #e2e8f0);
  border: 1px solid var(--border-color, #2a3441);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
}
.form-label textarea { min-height: 12rem; resize: vertical; }

.audit-score-card { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; }
.score-ring {
  width: 8rem; height: 8rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 6px solid currentColor;
  font-size: 2rem; font-weight: 700;
}
.score-ring[data-color="red"]    { color: #ef4444; }
.score-ring[data-color="orange"] { color: #f59e0b; }
.score-ring[data-color="blue"]   { color: #3b82f6; }
.score-ring[data-color="green"]  { color: #10b981; }
.score-out-of { font-size: 1rem; opacity: 0.6; margin-left: 0.2rem; }
.score-label { font-size: 1.25rem; color: var(--text-secondary, #94a3b8); }

.gap-list { list-style: none; padding: 0; }
.gap-list li {
  background: var(--surface-1, rgba(255,255,255,0.04));
  border-left: 3px solid var(--accent, #00b4ff);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 0.25rem;
}
.gap-list strong { display: block; margin-bottom: 0.25rem; }
.gap-list p { margin: 0; color: var(--text-secondary, #94a3b8); font-size: 0.95rem; }

.audit-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.email-reveal { margin-top: 1.5rem; display: flex; gap: 0.75rem; align-items: end; }
.email-reveal .form-label { flex: 1; }

.optimize-score-card {
  background: var(--surface-1, rgba(255,255,255,0.04));
  padding: 2rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
}
.score-jump {
  font-size: 2.5rem; font-weight: 700;
  display: flex; align-items: center; gap: 1rem;
}
.score-arrow { color: var(--accent, #00b4ff); }
.pillar-scores { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.pillar-score {
  background: rgba(0,180,255,0.08); border: 1px solid rgba(0,180,255,0.2);
  padding: 0.4rem 0.75rem; border-radius: 1rem; font-size: 0.85rem;
}

.optimize-section { margin-bottom: 2rem; }
.optimize-section h3 { margin-bottom: 0.75rem; }
.copyable {
  position: relative;
  background: var(--surface-1, rgba(255,255,255,0.04));
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
}
.copy-btn {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: var(--accent, #00b4ff); color: white;
  border: none; padding: 0.4rem 0.75rem; border-radius: 0.3rem;
  font-size: 0.85rem; cursor: pointer;
}
.copy-btn:disabled { background: var(--text-secondary, #94a3b8); }
.optimized-title { font-size: 1.1rem; margin: 0; padding-right: 4rem; }
.optimized-description { white-space: pre-wrap; font-family: inherit; margin: 0; padding-right: 4rem; }
.optimized-tags, .optimized-alt-tags { list-style: none; padding: 0; margin: 0; padding-right: 4rem; }
.optimized-tags li, .optimized-alt-tags li {
  display: inline-block; background: rgba(0,180,255,0.08); border: 1px solid rgba(0,180,255,0.2);
  padding: 0.3rem 0.7rem; margin: 0.2rem; border-radius: 1rem; font-size: 0.9rem;
}
.locked-result {
  background: var(--surface-1, rgba(255,255,255,0.04));
  border: 1px dashed rgba(255,255,255,0.24);
  border-radius: 0.5rem;
  color: var(--text-secondary, #94a3b8);
  padding: 1rem 1.25rem;
}
.locked-result p { margin: 0; }
.optimize-actions { display: flex; gap: 0.75rem; margin-top: 2rem; }

/* Paid "$5" CTA — burnt-orange buy action (brand --cta), distinct from the
   aurora-blue free CTA (.btn-primary). Box matches .btn-primary. */
.btn-paid {
  padding: 17px 40px; border-radius: 14px;
  background: #d68d0f;
  color: #fff; border: none; font-size: 15px; font-weight: 700;
  font-family: 'Sora', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(214,141,15,0.3), 0 4px 16px rgba(0,0,0,0.15);
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
}
.btn-paid:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 60px rgba(214,141,15,0.4), 0 8px 32px rgba(0,0,0,0.2);
}
.btn-paid:disabled {
  opacity: 0.6; cursor: default; transform: none; box-shadow: none;
}
.price-chip {
  background: rgba(255,255,255,0.22);
  border-radius: 0.75rem;
  padding: 0.1rem 0.55rem;
  font-weight: 700;
}

/* Terminal message panel on /rebuild-result.html */
.rebuild-message {
  background: var(--surface-1, rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  padding: 2rem;
}
.rebuild-message h2 { margin-top: 0; }
.rebuild-message p { color: var(--text-secondary, #94a3b8); }

@media (max-width: 480px) {
  .email-reveal,
  .audit-actions,
  .optimize-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
