/* ===================== AUDIT PAGE ===================== */

/* ---- Hero ---- */
.audit-hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.audit-hero .hero-eyebrow {
  justify-content: center;
}
.audit-hero .hero-eyebrow::before {
  display: none;
}
.audit-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.audit-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Form section ---- */
.audit-form-section {
  padding: 0 0 4rem;
}
.audit-form-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
}

.form-row {
  margin-bottom: 1.25rem;
}
.form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
label .required {
  color: var(--accent);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(212, 160, 82, 0.08);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235e5e66' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: right;
  margin-top: 0.3rem;
}
.char-counter.near-limit {
  color: var(--accent);
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.3rem;
  display: none;
}
.form-error.visible {
  display: block;
}

.form-submit {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.btn-submit {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #000;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 15px rgba(212, 160, 82, 0.15);
}
.btn-submit:hover {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 160, 82, 0.3);
}
.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.form-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 300;
  margin-top: 1rem;
  text-align: center;
}

/* ---- Loading state ---- */
.audit-loading {
  display: none;
  text-align: center;
  padding: 4rem 0;
}
.audit-loading.visible {
  display: block;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ---- Results section ---- */
.audit-results {
  display: none;
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 5rem;
}
.audit-results.visible {
  display: block;
}
.results-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.results-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.results-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
}

/* ---- Result cards ---- */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s;
}
.result-card:hover {
  border-color: var(--accent-dim);
}
.result-card-num,
.card-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.result-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.result-card p,
.result-card-content {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
}

/* ---- Highlight boxes ---- */
.highlight-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}
.highlight-box .label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.highlight-box .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.highlight-box-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.highlight-box-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.highlight-box-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-weight: 300;
}

/* ---- Metrics grid ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

/* ---- Opportunities list ---- */
.opportunities-list {
  margin-top: 1rem;
}
.opportunity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.opportunity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.opportunity-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 0.15rem;
  flex-shrink: 0;
}
.opportunity-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.opportunity-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- Timeline note ---- */
.timeline-note {
  font-size: 0.85rem;
  color: var(--accent);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ---- Flowchart ---- */
.flowchart {
  background: var(--surface-hover);
  border-radius: 12px;
  padding: 1.75rem;
  margin: 1.5rem 0;
}
.flowchart-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Pipeline (vertical steps with line) */
.flowchart-pipeline {
  margin-bottom: 1.5rem;
}
.pipeline-step {
  display: flex;
  gap: 1rem;
  min-height: 60px;
}
.pipeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 32px;
}
.pipeline-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pipeline-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  min-height: 20px;
}
.pipeline-content {
  padding-bottom: 1.25rem;
  flex: 1;
}
.pipeline-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.pipeline-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Outcomes */
.flowchart-outcomes-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.flowchart-outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.flow-outcome {
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.flow-outcome.success {
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.2);
}
.flow-outcome.warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.flow-outcome.error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.outcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.outcome-label {
  font-size: 0.85rem;
  font-weight: 600;
}
.flow-outcome.success .outcome-label { color: var(--success); }
.flow-outcome.warning .outcome-label { color: #f59e0b; }
.flow-outcome.error .outcome-label { color: var(--danger); }
.outcome-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.outcome-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Stats */
.flowchart-stats {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.flow-stat {
  text-align: center;
}
.flow-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--success);
  line-height: 1;
}
.flow-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Recommended Reading ---- */
.reading-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.reading-item {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s;
}
.reading-item:hover {
  border-color: var(--accent-dim);
}
.reading-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.reading-reason {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- CTAs ---- */
.audit-ctas {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.audit-ctas .btn-primary {
  background: var(--accent);
  color: #000;
  padding: 0.8rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.audit-ctas .btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 160, 82, 0.2);
}
.audit-ctas .btn-outline {
  background: transparent;
  color: var(--text-muted);
  padding: 0.8rem 1.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-body);
}
.audit-ctas .btn-outline:hover,
.audit-ctas .btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}
.audit-ctas .btn-secondary {
  background: transparent;
  color: var(--text-muted);
  padding: 0.8rem 1.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .audit-form-card {
    padding: 1.75rem 1.25rem;
  }
  .form-row-half {
    grid-template-columns: 1fr;
  }
  .audit-ctas {
    flex-direction: column;
    align-items: stretch;
  }
  .audit-ctas .btn-primary,
  .audit-ctas .btn-outline {
    justify-content: center;
  }
  .flowchart-stats {
    gap: 1.5rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .audit-hero {
    padding: 3rem 0 2rem;
  }
}
