/* FunDa trial sign-up pop-up form. Mobile-first; everything is scoped under .ff-overlay. */

html.ff-locked,
html.ff-locked body {
  overflow: hidden;
}
html.ff-locked body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.ff-overlay {
  --ff-pink: #E91E7A;
  --ff-pink-dark: #cc1468;
  --ff-text: #2b2b2b;
  --ff-muted: #8a8a8a;
  --ff-border: #d9d9d9;
  --ff-focus: #7ab3ff;
  --ff-error: #e5484d;
  --ff-fill: #3d3d3d;
  --ff-track: #e6e6e6;

  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: inherit;
  color: var(--ff-text);
  -webkit-tap-highlight-color: transparent;
}
.ff-overlay[hidden] { display: none; }
.ff-overlay.is-open { opacity: 1; }

.ff-overlay *,
.ff-overlay *::before,
.ff-overlay *::after { box-sizing: border-box; }

.ff-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 20px 18px 16px;
  transform: scale(0.96);
  transition: transform 0.2s ease;
  text-align: left;
}
.ff-overlay.is-open .ff-card { transform: scale(1); }

@media (min-width: 480px) {
  .ff-card { padding: 24px 28px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-overlay, .ff-card { transition: none; }
}

/* ---- top bar: progress + close ---- */
.ff-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ff-progress {
  flex: 1;
  display: flex;
  gap: 6px;
}
.ff-progress__seg {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--ff-track);
  overflow: hidden;
}
.ff-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ff-fill);
  transition: width 0.25s ease;
}
.ff-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f0f0f0;
  color: #555;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ff-close:hover { background: #e4e4e4; }

.ff-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px 0 6px -6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ff-text);
  font-size: 20px;
  cursor: pointer;
}
.ff-back:hover { background: #f3f3f3; }
.ff-back[hidden] { display: none; }

.ff-close:focus-visible,
.ff-back:focus-visible,
.ff-btn:focus-visible {
  outline: 2px solid var(--ff-focus);
  outline-offset: 2px;
}

/* ---- content ---- */
.ff-heading {
  font-family: 'Poppins', inherit;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ff-text);
  margin: 4px 0 20px;
}
@media (min-width: 480px) {
  .ff-heading { font-size: 28px; }
}
.ff-step[hidden],
.ff-form[hidden],
.ff-success[hidden] { display: none; }

.ff-field { margin-bottom: 18px; }
.ff-label {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ff-text);
  margin-bottom: 8px;
  cursor: default;
}
.ff-req {
  display: inline-block;
  vertical-align: 0.35em;
  margin-left: 5px;
  color: var(--ff-error);
}
.ff-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ff-control {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ff-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ff-text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into fields */
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ff-control::placeholder { color: #a3a3a3; }
.ff-control:focus,
.ff-select.is-open .ff-select__box {
  border-color: var(--ff-focus);
  box-shadow: 0 0 0 3px rgba(122, 179, 255, 0.3);
}
.ff-field.is-invalid .ff-control,
.ff-control[aria-invalid="true"] { border-color: var(--ff-error); }
.ff-field.is-invalid .ff-control:focus { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18); }

.ff-error {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ff-error);
}
.ff-error:empty { display: none; }

/* ---- custom select ---- */
.ff-select { position: relative; }
.ff-select__box {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.ff-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ff-select__value.is-placeholder { color: #a3a3a3; }
.ff-select__chev {
  flex: none;
  display: flex;
  color: #6b6b6b;
  transition: transform 0.15s ease;
}
.ff-select.is-open .ff-select__chev { transform: rotate(180deg); }
.ff-select__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 14px;
}
.ff-select__list[hidden] { display: none; }
.ff-select__opt {
  padding: 10px 12px;
  line-height: 1.35;
  cursor: pointer;
  color: var(--ff-text);
}
.ff-select__opt.is-active { background: #f2f3f5; }
.ff-select__opt[aria-selected="true"] {
  font-weight: 600;
  color: var(--ff-pink);
}

/* ---- phone ---- */
.ff-phone {
  display: flex;
  gap: 8px;
}
.ff-select--country { flex: none; width: 104px; }
.ff-select--country .ff-select__box { padding: 0 8px 0 10px; }
.ff-select--country .ff-select__list { right: auto; width: 260px; max-width: calc(100vw - 64px); }
.ff-phone .ff-input { flex: 1; min-width: 0; }

/* ---- honeypot ---- */
.ff-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- button ---- */
.ff-form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecec;
  color: #b4232a;
  font-size: 14px;
}
.ff-form-error:empty { display: none; }

.ff-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--ff-pink);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ff-btn:hover { background: var(--ff-pink-dark); }
.ff-btn:disabled { cursor: progress; opacity: 0.85; }
.ff-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ff-spin 0.7s linear infinite;
}
@keyframes ff-spin { to { transform: rotate(360deg); } }

/* ---- success ---- */
.ff-success {
  text-align: center;
  padding: 16px 4px 8px;
  outline: none;
}
.ff-success .ff-heading { margin: 14px 0 8px; }
.ff-success p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #555;
}

.ff-safe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ff-muted);
}
