/**
 * Frisby Live Demo — 6-Agent Guided Tour Styles
 * Dark theme matching site design.
 */

/* ── TOUR BAR ── */
.ld-tour-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #1a1a2e;
  overflow-x: auto;
}
.ld-tour-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
}
.ld-tour-step {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .2s;
}
.ld-tour-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1a1a2e;
  border: 2px solid #2a2a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #555;
  transition: all .3s;
  flex-shrink: 0;
}
.ld-tour-label {
  font-size: .75rem;
  color: #555;
  font-weight: 500;
  transition: color .3s;
}
.ld-tour-step.active .ld-tour-num {
  background: #007BFF;
  border-color: #007BFF;
  color: #fff;
}
.ld-tour-step.active .ld-tour-label { color: #93c5fd; }
.ld-tour-step.done .ld-tour-num {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.ld-tour-step.done .ld-tour-label { color: #86efac; }
.ld-tour-connector {
  width: 24px;
  height: 2px;
  background: #2a2a4a;
  flex-shrink: 0;
  transition: background .3s;
}
.ld-tour-connector.done { background: #22c55e; }
.ld-tour-controls { flex-shrink: 0; }
.ld-tour-auto {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #2a2a4a;
  background: transparent;
  color: #888;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.ld-tour-auto:hover { border-color: #007BFF; color: #93c5fd; }
.ld-tour-auto.active {
  background: rgba(0,123,255,.12);
  border-color: #007BFF;
  color: #93c5fd;
}

/* ── TABS ── */
.ld-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #2a2a4a;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ld-tabs::-webkit-scrollbar { display: none; }
.ld-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #666;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.ld-tab:hover { color: #ccc; background: rgba(0,123,255,.04); }
.ld-tab.active { color: #93c5fd; border-bottom-color: #007BFF; }

/* ── PANELS ── */
.ld-panel { display: none; animation: ldFadeIn .35s ease; }
.ld-panel.active { display: block; }
@keyframes ldFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.ld-panel-intro { margin-bottom: 24px; }
.ld-title {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.ld-desc { color: #888; font-size: .85rem; max-width: 640px; }
.ld-empty { text-align: center; padding: 48px 24px; color: #555; font-size: .9rem; }
.ld-nav-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #1a1a2e;
}

/* Shared form elements */
.ld-label { display: block; color: #aaa; font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.ld-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid #2a2a4a;
  background: #0d0d1a;
  color: #ddd;
  font-size: .85rem;
}
.ld-textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #2a2a4a;
  background: #0d0d1a;
  color: #ddd;
  font-size: .85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}
.ld-textarea:focus, .ld-select:focus { outline: none; border-color: #007BFF; }
.ld-textarea::placeholder { color: #444; }
.ld-form-row { margin-bottom: 12px; }

/* Buttons */
.ld-btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid #2a2a4a;
  background: #111;
  color: #aaa;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ld-btn:hover { border-color: #4a4a6a; color: #ddd; }
.ld-btn:disabled { opacity: .5; cursor: not-allowed; }
.ld-btn-primary {
  background: #007BFF;
  border-color: #007BFF;
  color: #fff;
}
.ld-btn-primary:hover { background: #1a8cff; }
.ld-btn-lg { padding: 14px 28px; font-size: .95rem; }
.ld-btn-row { display: flex; gap: 8px; margin-top: 12px; margin-bottom: 12px; }

/* Progress */
.ld-progress {
  height: 4px;
  background: #1a1a2e;
  border-radius: 4px;
  margin-bottom: 6px;
  overflow: hidden;
}
.ld-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #007BFF, #5ba3e6);
  border-radius: 4px;
  transition: width .4s ease;
}
.ld-status { font-size: .78rem; color: #666; }

/* Gauge */
.ld-gauge-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.ld-gauge-svg { width: 100%; height: 100%; }
.ld-gauge-arc { transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1); }
.ld-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ld-gauge-val { font-size: 1.6rem; font-weight: 800; color: #fff; }
.ld-gauge-label { font-size: .65rem; color: #888; text-transform: uppercase; letter-spacing: .05em; }

/* Dimension bars */
.ld-dims { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.ld-dim { display: flex; align-items: center; gap: 10px; }
.ld-dim-name { width: 80px; font-size: .78rem; color: #888; flex-shrink: 0; }
.ld-dim-track { flex: 1; height: 6px; background: #1a1a2e; border-radius: 4px; overflow: hidden; }
.ld-dim-fill { height: 100%; width: 0; border-radius: 4px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.ld-dim-val { width: 28px; text-align: right; font-size: .78rem; font-weight: 600; color: #ddd; }

/* Findings */
.ld-findings { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.ld-finding {
  padding: 12px 16px;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s;
}
.ld-finding.visible { opacity: 1; transform: translateY(0); }
.ld-finding-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ld-finding-title { font-size: .85rem; font-weight: 600; color: #ddd; }
.ld-finding-desc { font-size: .78rem; color: #888; }

/* Badges */
.ld-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.ld-badge-critical { background: rgba(239,68,68,.15); color: #fca5a5; }
.ld-badge-high { background: rgba(251,146,60,.15); color: #fdba74; }
.ld-badge-medium { background: rgba(234,179,8,.15); color: #fbbf24; }
.ld-badge-low { background: rgba(34,197,94,.15); color: #86efac; }

/* Score badge (inline) */
.ld-score-badge {
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  color: #fb923c;
  margin-left: 8px;
}
.ld-score-pending { color: #5a6a80; }

/* Column head */
.ld-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 12px;
}
.ld-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ld-dot-red { background: #ef4444; }
.ld-dot-green { background: #22c55e; }

/* Doc block */
.ld-doc-block {
  padding: 16px;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  font-size: .82rem;
  color: #bbb;
  line-height: 1.7;
}

/* ── AUDITOR ── */
.ld-auditor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: flex-start;
}
.ld-auditor-input { position: sticky; top: 80px; }
.ld-auditor-results { min-height: 200px; transition: opacity .35s ease; }
.ld-results-top { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }

/* ── REMEDIATION ── */
.ld-remed-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: flex-start;
}
.ld-remed-col { min-width: 0; }
.ld-remed-arrow {
  color: #555;
  font-size: 1.5rem;
  padding-top: 48px;
  flex-shrink: 0;
}
.ld-hl-remove {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  text-decoration: line-through;
  padding: 1px 3px;
  border-radius: 3px;
}
.ld-hl-add {
  background: rgba(34,197,94,.12);
  color: #86efac;
  padding: 1px 3px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity .5s ease;
}
.ld-hl-add.visible { opacity: 1; }

/* ── COMPARISON ── */
.ld-comp-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.ld-comp-col { min-width: 0; }
.ld-comp-lines { display: flex; flex-direction: column; gap: 0; }
.ld-comp-line {
  padding: 6px 10px;
  font-size: .8rem;
  color: #bbb;
  border-left: 3px solid transparent;
  transition: all .3s ease;
}
.ld-comp-line.ld-diff-remove {
  background: rgba(239,68,68,.08);
  border-left-color: #ef4444;
  color: #fca5a5;
  text-decoration: line-through;
}
.ld-comp-line.ld-diff-add {
  background: rgba(34,197,94,.08);
  border-left-color: #22c55e;
  color: #86efac;
}
.ld-comp-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.ld-comp-stat { text-align: center; }
.ld-comp-stat-val { display: block; font-size: 1.4rem; font-weight: 800; }
.ld-comp-stat-label { font-size: .7rem; color: #666; text-transform: uppercase; letter-spacing: .04em; }
.ld-green { color: #22c55e; }
.ld-red { color: #ef4444; }
.ld-blue { color: #93c5fd; }

/* ── REPORT ── */
.ld-report-wrap { max-width: 640px; }
.ld-report-doc {
  padding: 24px;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  min-height: 200px;
}
.ld-report-section {
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s, transform .4s;
}
.ld-report-section.visible { opacity: 1; transform: translateY(0); }
.ld-report-section h4 { color: #93c5fd; font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.ld-report-finding {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: .78rem;
  color: #bbb;
}
.ld-report-list {
  list-style: none;
  padding: 0;
  margin: 4px 0;
}
.ld-report-list li {
  font-size: .78rem;
  color: #8a9ab8;
  margin: 4px 0;
  padding-left: 16px;
  position: relative;
}
.ld-report-list li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: #3b82f6;
}
.ld-report-line {
  height: 8px;
  background: #1a1a2e;
  border-radius: 4px;
  margin: 6px 0;
  position: relative;
  overflow: hidden;
}
.ld-report-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #2a2a4a, #3a3a5a);
  transform: translateX(-100%);
  transition: transform .6s ease;
}
.ld-report-line.filled::after { transform: translateX(0); }
.ld-report-exports {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.ld-export-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #2a2a4a;
  background: transparent;
  color: #888;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  transition: all .3s;
}
.ld-export-btn.visible { opacity: 1; transform: translateY(0); }
.ld-export-btn:hover { border-color: #007BFF; color: #93c5fd; }

/* ── POLICY ── */
.ld-policy-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ld-pill-group {
  display: flex;
  gap: 6px;
}
.ld-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #2a2a4a;
  background: transparent;
  color: #888;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.ld-pill:hover { border-color: #4a4a6a; color: #ccc; }
.ld-pill.active {
  background: rgba(0,123,255,.12);
  border-color: #007BFF;
  color: #93c5fd;
}
.ld-policy-output {
  padding: 20px;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  min-height: 120px;
}
.ld-policy-section {
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s, transform .4s;
}
.ld-policy-section.visible { opacity: 1; transform: translateY(0); }
.ld-policy-section h5 { color: #93c5fd; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.ld-policy-section p { font-size: .8rem; color: #aaa; line-height: 1.6; }
.ld-policy-section ul { list-style: none; padding: 0; }
.ld-policy-section li {
  font-size: .8rem;
  color: #aaa;
  padding: 3px 0 3px 16px;
  position: relative;
}
.ld-policy-section li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: #007BFF;
}
.ld-policy-counter {
  margin-top: 12px;
  font-size: .8rem;
  color: #22c55e;
  font-weight: 600;
  opacity: 0;
  transition: opacity .4s;
}
.ld-policy-counter.visible { opacity: 1; }

/* ── UNDERWRITING ── */
.ld-uw-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: flex-start;
}
.ld-uw-doc {
  position: relative;
  padding: 16px;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
}
.ld-uw-line { padding: 3px 0; font-size: .82rem; color: #bbb; }
.ld-uw-hl {
  padding: 1px 4px;
  border-radius: 3px;
  transition: all .4s ease;
}
.ld-uw-hl.visible {
  background: rgba(234,179,8,.15);
  color: #fbbf24;
}
.ld-uw-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #007BFF, transparent);
  opacity: 0;
  transition: none;
}
.ld-uw-scanline.active {
  opacity: 1;
  animation: ldScanDown 2s ease-out forwards;
}
@keyframes ldScanDown {
  from { top: 0; }
  to { top: 100%; }
}
.ld-uw-analysis { display: flex; flex-direction: column; gap: 16px; }
.ld-uw-gauge { width: 120px; height: 120px; position: relative; margin: 0 auto; }
.ld-uw-conf {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ld-uw-conf-label { font-size: .75rem; color: #888; width: 72px; flex-shrink: 0; }
.ld-uw-conf-track { flex: 1; height: 6px; background: #1a1a2e; border-radius: 4px; overflow: hidden; }
.ld-uw-conf-fill {
  height: 100%;
  width: 0;
  background: #22c55e;
  border-radius: 4px;
  transition: width .8s ease;
}
.ld-uw-conf-val { font-size: .78rem; font-weight: 600; color: #ddd; width: 36px; text-align: right; }
.ld-uw-factors { display: flex; flex-direction: column; gap: 8px; }
.ld-uw-factor {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .3s, transform .3s;
}
.ld-uw-factor.visible { opacity: 1; transform: translateX(0); }
.ld-uw-factor-name { width: 90px; font-size: .75rem; color: #888; flex-shrink: 0; }
.ld-uw-factor-track { flex: 1; height: 6px; background: #1a1a2e; border-radius: 4px; overflow: hidden; }
.ld-uw-factor-fill { height: 100%; width: 0; border-radius: 4px; transition: width .7s ease; }
.ld-uw-factor-val { width: 24px; text-align: right; font-size: .75rem; font-weight: 600; color: #ddd; }
.ld-uw-verdict {
  padding: 14px 18px;
  background: rgba(234,179,8,.08);
  border: 1px solid rgba(234,179,8,.25);
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s, transform .4s;
}
.ld-uw-verdict.visible { opacity: 1; transform: translateY(0); }
.ld-uw-verdict-icon { font-size: 1.2rem; display: block; margin-bottom: 4px; }
.ld-uw-verdict-text { display: block; font-size: .88rem; font-weight: 600; color: #fbbf24; }
.ld-uw-verdict-sub { display: block; font-size: .72rem; color: #888; margin-top: 4px; }

/* ── CTA ── */
.ld-cta {
  text-align: center;
  padding: 48px 24px;
  margin-top: 40px;
  background: linear-gradient(135deg, rgba(0,123,255,.06), rgba(91,163,230,.04));
  border: 1px solid #1a1a2e;
  border-radius: 16px;
}
.ld-cta-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}
.ld-cta-desc {
  color: #888;
  font-size: .95rem;
  margin-bottom: 24px;
}
.ld-cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .ld-auditor-layout,
  .ld-uw-layout {
    grid-template-columns: 1fr;
  }
  .ld-auditor-input { position: static; }
  .ld-remed-layout {
    grid-template-columns: 1fr;
  }
  .ld-remed-arrow { display: none; }
  .ld-comp-layout { grid-template-columns: 1fr; }
  .ld-tour-label { display: none; }
  .ld-tour-connector { width: 12px; }
}
/* Try with Real AI CTA button */
.ld-try-real {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(34,197,94,0.04));
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 8px;
  color: #22c55e;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}
.ld-try-real:hover {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.08));
  border-color: #22c55e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34,197,94,0.15);
  text-decoration: none;
  color: #22c55e;
}

@media (max-width: 640px) {
  .ld-tabs { gap: 0; }
  .ld-tab { padding: 10px 12px; font-size: .78rem; }
  .ld-comp-stats { gap: 16px; }
  .ld-nav-row { flex-direction: column; }
  .ld-policy-controls { flex-direction: column; align-items: flex-start; }
}
