:root {
  --bai-demo-bg: #07111f;
  --bai-demo-panel: rgba(15, 23, 42, 0.86);
  --bai-demo-panel-2: rgba(8, 47, 73, 0.44);
  --bai-demo-border: var(--ba-border-muted, rgba(148, 163, 184, 0.22));
  --bai-demo-text: var(--ba-neutral-50, #f8fafc);
  --bai-demo-muted: #b6c6d8;
  --bai-demo-accent: #14b8a6;
  --bai-demo-accent-2: #38bdf8;
  --bai-demo-danger: #f97316;
  --bai-demo-shadow: 0 22px 70px rgba(2, 6, 23, 0.32);
}

.bai-live-demo {
  direction: rtl;
  margin: clamp(28px, 6vw, 76px) auto;
  padding: clamp(20px, 4vw, 44px);
  max-width: 1180px;
  color: var(--bai-demo-text);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.14), transparent 34%),
    linear-gradient(225deg, rgba(56, 189, 248, 0.12), transparent 42%),
    var(--bai-demo-bg);
  border: 1px solid var(--bai-demo-border);
  border-radius: var(--ba-radius-control, 8px);
  box-shadow: var(--bai-demo-shadow);
  font-family: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif;
  isolation: isolate;
}

.bai-demo-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-block-end: 24px;
}

.bai-demo-eyebrow,
.bai-demo-limit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.12);
  color: #99f6e4;
  font-size: 13px;
  font-weight: 800;
}

.bai-demo-head h1,
.bai-demo-head h2 {
  margin: 12px 0 8px;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: 0;
}

.bai-demo-head p {
  margin: 0;
  max-width: 760px;
  color: var(--bai-demo-muted);
  font-size: 16px;
  line-height: 1.9;
}

.bai-impact-row,
.bai-trust-strip,
.bai-sample-row,
.bai-mode-switch,
.bai-demo-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bai-impact-row {
  margin-block-start: 18px;
}

.bai-impact-row span,
.bai-trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.bai-impact-row strong {
  color: #fef3c7;
  font-size: 19px;
}

.bai-demo-stepper {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: bai-step;
}

.bai-demo-stepper li {
  counter-increment: bai-step;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.08);
  color: #ccfbf1;
  font-size: 13px;
  font-weight: 800;
}

.bai-demo-stepper li::before {
  content: counter(bai-step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.9);
  color: #04111f;
}

.bai-demo-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  align-items: start;
}

.bai-demo-form,
.bai-demo-output {
  min-width: 0;
  padding: clamp(16px, 2.6vw, 26px);
  border: 1px solid var(--bai-demo-border);
  border-radius: var(--ba-radius-control, 8px);
  background: linear-gradient(180deg, var(--bai-demo-panel), rgba(15, 23, 42, 0.72));
}

.bai-demo-fields {
  display: grid;
  gap: 14px;
}

.bai-mode-switch,
.bai-sample-row {
  margin-block-end: 14px;
}

.bai-mode-switch button,
.bai-sample-row button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(15, 23, 42, 0.66);
  color: #e2e8f0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.bai-mode-switch button.active,
.bai-sample-row button:hover {
  border-color: rgba(20, 184, 166, 0.58);
  background: rgba(20, 184, 166, 0.18);
  color: #ccfbf1;
}

.bai-demo-field label {
  display: block;
  margin-block-end: 7px;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 800;
}

.bai-demo-field input,
.bai-demo-field select,
.bai-demo-field textarea {
  width: 100%;
  min-block-size: var(--ba-tap-target-comfortable, 48px);
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--ba-radius-control, 8px);
  outline: none;
  background: rgba(2, 6, 23, 0.48);
  color: var(--ba-neutral-50, #f8fafc);
  font: inherit;
  line-height: 1.65;
}

.bai-demo-field textarea {
  min-height: 118px;
  resize: vertical;
}

.bai-demo-field input[type="file"] {
  padding: 10px;
  color: var(--bai-demo-muted);
}

.bai-demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 18px;
}

.bai-demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: var(--ba-tap-target-comfortable, 48px);
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: var(--ba-radius-control, 8px);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.bai-demo-btn:hover {
  transform: translateY(-1px);
}

.bai-demo-btn-primary {
  background: linear-gradient(135deg, var(--bai-demo-accent), var(--bai-demo-accent-2));
  color: #03111f;
}

.bai-demo-btn-soft {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
}

.bai-demo-btn-whatsapp {
  background: #16a34a;
  color: #ffffff;
}

.bai-demo-output {
  position: relative;
  overflow: hidden;
}

.bai-demo-output::after {
  content: "Bright AI Demo";
  position: absolute;
  inset-block-start: 42%;
  inset-inline-start: 50%;
  z-index: -1;
  color: rgba(148, 163, 184, 0.08);
  font-size: clamp(36px, 7vw, 92px);
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(50%) rotate(-12deg);
  pointer-events: none;
}

.bai-demo-empty,
.bai-demo-error {
  padding: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: var(--ba-radius-control, 8px);
  color: var(--bai-demo-muted);
  line-height: 1.9;
  background: rgba(2, 6, 23, 0.22);
}

.bai-privacy-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(244, 201, 93, 0.28);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(244, 201, 93, 0.08);
  color: #fde68a;
  font-size: 13px;
  line-height: 1.8;
}

.bai-demo-error {
  border-color: rgba(249, 115, 22, 0.42);
  color: #fed7aa;
}

.bai-demo-loading {
  display: grid;
  gap: 14px;
}

.bai-demo-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(148, 163, 184, 0.28);
  border-block-start-color: var(--bai-demo-accent-2);
  border-radius: 50%;
  animation: bai-spin 900ms linear infinite;
}

.bai-demo-skeleton {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(226, 232, 240, 0.28), rgba(148, 163, 184, 0.18));
  background-size: 200% 100%;
  animation: bai-shimmer 1.2s ease-in-out infinite;
}

.bai-demo-report {
  position: relative;
  display: grid;
  gap: 16px;
}

.bai-demo-report h3 {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
}

.bai-result-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.bai-score {
  display: grid;
  place-items: center;
  min-width: 128px;
  min-height: 110px;
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-radius: var(--ba-radius-control, 8px);
  background: radial-gradient(circle, rgba(20, 184, 166, 0.24), rgba(15, 23, 42, 0.72));
}

.bai-score strong {
  color: #ffffff;
  font-size: 40px;
  line-height: 1;
}

.bai-score span {
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
}

.bai-report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bai-demo-report-section {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(2, 6, 23, 0.26);
}

.bai-demo-report-section h4 {
  margin: 0 0 10px;
  color: #bae6fd;
  font-size: 15px;
}

.bai-demo-report-section p,
.bai-demo-report-section li {
  color: #dbeafe;
  line-height: 1.85;
}

.bai-demo-report-section ul,
.bai-demo-report-section ol {
  margin: 0;
  padding-inline-start: 20px;
}

.bai-demo-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bai-demo-kpi {
  padding: 14px;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(20, 184, 166, 0.1);
}

.bai-demo-kpi span {
  display: block;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
}

.bai-demo-kpi strong {
  display: block;
  margin-block-start: 6px;
  color: #ffffff;
  font-size: 22px;
}

.bai-demo-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--ba-radius-control, 8px);
}

.bai-demo-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.bai-demo-table th,
.bai-demo-table td {
  padding: 11px 12px;
  border-block-end: 1px solid rgba(148, 163, 184, 0.16);
  color: #dbeafe;
  text-align: start;
  vertical-align: top;
}

.bai-demo-table th {
  color: var(--ba-neutral-50, #f8fafc);
  background: rgba(15, 23, 42, 0.72);
  font-weight: 900;
}

.bai-demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 900;
}

.bai-demo-badge.high {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.bai-demo-badge.medium {
  background: rgba(249, 115, 22, 0.16);
  color: #fed7aa;
}

.bai-demo-badge.low {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.bai-demo-chart {
  min-height: 220px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(2, 6, 23, 0.26);
}

.bai-demo-bars {
  display: grid;
  gap: 10px;
}

.bai-demo-bar {
  display: grid;
  grid-template-columns: minmax(90px, 0.34fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: #dbeafe;
  font-size: 13px;
}

.bai-demo-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.bai-demo-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bai-demo-accent), var(--bai-demo-accent-2));
}

.bai-demo-watermark {
  color: #93c5fd;
  font-size: 12px;
  line-height: 1.8;
  border-block-start: 1px solid rgba(148, 163, 184, 0.18);
  padding-block-start: 12px;
}

.bai-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bai-audit-grid span {
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--ba-radius-control, 8px);
  background: rgba(15, 23, 42, 0.48);
}

.bai-audit-grid small {
  display: block;
  color: #93c5fd;
  font-weight: 800;
}

.bai-audit-grid strong {
  display: block;
  margin-block-start: 4px;
  color: var(--ba-neutral-50, #f8fafc);
  font-size: 13px;
}

.bai-upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 18px;
  direction: rtl;
}

.bai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.bai-modal-content {
  position: relative;
  width: min(480px, 100%);
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--ba-radius-control, 8px);
  background: #07111f;
  color: var(--ba-neutral-50, #f8fafc);
  box-shadow: var(--bai-demo-shadow);
}

.bai-modal-content h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.bai-modal-content p {
  color: var(--bai-demo-muted);
  line-height: 1.8;
}

.bai-modal-content a,
.bai-modal-content button {
  width: 100%;
  margin-block-start: 10px;
}

.bai-btn-whatsapp,
.bai-btn-services,
.bai-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--ba-radius-control, 8px);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.bai-btn-whatsapp {
  background: #16a34a;
  color: #ffffff;
}

.bai-btn-services {
  background: #38bdf8;
  color: #04111f;
}

.bai-btn-close {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

.live-demo-badge {
  background: rgba(20, 184, 166, 0.92) !important;
  color: #04111f !important;
  border-color: transparent !important;
}

.live-demo-btn {
  position: relative;
  overflow: hidden;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.8);
  animation: bai-pulse 1.4s infinite;
}

@keyframes bai-spin {
  to { transform: rotate(360deg); }
}

@keyframes bai-shimmer {
  to { background-position: -200% 0; }
}

@keyframes bai-pulse {
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@media (max-width: 860px) {
  .bai-demo-head,
  .bai-demo-grid {
    grid-template-columns: 1fr;
  }

  .bai-demo-limit {
    justify-self: start;
  }

  .bai-demo-kpis {
    grid-template-columns: 1fr;
  }

  .bai-result-top,
  .bai-report-columns,
  .bai-audit-grid {
    grid-template-columns: 1fr;
  }

  .bai-demo-actions .bai-demo-btn {
    width: 100%;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .bai-demo-output,
  .bai-demo-output * {
    visibility: visible;
  }

  .bai-demo-output {
    position: absolute;
    inset: 0;
    width: 100%;
    color: #111827;
    background: #ffffff;
  }
}
