/* =========================================================
   Onboarding Popup — First-time user survey modal
   Stylized, large centered modal inspired by modern e-commerce
   ========================================================= */

/* Overlay */
.ob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .35s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ob-overlay.ob-visible { opacity: 1; }
.ob-overlay.ob-hidden  { display: none; }

/* ---- Modal card ---- */
.ob-modal {
  position: relative;
  background: #fafaf8;
  border-radius: 18px;
  width: 96vw;
  max-width: 640px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 100px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
  transform: scale(.96) translateY(16px);
  transition: transform .35s ease;
}
.ob-visible .ob-modal {
  transform: scale(1) translateY(0);
}

/* Close button (X) */
.ob-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s, color .15s;
  z-index: 2;
}
.ob-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ---- Header / step bar ---- */
.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 36px 0;
}
.ob-step-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #9ca3af;
  text-transform: uppercase;
}
.ob-step-dots {
  display: flex;
  gap: 6px;
}
.ob-step-dot {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  transition: background .25s;
}
.ob-step-dot--active {
  background: #072908;
}

/* ---- Content area ---- */
.ob-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px 20px;
}
.ob-body::-webkit-scrollbar { width: 4px; }
.ob-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Pages */
.ob-page      { display: none; }
.ob-page--active { display: block; }

/* ---- Welcome page ---- */
.ob-welcome-logo {
  width: 72px;
  margin: 0 auto 20px;
  display: block;
}
.ob-page h2 {
  font-size: 36px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
  letter-spacing: -0.4px;
  text-align: center;
}
.ob-page .ob-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
  text-align: center;
}
/* Left-align subtitle on survey pages (not welcome/done) */
.ob-page[data-ob-page="1"] h2,
.ob-page[data-ob-page="2"] h2,
.ob-page[data-ob-page="3"] h2,
.ob-page[data-ob-page="4"] h2 { text-align: left; }
.ob-page[data-ob-page="1"] .ob-subtitle,
.ob-page[data-ob-page="2"] .ob-subtitle,
.ob-page[data-ob-page="3"] .ob-subtitle,
.ob-page[data-ob-page="4"] .ob-subtitle { text-align: left; }

.ob-feature-list {
  list-style: none;
  padding: 0;
  margin: 8px auto 24px;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ob-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 15px;
  color: #374151;
  line-height: 1.5;
}
.ob-feature-icon {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 10px;
  background: #e8f0ea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b4f2d;
}
.ob-feature-icon svg { width: 20px; height: 20px; }

/* Account CTA */
.ob-account-cta {
  margin: 8px auto 0;
  max-width: 460px;
  padding: 20px 24px;
  background: #f0f5f1;
  border: 1px solid rgba(11,79,45,.12);
  border-radius: 14px;
  text-align: center;
}
.ob-account-cta__text {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  margin: 0 0 16px;
}
.ob-account-cta__buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.ob-btn-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
  color: #072908;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.ob-btn-signin:hover {
  border-color: #072908;
  background: #f9fafb;
}
.ob-btn-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: system-ui, -apple-system, sans-serif;
  color: #fff;
  background: #072908;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.ob-btn-signup:hover {
  background: #0b4f2d;
}

.ob-privacy {
  font-size: 13px;
  color: #9ca3af;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  line-height: 1.5;
  text-align: center;
}

/* ---- Survey questions ---- */
.ob-question      { margin-bottom: 0; }
.ob-question__label {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 3px;
}
.ob-question__hint {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 14px;
  line-height: 1.45;
}
.ob-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 24px 0;
}

/* ---- Text input ---- */
.ob-text-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-family: system-ui, -apple-system, sans-serif;
  color: #111827;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.ob-text-input::placeholder { color: #9ca3af; }
.ob-text-input:focus {
  border-color: #072908;
  box-shadow: 0 0 0 3px rgba(7,41,8,.08);
}

/* ---- Select ---- */
.ob-select {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-family: system-ui, -apple-system, sans-serif;
  color: #111827;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  outline: none;
  appearance: auto;
}
.ob-select:focus {
  border-color: #072908;
  box-shadow: 0 0 0 3px rgba(7,41,8,.08);
}

/* ---- Pill groups ---- */
.ob-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ob-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
  color: #374151;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.ob-pill:hover {
  border-color: #072908;
  background: #f0f5f1;
}
.ob-pill--active {
  background: #e8f5ea;
  border-color: #2e8b3e;
  color: #1a5a28;
}
.ob-pill--active:hover {
  background: #d8eedc;
  border-color: #267a34;
}

/* Ranked pill badge */
.ob-pill__rank {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%;
  background: rgba(46,139,62,.15);
  color: #1a5a28;
  font-size: 12px; font-weight: 700;
  margin-right: 6px;
}
.ob-pill--active .ob-pill__rank {
  display: inline-flex;
}

/* ---- Accordion sections ---- */
.ob-accordions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}
.ob-accordions::-webkit-scrollbar { width: 4px; }
.ob-accordions::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.ob-acc {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.ob-acc--open {
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.ob-acc__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: system-ui, -apple-system, sans-serif;
}
.ob-acc__header:hover { background: rgba(0,0,0,.02); border-radius: 12px; }
.ob-acc__title  { font-size: 15px; font-weight: 700; color: #111827; margin: 0; }
.ob-acc__sub    { font-size: 12px; color: #6b7280; margin: 2px 0 0; }
.ob-acc__badge  { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #6b7280; text-transform: uppercase; }
.ob-acc__badge--has-count { color: #0b4f2d; }
.ob-acc__chevron { color: #6b7280; transition: transform .25s; flex-shrink: 0; }
.ob-acc--open .ob-acc__chevron { transform: rotate(180deg); }
.ob-acc__body   { display: none; padding: 0 16px 14px; }
.ob-acc--open .ob-acc__body { display: block; }
.ob-acc__body .ob-toggle-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* Pref toggles */
.ob-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
  color: #374151;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.ob-toggle:hover { border-color: #999; }
/* Default "on" toggle — green (overridden per-group below) */
.ob-toggle--on {
  background: #e8f5ea;
  border-color: #2e8b3e;
  color: #1a5a28;
}
.ob-toggle--on::before {
  content: "\2713";
  font-weight: 700;
  margin-right: 2px;
  color: #2e8b3e;
}

/* Per-group toggle colors (matching supplier attribute palette) */
[data-ob-acc="brand-values"] .ob-toggle--on       { background: #f5f0ea; border-color: #7a6a5a; color: #5a4a3a; }
[data-ob-acc="brand-values"] .ob-toggle--on::before { color: #7a6a5a; }
[data-ob-acc="environmental"] .ob-toggle--on       { background: #e8f5ea; border-color: #2e8b3e; color: #1a5a28; }
[data-ob-acc="environmental"] .ob-toggle--on::before { color: #2e8b3e; }
[data-ob-acc="human-rights"] .ob-toggle--on        { background: #eaf2f5; border-color: #5a7a8a; color: #3a5a6a; }
[data-ob-acc="human-rights"] .ob-toggle--on::before { color: #5a7a8a; }
[data-ob-acc="health-safety"] .ob-toggle--on       { background: #f3edec; border-color: #8a6e6e; color: #6a4e4e; }
[data-ob-acc="health-safety"] .ob-toggle--on::before { color: #8a6e6e; }
[data-ob-acc="certifications"] .ob-toggle--on      { background: #eceef3; border-color: #5a6a8a; color: #3a4a6a; }
[data-ob-acc="certifications"] .ob-toggle--on::before { color: #5a6a8a; }
[data-ob-acc="sustainability"] .ob-toggle--on      { background: #e8f5ea; border-color: #2e8b3e; color: #1a5a28; }
[data-ob-acc="sustainability"] .ob-toggle--on::before { color: #2e8b3e; }

/* ---- ESG sliders ---- */
.ob-slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.ob-slider-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 185px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.ob-slider-badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-slider-badge svg { width: 18px; height: 18px; }
.ob-slider-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--ob-slider-color, #072908) 0%,
    var(--ob-slider-color, #072908) var(--ob-slider-pct, 33%),
    #e5e7eb var(--ob-slider-pct, 33%),
    #e5e7eb 100%
  );
  outline: none;
}
.ob-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--ob-slider-color, #072908);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.ob-slider-input::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--ob-slider-color, #072908);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.ob-slider-input::-moz-range-progress {
  background: var(--ob-slider-color, #072908);
  height: 8px;
  border-radius: 4px;
}
.ob-slider-value {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  min-width: 48px;
  text-align: right;
}

/* ---- Done page ---- */
.ob-done-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #e8f0ea;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.ob-done-icon svg { color: #0b4f2d; }
.ob-profile-link {
  display: inline;
  color: #0b4f2d;
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}
.ob-profile-link:hover { color: #072908; }

/* ---- Footer / nav ---- */
.ob-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 36px 20px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.ob-skip {
  background: none; border: none;
  color: #9ca3af;
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: system-ui, -apple-system, sans-serif;
  padding: 0;
  letter-spacing: .2px;
}
.ob-skip:hover { color: #374151; text-decoration: underline; }
.ob-footer-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ob-btn-back {
  background: #fff;
  color: #374151;
  border: 1.5px solid #d1d5db;
  padding: 11px 22px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  transition: all .15s;
}
.ob-btn-back:hover { background: #f3f4f6; border-color: #9ca3af; }
.ob-btn-next {
  background: #072908;
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  letter-spacing: .3px;
  transition: background .15s;
}
.ob-btn-next:hover { background: #0b4f2d; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .ob-modal { max-width: 100%; width: 100vw; max-height: 100vh; border-radius: 0; }
  .ob-body { padding: 20px 20px 12px; }
  .ob-header { padding: 18px 20px 0; }
  .ob-footer { padding: 12px 20px 16px; }
  .ob-close { top: 12px; right: 12px; }
  .ob-page h2 { font-size: 22px; }
  .ob-slider-label { min-width: 140px; font-size: 13px; }
  .ob-accordions { max-height: none; }
}
