/* Guided demo layer aligned with the canonical Public Tender UI. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./public-tender-client-demo/assets/PlusJakartaSans-VariableFont_wght.ttf") format("truetype");
  font-display: swap;
}

:root {
  --demo-primary: #185fee;
  --demo-primary-hover: #124bc5;
  --demo-primary-soft: #edf4ff;
  --demo-ink: #0f172a;
  --demo-muted: #58677a;
  --demo-surface: #ffffff;
  --demo-surface-muted: #f6f8fb;
  --demo-border: #e2e8f0;
  --demo-overlay: rgba(15, 23, 42, 0.58);
  --demo-focus: 0 0 0 3px rgba(24, 95, 238, 0.22);
  --demo-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body.monico-demo-active {
  padding-top: 53px !important;
}

#monico-demo-topbar,
#monico-tour-card,
#monico-demo-toast {
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

#monico-demo-topbar *,
#monico-tour-card *,
#monico-demo-toast * {
  box-sizing: border-box;
}

/* Product header */
#monico-demo-topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 99999;
  display: flex;
  height: 53px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  color: var(--demo-ink);
  background: var(--demo-surface);
  border-bottom: 1px solid var(--demo-border);
  user-select: none;
}

#monico-demo-topbar .demo-topbar-left,
#monico-demo-topbar .demo-topbar-right,
#monico-demo-topbar .demo-topbar-center,
#monico-demo-topbar .demo-logo-badge,
#monico-demo-topbar .demo-nav-links {
  display: flex;
  align-items: center;
}

#monico-demo-topbar .demo-topbar-left {
  min-width: 0;
  gap: 18px;
}

#monico-demo-topbar .demo-logo-badge {
  flex: 0 0 auto;
  gap: 8px;
  color: var(--demo-ink);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}

#monico-demo-topbar .demo-logo-badge:focus-visible {
  outline: none;
  box-shadow: var(--demo-focus);
}

#monico-demo-topbar .demo-logo-badge img {
  width: 92px;
  height: 24px;
  object-fit: contain;
}

#monico-demo-topbar .demo-logo-badge span {
  padding-left: 9px;
  color: var(--demo-muted);
  border-left: 1px solid var(--demo-border);
  font-size: 10px;
  font-weight: 700;
}

#monico-demo-topbar .demo-nav-links {
  gap: 2px;
  padding: 3px;
  background: var(--demo-surface-muted);
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

#monico-demo-topbar .demo-nav-links::-webkit-scrollbar {
  display: none;
}

.demo-nav-item {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  color: var(--demo-muted);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}

.demo-nav-item:hover {
  color: var(--demo-ink);
  background: var(--demo-surface);
}

.demo-nav-item:focus-visible,
.demo-btn:focus-visible,
#monico-tour-card button:focus-visible {
  outline: none;
  box-shadow: var(--demo-focus);
}

.demo-nav-item.active {
  color: #ffffff;
  background: var(--demo-primary);
}

#monico-demo-topbar .demo-topbar-center {
  min-width: 210px;
  justify-content: center;
  gap: 10px;
}

#monico-demo-topbar .demo-progress-text {
  max-width: 170px;
  overflow: hidden;
  color: var(--demo-muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#monico-demo-topbar .demo-progress-bar-wrap {
  width: 80px;
  height: 4px;
  overflow: hidden;
  background: #dbe3ee;
  border-radius: 999px;
}

#monico-demo-topbar .demo-progress-bar-fill {
  width: 0;
  height: 100%;
  background: var(--demo-primary);
  border-radius: inherit;
  transition: width 240ms var(--demo-ease);
}

#monico-demo-topbar .demo-topbar-right {
  flex: 0 0 auto;
  gap: 7px;
}

.demo-back-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--demo-border);
  border-radius: 7px;
  color: var(--demo-muted);
  font: 600 11px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.demo-back-link:hover {
  color: var(--demo-primary);
  background: var(--demo-primary-soft);
  border-color: #b9cdf8;
}

.demo-back-link:focus-visible {
  outline: none;
  box-shadow: var(--demo-focus);
}

.demo-lang-switcher {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--demo-surface-muted);
  border: 1px solid var(--demo-border);
  border-radius: 7px;
}

.demo-lang-btn {
  display: inline-flex;
  min-width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--demo-muted);
  font: 700 10px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.demo-lang-btn:hover {
  color: var(--demo-ink);
}

.demo-lang-btn.active {
  color: #ffffff;
  background: var(--demo-ink);
}

.demo-lang-btn:focus-visible {
  outline: none;
  box-shadow: var(--demo-focus);
}

.demo-btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 600 11px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.demo-btn-primary {
  color: #ffffff;
  background: var(--demo-primary);
}

.demo-btn-primary:hover {
  background: var(--demo-primary-hover);
}

.demo-btn-secondary {
  color: var(--demo-ink);
  background: var(--demo-surface);
  border-color: var(--demo-border);
}

.demo-btn-secondary:hover {
  color: var(--demo-primary);
  background: var(--demo-primary-soft);
  border-color: #b9cdf8;
}

.demo-btn:disabled {
  color: #94a3b8;
  background: #eef2f7;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

/* Spotlight */
#monico-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  transition: opacity 200ms ease, visibility 200ms ease;
}

#monico-tour-overlay.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

#monico-tour-spotlight {
  position: fixed;
  z-index: 99992;
  opacity: 0;
  pointer-events: none;
  border: 2px solid var(--demo-primary);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px var(--demo-overlay), 0 0 0 5px rgba(24, 95, 238, 0.14);
  transition: inset 240ms var(--demo-ease), width 240ms var(--demo-ease), height 240ms var(--demo-ease), opacity 160ms ease;
}

#monico-tour-spotlight.active {
  opacity: 1;
}

#monico-tour-spotlight.pulse {
  animation: demo-focus-pulse 1.8s ease-in-out infinite;
}

@keyframes demo-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px var(--demo-overlay), 0 0 0 4px rgba(24, 95, 238, 0.12); }
  50% { box-shadow: 0 0 0 9999px var(--demo-overlay), 0 0 0 7px rgba(24, 95, 238, 0.2); }
}

/* Guided card */
#monico-tour-card {
  position: fixed;
  z-index: 99996;
  width: 400px;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  color: var(--demo-ink);
  background: var(--demo-surface);
  border: 1px solid var(--demo-border);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 220ms var(--demo-ease), visibility 180ms ease, top 240ms var(--demo-ease), left 240ms var(--demo-ease);
}

#monico-tour-card.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

#monico-tour-card .tour-card-header {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 16px;
  background: var(--demo-surface-muted);
  border-bottom: 1px solid var(--demo-border);
}

#monico-tour-card .tour-step-badge {
  display: inline-flex;
  align-items: center;
  color: var(--demo-primary);
  font-size: 11px;
  font-weight: 700;
}

#monico-tour-card .tour-close-btn {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--demo-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

#monico-tour-card .tour-close-btn:hover {
  color: var(--demo-ink);
  background: #e9eef5;
}

#monico-tour-card .tour-card-body {
  padding: 18px 18px 16px;
}

#monico-tour-card .tour-title {
  margin: 0 0 8px;
  color: var(--demo-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

#monico-tour-card .tour-description {
  max-width: 68ch;
  margin: 0;
  color: #465568;
  font-size: 13px;
  line-height: 1.58;
  text-wrap: pretty;
}

#monico-tour-card .tour-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--demo-surface-muted);
  border-top: 1px solid var(--demo-border);
}

#monico-tour-card .tour-footer-left,
#monico-tour-card .tour-footer-right {
  display: flex;
  align-items: center;
}

#monico-tour-card .tour-footer-left { gap: 5px; }
#monico-tour-card .tour-footer-right { gap: 7px; }

.tour-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  background: #cbd5e1;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: width 180ms var(--demo-ease), background-color 180ms ease;
}

.tour-dot.active {
  width: 18px;
  background: var(--demo-primary);
}

#monico-tour-card .tour-card-arrow {
  position: absolute;
  z-index: -1;
  width: 12px;
  height: 12px;
  pointer-events: none;
  background: var(--demo-surface);
  border: solid var(--demo-border);
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

#monico-tour-card[data-popper-placement="top"] .tour-card-arrow { bottom: -7px; left: 50%; }
#monico-tour-card[data-popper-placement="bottom"] .tour-card-arrow { top: -7px; left: 50%; transform: rotate(225deg); }
#monico-tour-card[data-popper-placement="left"] .tour-card-arrow { right: -7px; top: 50%; transform: rotate(-45deg); }
#monico-tour-card[data-popper-placement="right"] .tour-card-arrow { left: -7px; top: 50%; transform: rotate(135deg); }

/* Toast */
#monico-demo-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  display: flex;
  max-width: min(380px, calc(100vw - 24px));
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  visibility: hidden;
  opacity: 0;
  color: var(--demo-ink);
  background: var(--demo-surface);
  border: 1px solid var(--demo-border);
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  font-weight: 600;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 220ms var(--demo-ease), visibility 180ms ease;
}

#monico-demo-toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

#monico-demo-toast .toast-icon {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--demo-primary);
  border-radius: 999px;
}

/* Public Tender stays inside the same Monico shell. */
#public-tender-stage {
  position: fixed;
  inset: 53px 0 0;
  z-index: 99980;
  visibility: hidden;
  overflow: hidden;
  opacity: 0;
  background: var(--demo-surface-muted);
  transform: translateX(16px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 240ms var(--demo-ease), visibility 180ms ease;
}

#public-tender-stage.active {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

#public-tender-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: #ffffff;
  border: 0;
  transition: opacity 180ms ease;
}

#public-tender-stage.loaded iframe {
  opacity: 1;
}

#public-tender-stage .public-tender-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--demo-surface-muted);
}

#public-tender-stage.loaded .public-tender-loading {
  display: none;
}

#public-tender-stage .public-tender-loading span {
  width: 7px;
  height: 7px;
  background: var(--demo-primary);
  border-radius: 999px;
  animation: tender-loading 900ms ease-in-out infinite alternate;
}

#public-tender-stage .public-tender-loading span:nth-child(2) { animation-delay: 120ms; }
#public-tender-stage .public-tender-loading span:nth-child(3) { animation-delay: 240ms; }

@keyframes tender-loading {
  from { opacity: 0.25; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(-2px); }
}

#public-tender-stage .public-tender-close {
  position: absolute;
  top: 9px;
  left: 126px;
  z-index: 3;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  color: var(--demo-ink);
  background: #ffffff;
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  font: 600 11px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
}

#public-tender-stage .public-tender-close:hover {
  color: var(--demo-primary);
  background: var(--demo-primary-soft);
  border-color: #b9cdf8;
}

#public-tender-stage .public-tender-close:focus-visible {
  outline: none;
  box-shadow: var(--demo-focus);
}

body.public-tender-open #monico-demo-topbar .demo-topbar-center,
body.public-tender-open #monico-demo-topbar .demo-topbar-right {
  display: none;
}

@media (max-width: 1180px) {
  #monico-demo-topbar .demo-topbar-center { display: none; }
  #monico-demo-topbar .demo-logo-badge span { display: none; }
}

@media (max-width: 860px) {
  body.monico-demo-active { padding-top: 53px !important; }
  #monico-demo-topbar { gap: 8px; padding: 0 10px; }
  #monico-demo-topbar .demo-logo-badge { display: none; }
  #monico-demo-topbar .demo-topbar-left { flex: 1 1 auto; overflow: hidden; }
  #monico-demo-topbar .demo-nav-links { width: 100%; }
  #monico-demo-topbar .demo-btn-secondary { display: none; }
  #monico-demo-topbar .demo-btn span { display: none; }
  #monico-demo-topbar .demo-btn { width: 34px; padding: 7px; }
  #monico-demo-topbar .demo-topbar-right { gap: 5px; }
  .demo-back-link { height: 24px; padding: 0 6px; font-size: 9px; }
  .demo-lang-switcher { padding: 1px; gap: 1px; }
  .demo-lang-btn { min-width: 22px; height: 24px; padding: 0 4px; font-size: 9px; }
  #monico-tour-card { width: auto; right: 12px !important; left: 12px !important; }
  #public-tender-stage .public-tender-close { left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #monico-demo-topbar *,
  #monico-tour-card,
  #monico-tour-spotlight,
  #monico-demo-toast {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
