/*
 * Survey popup + HubSpot form styles (design: Figma "Popup", node 0:1506).
 * Connect after hydrate.css:  <link rel="stylesheet" href="survey-popup.css">
 * Everything is scoped to #survey-modal, the rest of the landing is not affected.
 */

@font-face {
  font-family: 'PT Root UI';
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  src: url('https://of.worldota.net/fonts/ptrootui/pt-root-ui_vf.woff2') format('woff2'),
       url('https://of.worldota.net/fonts/ptrootui/pt-root-ui_vf.woff') format('woff');
}

#survey-modal {
  --sp-font: 'PT Root UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sp-text: #2d3137;
  --sp-muted: #868686;
  --sp-stroke: #c8c8c8;
  --sp-stroke-hover: #a6a6a6;
  --sp-focus: #2d3137;
  --sp-error: #e5413a;
  --sp-primary: #fddd55;
  --sp-primary-hover: #fcd52d;
  --sp-secondary: #f6f6f6;
  --sp-secondary-hover: #ececec;
  --sp-disabled-cover: rgba(246, 246, 246, 0.8);
  --sp-chevron: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAATRJREFUeAHtkb1qwlAUgM+50p+l4NKSEgoZCwreDHV27CN07Bu0b6Cduto3qE/QtWPmdtBB6NxBsHVxVuF4Iog3aqL3JCDC/SAhl+Se7wsXwOFwOA4MmotA6/IFnDUJqAFA7/3e9xsUQCUMa0in7Vg2w8njT7f7u3xXMj/0vZtXRHzmy+Pr/srz8X84iCAHsVzRScTzbvl3A0UlzTM7y/cq+bkqmyve1KzqegtyynnQai5SkDAmdiC1+T4uImKrnCGCjrlOHMFoOPi7vPY/EfCBl+dGRMPmONLl9NLvfbVSA4qIsJFvDcgTYStPDZBESOSZATYRUvliFuxBJazXFGDEjxsCwumHVL53QFYEm8ZSuVVAZoRQbh2wK8JWLgpIi5DIxQHrEVJ5buKIqr57AofDcczMAbOZwnPxZTGSAAAAAElFTkSuQmCC");
}

/* ---------- Popup card (no close button: closes by Esc or a click outside) ---------- */

#survey-modal .survey-modal__dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  min-height: min(440px, 100%);
  max-height: 100%;
  padding: 24px;
  border-radius: 8px;
  background-color: #fff;
  color: var(--sp-text);
  font-family: var(--sp-font);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
}


/* Landing section wrappers inside the popup: no yellow background, no paddings, stretch to the card */
#survey-modal .survey-modal__dialog > [data-react-component],
#survey-modal [class*="Section-module__section"],
#survey-modal [class*="Section-module__content"],
#survey-modal .hs-form-html,
#survey-modal .hs-form-html > div,
#survey-modal .hsfc-Renderer,
#survey-modal .hsfc-FormWrapper,
#survey-modal .hsfc-Form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  gap: 0;
}

/* Title: 32/40 bold, left */
#survey-modal h2[class*="SectionTitle-module__title"] {
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
}
#survey-modal [class*="SectionTitle-module__titleText"] {
  display: block;
  font-family: var(--sp-font);
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sp-text);
}

/* ---------- HubSpot form ---------- */

#survey-modal [data-hsfc-id=Renderer] {
  font-family: var(--sp-font);
  color: var(--sp-text);
}

/* Visible step fills the card so the buttons sit at the bottom (hidden steps keep display:none) */
#survey-modal [data-hsfc-id=Renderer] .hsfc-Step:not([style*="none"]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-Step__Content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 20px;
  padding: 0;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-Row {
  margin: 0;
  gap: 20px;
}

/* Field box: label on top inside the box, value below (two parts with a shared border) */
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

#survey-modal [data-hsfc-id=Renderer] .hsfc-FieldLabel {
  display: block;
  margin: 0;
  padding: 7px 16px 0;
  border: 1px solid var(--sp-stroke);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #fff;
  font-family: var(--sp-font);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: var(--sp-muted);
  cursor: pointer;
  transition: border-color .15s;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-FieldLabel > span { margin: 0; }
#survey-modal [data-hsfc-id=Renderer] .hsfc-FieldLabel__RequiredIndicator { display: none; }

#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownInput {
  position: relative;
  margin: 0;
}

#survey-modal [data-hsfc-id=Renderer] .hsfc-TextInput,
#survey-modal [data-hsfc-id=Renderer] .hsfc-TextInput--button {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 2px 40px 9px 16px;
  border: 1px solid var(--sp-stroke);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  box-shadow: none;
  outline: none;
  font-family: var(--sp-font);
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  color: var(--sp-text);
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color .15s;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-TextInput::placeholder { color: var(--sp-muted); opacity: 1; }

/* hover / focus / error: both halves of the box change together */
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField:hover .hsfc-FieldLabel,
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField:hover .hsfc-TextInput { border-color: var(--sp-stroke-hover); }
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField:focus-within .hsfc-FieldLabel,
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField:focus-within .hsfc-TextInput { border-color: var(--sp-focus); }
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField:has(.hsfc-TextInput[aria-invalid="true"]) .hsfc-FieldLabel,
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownField:has(.hsfc-TextInput[aria-invalid="true"]) .hsfc-TextInput { border-color: var(--sp-error); }

/* Chevron from the design (16x16), aligned with the value line */
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownInput__Caret {
  position: absolute;
  top: 4px;
  right: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--sp-chevron) center / 16px 16px no-repeat;
  pointer-events: none;
  transform: none;
  transition: transform .15s;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownInput__Caret > span { display: none; }
#survey-modal [data-hsfc-id=Renderer] .hsfc-TextInput[aria-expanded="true"] ~ .hsfc-DropdownInput__Caret { transform: rotate(180deg); }

/* Options list */
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownOptions {
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  padding: 4px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownOptions__List {
  max-height: 264px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownOptions__List__ListItem {
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  font-family: var(--sp-font);
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: var(--sp-text);
  cursor: pointer;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownOptions__List__ListItem:hover,
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownOptions__List__ListItem:focus {
  background: var(--sp-secondary);
  color: var(--sp-text);
  outline: none;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-DropdownOptions__List__ListItem[aria-selected="true"] {
  background: #fff6cc;
  font-weight: 500;
  color: var(--sp-text);
}

/* Errors */
#survey-modal [data-hsfc-id=Renderer] .hsfc-ErrorAlert {
  margin: 4px 0 0;
  padding: 0 16px;
  font-family: var(--sp-font);
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: var(--sp-error);
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-NavigationRow__Alerts .hsfc-ErrorAlert {
  margin: 0 0 12px;
  padding: 0;
  text-align: center;
}

/* Footer buttons: full width, 48px, radius 12 */
#survey-modal [data-hsfc-id=Renderer] .hsfc-NavigationRow {
  margin: auto 0 0;
  padding: 24px 0 0;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-NavigationRow__Buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-Button {
  position: relative;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--sp-primary);
  box-shadow: none;
  filter: none;
  opacity: 1;
  overflow: hidden;
  font-family: var(--sp-font);
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sp-text);
  cursor: pointer;
  transition: background-color .15s;
}
#survey-modal [data-hsfc-id=Renderer] .hsfc-Button:hover { background: var(--sp-primary-hover); }
#survey-modal [data-hsfc-id=Renderer] .hsfc-Button:focus-visible { outline: 2px solid var(--sp-focus); outline-offset: 2px; }
/* "Previous" (any button that is not the last one) is secondary */
#survey-modal [data-hsfc-id=Renderer] .hsfc-NavigationRow__Buttons .hsfc-Button:not(:last-child) { background: var(--sp-secondary); }
#survey-modal [data-hsfc-id=Renderer] .hsfc-NavigationRow__Buttons .hsfc-Button:not(:last-child):hover { background: var(--sp-secondary-hover); }
/* Disabled: the design's light cover over the button */
#survey-modal [data-hsfc-id=Renderer] .hsfc-Button[disabled] { cursor: not-allowed; }
#survey-modal [data-hsfc-id=Renderer] .hsfc-Button[disabled]:hover { background: var(--sp-primary); }
#survey-modal [data-hsfc-id=Renderer] .hsfc-Button[disabled]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--sp-disabled-cover);
  pointer-events: none;
}

/* Thank-you message */
#survey-modal [data-hsfc-id=Renderer] .hsfc-PostSubmit,
#survey-modal [data-hsfc-id=Renderer] .hsfc-PostSubmit * {
  font-family: var(--sp-font);
  color: var(--sp-text);
}

/* ---------- Mobile ---------- */
@media (max-width: 599px) {
  #survey-modal .survey-modal__dialog { padding: 20px 16px; }
  #survey-modal [class*="SectionTitle-module__titleText"] { font-size: 24px; line-height: 32px; }
}
