@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap");

/* SP Demo Builder — shell lifted verbatim from the Cumulus Experience Generator
   so the two apps read as one product family. App-specific components
   (sidenav, cards, table, modal, deploy steps) follow the same token language:
   primary blue #2a94d6 / gradient #47b4ea, green primary action #00ac5b,
   dark gradient footer, Open Sans headings, Salesforce Sans body. */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { min-height: 100%; }

body {
  font-family: "Salesforce Sans", Arial, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: #4f4f4f;
  display: flex;
  flex-direction: column;
}

a { color: #2a94d6; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  background: linear-gradient(135deg, #2a94d6 0%, #47b4ea 100%);
  color: white;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  flex-shrink: 0;
}
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.header-logo { height: 60px; width: auto; }
.header-text { text-align: left; }
header h1 {
  font-family: "Open Sans", sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
}
header p {
  font-family: "Salesforce Sans", Arial, sans-serif;
  font-size: 16px;
  opacity: 0.95;
  margin: 0;
}

/* Secondary Navigation Bar */
.component-control-bar {
  background: #efefef;
  padding: 20px 40px;
  border-bottom: 3px solid #2a94d6;
  margin: 0;
  width: 100%;
  flex-shrink: 0;
}
.control-bar-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.control-bar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.control-bar-right { display: flex; align-items: center; gap: 12px; }

/* Main content area */
main#app {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 40px;
  min-height: 0;
}

/* Footer */
.app-footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: white;
  padding: 20px 40px;
  text-align: center;
  flex-shrink: 0;
}
.app-footer p { margin: 4px 0; font-size: 13px; opacity: 0.85; }

/* --- Control-bar nav tabs (New Demo / Manage / Connected Orgs) --- */
.nav-tab {
  font-family: "Salesforce Sans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid #2a94d6;
  border-radius: 6px;
  background: #fff;
  color: #2a94d6;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}
.nav-tab:hover { background: #f3f9fc; }
.nav-tab.active {
  background: #2a94d6;
  color: #fff;
  box-shadow: 0 2px 6px rgba(42, 148, 214, 0.3);
}
.user-email { font-size: 13px; font-weight: 600; color: #4f4f4f; white-space: nowrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Salesforce Sans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
}
/* Primary = green action (matches Download button in the sibling app). */
.btn.primary, .btn:not(.secondary):not(.danger):not(.google) {
  background: linear-gradient(135deg, #00ac5b 0%, #00965e 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 172, 91, 0.3);
}
.btn.primary:hover, .btn:not(.secondary):not(.danger):not(.google):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 172, 91, 0.4);
  background: linear-gradient(135deg, #009350 0%, #007d48 100%);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
/* Secondary = blue-outline pill. */
.btn.secondary {
  background: #fff;
  color: #2a94d6;
  border: 1px solid #2a94d6;
  box-shadow: none;
  padding: 10px 18px;
}
.btn.secondary:hover { background: #f3f9fc; transform: none; box-shadow: 0 0 0 3px rgba(42,148,214,0.15); }
.btn.danger { background: #ba0517; color: #fff; box-shadow: none; }
.btn.danger:hover { background: #970414; transform: none; }
.btn.google { background: #fff; color: #3c4043; border: 1px solid #d1d5db; box-shadow: none; }
.btn.google:hover { background: #f8f9fa; transform: none; }
.btn.small { padding: 8px 14px; font-size: 13px; }

/* --- Cards / panels --- */
.card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.card h2 {
  font-family: "Open Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #2b3a4a;
  margin-bottom: 6px;
}
.card h3 {
  font-family: "Open Sans", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #2b3a4a;
  margin-bottom: 8px;
}
.centered-gate { max-width: 480px; margin: 6vh auto 0; }

/* --- Forms (config-panel token language) --- */
label { display: block; font-weight: 600; font-size: 14px; color: #4f4f4f; margin: 16px 0 6px; }
input[type="text"], input[type="url"], select, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-family: "Salesforce Sans", Arial, sans-serif;
  font-size: 15px;
  background: #fff;
  color: #4f4f4f;
}
input[type="color"] {
  width: 100%;
  min-height: 2.75rem;
  padding: 4px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2a94d6;
  box-shadow: 0 0 0 3px rgba(42, 148, 214, 0.15);
}
.field-row { display: flex; gap: 16px; }
.field-row > div { flex: 1; }

/* --- Status / prerequisites list --- */
.check-list { list-style: none; padding: 0; margin: 8px 0; }
.check-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.ok { background: #2e844a; }
.status-dot.err { background: #ba0517; }
.status-dot.unknown { background: #b0b7c0; }

/* --- Deploy progress steps --- */
.steps { list-style: none; padding: 0; margin: 16px 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: #6b7280; font-size: 14px; }
.steps li::before { content: "○"; }
.steps li.done { color: #2e844a; }
.steps li.done::before { content: "●"; }
.steps li.active { color: #2a94d6; font-weight: 600; }
.steps li.active::before { content: "◐"; }
.steps li.error { color: #ba0517; }
.steps li.error::before { content: "✕"; }

/* --- Table (Manage Demos) --- */
table.demos { width: 100%; border-collapse: collapse; }
table.demos th, table.demos td {
  text-align: left; padding: 12px 8px; border-bottom: 1px solid #e8eaed; font-size: 14px;
}
table.demos th {
  color: #6b7280; font-weight: 700; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.05em;
}
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge.active { background: #e3f6e9; color: #2e844a; }
.badge.error { background: #fdeaea; color: #ba0517; }
.badge.deleted { background: #eef0f3; color: #6b7280; }
.badge.deleting { background: #eaf4fc; color: #17618e; }

/* Live delete progress bar (Manage Demos). */
.progress-track { height: 8px; background: #e6ebf0; border-radius: 999px; overflow: hidden; margin-top: 6px; position: relative; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2a94d6, #47b4ea); border-radius: 999px; transition: width .4s ease; }
/* Indeterminate: a stripe that slides continuously so the SE SEES it working
   even when a step is waiting on the org (prevents "is it stuck?" button spam). */
.progress-track.indeterminate .progress-fill {
  width: 40% !important;
  position: absolute; left: 0;
  animation: sp-indeterminate 1.1s ease-in-out infinite;
}
@keyframes sp-indeterminate {
  0%   { left: -40%; }
  100% { left: 100%; }
}
/* Deleting badge: a subtle pulse so the row status reads as "in progress". */
.badge.deleting { animation: sp-pulse 1.2s ease-in-out infinite; }
@keyframes sp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%;
  animation: sp-spin .7s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px; padding: 28px 32px;
  max-width: 540px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal .id-list {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: #f5f7fa; padding: 12px; border-radius: 8px; white-space: pre-wrap;
  max-height: 200px; overflow: auto; margin-top: 8px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* --- Banners --- */
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.banner.error { background: #fdeaea; color: #ba0517; border: 1px solid #f5c2c2; }
.banner.ok { background: #e3f6e9; color: #2e844a; border: 1px solid #b7e4c5; }
.banner.info { background: #eaf4fc; color: #17618e; border: 1px solid #bfddf5; }
.banner.success { background: #e3f6e9; color: #2e844a; border: 1px solid #b7e4c5; }
.banner.warn { background: #fef5e7; color: #8a5a00; border: 1px solid #f5d99a; }

/* New Demo: two source paths (configure vs upload). */
.config-fields { transition: opacity .2s ease; }
.config-fields.dimmed { opacity: .4; pointer-events: none; }
.config-fields-head { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0.25rem 0 0.5rem; }
.upload-card { border: 1px dashed #bcccdc; background: #f8fafc; }
.upload-card.active { border-color: #2e844a; background: #f2fbf5; }
.upload-btn { width: 100%; }

.hosted-url {
  background: #f5f7fa; border: 1px solid #d1d5db; border-radius: 10px;
  padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all;
}

.hidden { display: none !important; }
.muted { color: #6b7280; }
.small { font-size: 13px; }

/* ---- Guided journey: stepper header ---- */
.stepper { display: flex; align-items: center; gap: 0; margin: 4px 0 28px; }
.step-node { display: flex; align-items: center; gap: 10px; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; border: 2px solid #c7d0da; background: #fff; color: #6b7280;
}
.step-label { font-size: 14px; font-weight: 600; color: #6b7280; white-space: nowrap; }
.step-line { flex: 1; height: 2px; background: #d7dee6; margin: 0 14px; min-width: 24px; }
.step-node.active .step-dot { border-color: #2a94d6; color: #2a94d6; box-shadow: 0 0 0 4px rgba(42,148,214,.15); }
.step-node.active .step-label { color: #2a94d6; }
.step-node.done .step-dot { border-color: #00ac5b; background: #00ac5b; color: #fff; }
.step-node.done .step-label { color: #2e844a; }
.step-hint { font-size: 14px; color: #6b7280; margin: -2px 0 18px; }
.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ---- Readiness (Step 1) ---- */
.readiness-list { list-style: none; padding: 0; margin: 12px 0 4px; }
.readiness-list li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e8eaed; }
.readiness-list li:last-child { border-bottom: none; }
.rd-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff;
}
.rd-icon.ok { background: #00ac5b; }
.rd-icon.err { background: #ba0517; }
.rd-icon.info { background: #2a94d6; }
.rd-icon.checking { background: #c7d0da; }
.rd-graph-field { margin-top: 8px; }
.rd-graph-field input { max-width: 420px; }
.rd-body { flex: 1; }
.rd-title { font-weight: 600; color: #2b3a4a; font-size: 15px; }
.rd-detail { font-size: 13px; color: #6b7280; margin-top: 2px; }
.rd-fix { font-size: 13px; margin-top: 6px; padding: 8px 12px; border-radius: 8px; background: #fef5e7; color: #8a5a00; border: 1px solid #f5d99a; }
.rd-summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; margin-top: 18px; }
.rd-summary.ready { background: #e3f6e9; color: #2e844a; border: 1px solid #b7e4c5; }
.rd-summary.notready { background: #fef5e7; color: #8a5a00; border: 1px solid #f5d99a; }

/* ---- Source choice (Step 2) ---- */
.source-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 4px; }
/* Gated until the demo name is entered — dim + block interaction. */
.source-choice.gated { opacity: 0.45; filter: grayscale(0.4); pointer-events: none; }
.source-opt {
  border: 2px solid #d7dee6; border-radius: 12px; padding: 18px 18px 16px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; background: #fff;
}
.source-opt:hover { border-color: #2a94d6; }
.source-opt.selected { border-color: #2a94d6; background: #f3f9fc; box-shadow: 0 0 0 3px rgba(42,148,214,.12); }
.source-opt .so-title { font-weight: 700; color: #2b3a4a; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.source-opt .so-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #b0b7c0; flex-shrink: 0; }
.source-opt.selected .so-radio { border-color: #2a94d6; background: radial-gradient(circle, #2a94d6 0 5px, #fff 6px 100%); }
.source-opt .so-desc { font-size: 13px; color: #6b7280; margin-top: 6px; }
.source-panel { margin-top: 20px; padding-top: 4px; }

/* ---- Post-deploy WPM guide ---- */
.guide-hero { background: linear-gradient(135deg, #e3f6e9 0%, #f2fbf5 100%); border: 1px solid #b7e4c5; border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; }
.guide-hero h3 { color: #1b6b3a; }
.guide-step { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #e8eaed; }
.guide-step:last-child { border-bottom: none; }
.guide-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: #2a94d6; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.guide-num.tip { background: #8a5a00; }
.guide-body { flex: 1; }
.guide-body .gb-title { font-weight: 700; color: #2b3a4a; font-size: 15px; }
.guide-body .gb-text { font-size: 13.5px; color: #4f4f4f; margin-top: 4px; line-height: 1.5; }
.guide-body .gb-text code { background: #eef2f6; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.pill-note { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: #fff4dd; color: #8a5a00; margin-left: 8px; }

/* ---- Handoff / download-first callouts (flex icon layout) ---- */
.callout-flex { display: flex; gap: 10px; align-items: flex-start; }
.callout-flex .callout-icon { font-size: 18px; line-height: 1; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .source-choice { grid-template-columns: 1fr; }
  header { padding: 24px 20px; }
  .header-content { flex-direction: column; gap: 12px; }
  .header-text { text-align: center; }
  main#app { padding: 20px; }
  .component-control-bar { padding: 16px 20px; }
  .control-bar-content { flex-direction: column; align-items: stretch; gap: 12px; }
  .field-row { flex-direction: column; gap: 0; }
}
