/* The accessibility widget setup wizard (moved unchanged from css/accessibility-widget.css, used by accessibility-widget.ejs) */

/* ==============================================
   SETUP DIALOG OVERLAY
   ============================================== */

.setup-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.setup-dialog-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Hide global header when setup dialog is open */
body.setup-dialog-open .site-header {
  visibility: hidden;
  pointer-events: none;
}

.setup-dialog {
  display: flex;
  width: 100%;
  max-width: 1289px;
  min-height: 580px;
  max-height: 96vh;
  background-color: #ffffff;
  border-radius: 24px;
  border: 1px solid #e1e1e1;
  overflow: hidden;
  padding: 20px;
  gap: 20px;
}

/* ---- Sidebar ---- */

.setup-dialog-sidebar {
  display: flex;
  flex-direction: column;
  padding-top: 34px;
  padding-inline: 32px;
  border-radius: 16px;
  background-color: #f7f7f7;
}

.setup-dialog-sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  margin-bottom: 44px;
}

.setup-dialog-sidebar-logo-link {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.setup-dialog-sidebar-logo-link:hover {
  text-decoration: none;
  color: inherit;
}

.setup-dialog-sidebar-logo-link:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 2px;
  border-radius: 4px;
}

.setup-dialog-sidebar-logo {
  width: 121px;
  height: 28px;
  flex-shrink: 0;
}

.setup-dialog-sidebar-brand-sub {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #3c4045;
  letter-spacing: 0.02em;
  margin-left: 31px;
}

/* Steps list */

.setup-dialog-steps {
  flex: 1;
}

.setup-dialog-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each step item with connector line */

.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}

/* Vertical connector line between steps */

.setup-step-icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

.setup-step-connector {
  width: 2px;
  height: 44px;
  background-color: #e0e0e0;
  margin-top: 8px;
}

.setup-step:last-child .setup-step-connector {
  visibility: hidden;
}

.setup-step.active .setup-step-connector {
  background-color: #c8b0e8;
}

.setup-step-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  color: #3b3f44;
  background-color: transparent;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.setup-step.active .setup-step-icon {
  border-color: #8e56dc;
  color: #8e56dc;
}

.setup-step-icon svg {
  width: 31px;
  height: 31px;
}

.setup-step-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}

.setup-step-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #170b28;
  line-height: 1.3;
}

.setup-step.active .setup-step-title {
  color: #8e56dc;
}

.setup-step-desc {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: #5c5c5c;
  line-height: 1.4;
}

/* Sidebar actions: Back + Exit */

.setup-dialog-sidebar-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  width: 100%;
}

.setup-dialog-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  margin-right: auto;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #3c4045;
  background: none;
  border: none;
  cursor: pointer;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.setup-dialog-back:hover {
  color: #170b28;
  opacity: 0.8;
}

.setup-dialog-back:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Exit button */

.setup-dialog-exit {
  display: inline-block;
  width: fit-content;
  padding: 10px 0;
  margin-left: auto;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #3c4045;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  transition:
    color 0.2s ease,
    opacity 0.2s ease,
    text-decoration 0.2s ease;
  text-decoration: none;
}

.setup-dialog-exit:hover {
  color: #170b28;
  opacity: 0.8;
}

.setup-dialog-exit:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Main Content ---- */

.setup-dialog-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0px 56px;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
}

.setup-panels-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.setup-dialog-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
}

.setup-dialog-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #170b28;
  line-height: 1.25;
  margin: 0 0 10px 0;
}

.setup-dialog-desc {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  color: #5c5c5c;
  line-height: 1.55;
  max-width: 400px;
  margin: 0 0 28px 0;
}

/* Images row */

.setup-dialog-images {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  justify-content: center;
}

.setup-dialog-images img {
  object-fit: cover;
  border-radius: 16px;
}

/* Platform icons */

.setup-dialog-platforms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.setup-dialog-platform-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.setup-dialog-platform-icon:hover {
  opacity: 1;
}

.setup-dialog-platform-icon img {
  height: 22px;
  width: auto;
}

.setup-dialog-platform-icon svg {
  width: 22px;
  height: 22px;
}

/* CTA Button */

.setup-dialog-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  padding: 10px 48px;
  background-color: #8e56dc;
  color: #ffffff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  margin-bottom: 28px;
}

.link-bwe-start {
  margin-bottom: 28px;
}

.setup-dialog-cta:hover {
  background-color: #6a2fc4;
  box-shadow: 0 4px 20px rgba(123, 59, 214, 0.3);
  color: #ffffff;
  text-decoration: none;
}

.setup-dialog-cta:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 3px;
}

.setup-dialog-cta:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.setup-dialog-cta:disabled:hover {
  background-color: #8e56dc;
  box-shadow: none;
}

.setup-dialog-cta svg {
  width: 18px;
  height: 18px;
}

/* Segmented progress bar */

.setup-dialog-progress {
  display: flex;
  gap: 8px;
  width: 50%;
}

.setup-dialog-progress-segment {
  flex: 1;
  height: 5px;
  background-color: #e8e8e8;
  border-radius: 20px;
  overflow: hidden;
}

.setup-dialog-progress-segment.filled {
  background-color: #8e56dc;
}

/* ---- Step Panels ---- */

.setup-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.setup-panel.active {
  display: flex;
  flex: 1;
  min-height: 0;
  animation: setupSlideInForward 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.setup-panel.active.slide-back {
  animation-name: setupSlideInBack;
}

.setup-panel.active.no-animate {
  animation: none;
}

@keyframes setupSlideInForward {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes setupSlideInBack {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .setup-panel.active,
  .setup-panel.active.slide-back {
    animation: none;
  }
}

/* Panel top area (steps 2 & 3 headings) */

.setup-panel-top {
  max-width: 400px;
  text-align: left;
  margin-bottom: 28px;
}

.setup-panel-heading {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #3b3f44;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.setup-panel-subheading {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #707070;
  margin: 0;
  line-height: 1.5;
}

.setup-panel-divider {
  border-top: 2px solid #b5b5b5;
  margin: 16px 0 0 0;
}

/* Panel footer (CTA + progress) - pinned to bottom on all steps */

.setup-panel-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 24px;
}

/* Step 1: content area fills space above footer, content centered */

.setup-panel-step1-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
}

/* Step 3: content area fills space above footer, scrolls if needed */

.setup-panel-step3-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
}

/* ---- Step 2: Wrapper (panel top + site fields), fills space above footer ---- */

.setup-panel-step2-body {
  flex: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

/* ---- Step 2: Site fields ---- */

.setup-site-fields {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.setup-site-row {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.setup-site-input-wrap {
  flex: 1;
  min-width: 0;
}

.setup-remove-domain {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-top: 0;
  border: 1px solid #b8b8b8;
  border-radius: 10px;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.setup-remove-domain:hover {
  border-color: #8e56dc;
  color: #8e56dc;
  background-color: rgba(142, 86, 220, 0.08);
}

.setup-remove-domain:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 2px;
}

.setup-remove-domain svg {
  width: 20px;
  height: 20px;
}

.setup-site-input {
  width: 100%;
  padding: 8px 16px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  border: 1px solid #b8b8b8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease;
}

.setup-site-input::placeholder {
  color: #707070;
}

.setup-site-input:focus {
  border-color: #8e56dc;
}

.setup-site-input:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 1px;
}

.setup-site-error {
  display: block;
  margin-top: 6px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #b71c1c;
  min-height: 1.4em;
}

.setup-site-error:empty {
  margin-top: 0;
  min-height: 0;
}

.setup-add-another {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  max-width: 420px;
  padding: 8px 4px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #8e56dc;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.setup-add-another:hover {
  color: #5c28b0;
}

.setup-add-another:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 2px;
  border-radius: 4px;
}

.setup-add-another svg {
  width: 18px;
  height: 18px;
}

.setup-add-another:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  color: #9e9e9e;
}

.setup-add-another:disabled:hover {
  color: #9e9e9e;
}

/* ---- Step 3: Customize Layout ---- */

.setup-customize-layout {
  display: flex;
  gap: 20px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.setup-customize-settings {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.setup-customize-previews {
  width: 230px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  border: 0.54px solid #dddddd;
  gap: 14px;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px;
}

/* Appearance cards */

.setup-appearance-card {
  border: 0.54px solid #dddddd;
  border-radius: 12px;
  padding: 0;
  margin: 0;
}

.setup-appearance-card-header {
  border-top-right-radius: 12px;
  border-top-left-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  background-color: #f4f4f4;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #170b28;
  border-bottom: 1px solid #f0f0f0;
}

.setup-appearance-card-icon {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
}

.setup-appearance-card-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-field-label {
  font-size: 15px;
  font-weight: 500;
  color: #333333;
  white-space: nowrap;
}

.setup-color-picker {
  height: 38px;
  min-width: 120px;
  box-sizing: border-box;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  background: none;
}

.setup-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.setup-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.setup-color-picker:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 1px;
}

.setup-restore-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: #555555;
  background-color: #ffffff;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 4px;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.setup-restore-default:hover {
  border-color: #8e56dc;
  color: #8e56dc;
}

.setup-restore-default:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 2px;
}

/* Select */

.setup-select {
  min-width: 120px;
  box-sizing: border-box;
  padding: 6px 28px 6px 10px;
  font-size: 15px;
  font-weight: 500;
  color: #5d5f63;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.setup-select:focus {
  border-color: #8e56dc;
}

.setup-select:focus-visible {
  outline: 2px solid #8e56dc;
  outline-offset: 1px;
}

/* Contrast warnings */

.setup-contrast-warning {
  width: fit-content;
  margin-top: -4px;
  margin-bottom: 4px;
}

.setup-contrast-warning small {
  white-space: nowrap;
  color: #856404;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Preview boxes */

.setup-preview-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setup-preview-label {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #170b28;
}

.setup-preview-frame {
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-preview-frame--btn {
  position: relative;
  overflow: hidden;
}

/* Widget preview SVG container */

.widget-svg-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.widget-svg-container svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 313px;
}

/* Trigger button preview (window SVG container) */

.window-svg-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.window-svg-container svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .setup-dialog {
    flex-direction: column;
    max-height: 80vh;
    min-height: auto;
  }

  .setup-dialog-sidebar {
    width: 100%;
    min-width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 20px;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
  }

  .setup-dialog-sidebar-header {
    margin-bottom: 0;
  }

  .setup-dialog-steps {
    display: none;
  }

  .setup-dialog-exit {
    margin-top: 0;
    margin-left: auto;
  }

  .setup-dialog-content {
    padding: 32px 24px;
  }

  .setup-dialog-title {
    font-size: 22px;
  }

  .setup-dialog-images {
    display: none;
  }

  .setup-dialog-cta {
    max-width: 320px;
  }

  .setup-customize-layout {
    flex-direction: column;
  }

  .setup-customize-previews {
    width: 100%;
    flex-direction: row;
  }

  .setup-customize-previews .setup-preview-box {
    flex: 1;
  }

  .setup-field-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .setup-dialog-overlay {
    padding: 12px;
  }

  .setup-dialog-images {
    flex-direction: column;
    align-items: center;
  }

  .setup-dialog-platforms {
    gap: 14px;
    flex-wrap: wrap;
  }

  .setup-dialog-cta {
    max-width: 100%;
  }

  .setup-customize-previews {
    flex-direction: column;
  }

  .setup-panel-step2-body {
    max-width: 100%;
  }

  .setup-site-row {
    max-width: 100%;
  }

  .setup-add-another {
    max-width: 100%;
  }
}
