/* ── RMX Signup Form ─────────────────────────────────────────────────────── */
#rmxsf-form-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 40px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  font-family: inherit;
}

@media (max-width: 600px) {
  #rmxsf-form-wrap { padding: 24px 18px 16px; }
}

#rmxsf-contact-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Rows & fields ────────────────────────────────────────────────────────── */
.rmxsf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.rmxsf-row.rmxsf-row-3 { grid-template-columns: 0.7fr 1fr 1fr; }

.rmxsf-hint { font-weight: 400; font-size: 12px; color: #888; }

#rmxsf_ta_other_input,
#rmxsf_sells_other_input,
#rmxsf_ci_other_input { width: 100%; box-sizing: border-box; }

.rmxsf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.rmxsf-field:last-child { margin-bottom: 0; }
.rmxsf-row .rmxsf-field  { margin-bottom: 0; }

.rmxsf-field-center {
  justify-content: center;
}

/* ── Labels ───────────────────────────────────────────────────────────────── */
.rmxsf-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
  letter-spacing: 0.01em;
}

.rmxsf-field label small {
  font-weight: 400;
  color: #718096;
  font-size: 0.8rem;
}

.rmxsf-req { color: #c0392b; margin-left: 2px; }

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.rmxsf-field input[type="text"],
.rmxsf-field input[type="email"],
.rmxsf-field input[type="url"],
.rmxsf-field select,
.rmxsf-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: #1a202c;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.rmxsf-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.rmxsf-field input:focus,
.rmxsf-field select:focus,
.rmxsf-field textarea:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201,162,39,0.13);
}

.rmxsf-field input:disabled,
.rmxsf-field select:disabled {
  background: #f7fafc;
  color: #a0aec0;
  cursor: not-allowed;
}

/* City dropdown shares the same style as other selects */
#rmxsf_city_sel {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: #1a202c;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  margin-bottom: 6px;
}
#rmxsf_city_sel:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201,162,39,0.13);
}

.rmxsf-field textarea { resize: vertical; min-height: 100px; }

/* ── Phone field ──────────────────────────────────────────────────────────── */
.rmxsf-phone-wrap {
  display: flex;
  gap: 0;
  position: relative;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: visible;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rmxsf-phone-wrap:focus-within {
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201,162,39,0.13);
}

.rmxsf-dial-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 12px;
  cursor: pointer;
  user-select: none;
  border-right: 1.5px solid #e2e8f0;
  white-space: nowrap;
  font-size: 0.9rem;
  color: #2d3748;
  flex-shrink: 0;
  min-width: 80px;
}

.rmxsf-dial-caret {
  opacity: 0.5;
  margin-left: 2px;
}

#rmxsf_phone_number {
  flex: 1;
  border: none !important;
  border-radius: 0 8px 8px 0 !important;
  box-shadow: none !important;
  padding: 11px 14px;
  font-size: 0.9375rem;
  color: #1a202c;
  background: transparent;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

/* Dial dropdown */
.rmxsf-dial-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 280px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rmxsf-dial-search-wrap {
  padding: 10px 10px 6px;
  border-bottom: 1px solid #f0f0f0;
}

.rmxsf-dial-search-wrap input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.875rem;
  outline: none;
}

.rmxsf-dial-search-wrap input:focus {
  border-color: #c9a227;
}

#rmxsf_dial_list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
}

.rmxsf-dial-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #2d3748;
  transition: background 0.1s;
}

.rmxsf-dial-option:hover,
.rmxsf-dial-option.rmxsf-active {
  background: #fef9ec;
  color: #92650a;
}

.rmxsf-dial-country { flex: 1; }
.rmxsf-dial-num { color: #718096; font-size: 0.8rem; }

.rmxsf-dial-option.rmxsf-hidden { display: none; }

/* ── Website row ──────────────────────────────────────────────────────────── */
.rmxsf-website-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.rmxsf-website-row input[type="url"] { flex: 1; }

/* ── Divider ──────────────────────────────────────────────────────────────── */
.rmxsf-divider {
  border: none;
  border-top: 1.5px solid #edf2f7;
  margin: 8px 0 22px;
}

/* ── Conditional sections ─────────────────────────────────────────────────── */
.rmxsf-conditional { margin-bottom: 4px; }

/* ── Checkbox groups ──────────────────────────────────────────────────────── */
.rmxsf-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 4px 0;
}

/* Use high-specificity selectors to override theme label/input styles */
#rmxsf-form-wrap .rmxsf-checkbox-group label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px;
  font-size: 0.9rem;
  color: #4a5568;
  cursor: pointer;
  font-weight: 400;
  line-height: 1.4;
  padding: 0 !important;
  position: static !important;
  margin: 0 !important;
}

/* Long options (e.g. IRB Stem Cell / Exosome Study) span the full row so the
   label stays on a single line instead of wrapping inside a narrow column */
#rmxsf-form-wrap .rmxsf-checkbox-group label.rmxsf-cb-wide {
  grid-column: 1 / -1;
  white-space: nowrap;
}

/* Newsletter / standalone checkbox */
#rmxsf-form-wrap .rmxsf-checkbox-inline {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px;
  font-size: 0.875rem;
  color: #718096;
  cursor: pointer;
  font-weight: 400;
  line-height: 1.45;
  padding: 0 !important;
  position: static !important;
  margin: 0 !important;
}

/* Override theme checkbox positioning — must be static inside flex labels */
#rmxsf-form-wrap .rmxsf-checkbox-group input[type="checkbox"],
#rmxsf-form-wrap .rmxsf-checkbox-group input[type="radio"] {
  position: static !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  accent-color: #c9a227;
  flex-shrink: 0 !important;
  cursor: pointer;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  vertical-align: middle;
}

#rmxsf-form-wrap .rmxsf-checkbox-inline input[type="checkbox"] {
  position: static !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  accent-color: #c9a227;
  flex-shrink: 0 !important;
  cursor: pointer;
  margin: 2px 0 0 !important;
  padding: 0 !important;
}

/* ── Territory country picker ─────────────────────────────────────────────── */
.rmxsf-territory-search {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  font-size: 0.9rem;
  outline: none;
}
.rmxsf-territory-search:focus { border-color: #c9a227; }

.rmxsf-territory-list {
  border: 1.5px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 4px;
  background: #fff;
}

.rmxsf-territory-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 0.875rem;
  color: #4a5568;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
}
.rmxsf-territory-item:hover { background: #fef9ec; }
.rmxsf-territory-item input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: #c9a227;
  flex-shrink: 0;
  margin-top: 0;
}

/* ── Note ─────────────────────────────────────────────────────────────────── */
.rmxsf-note {
  font-size: 0.85rem;
  color: #718096;
  margin: 4px 0 0;
  font-style: italic;
}

/* ── Error messages ───────────────────────────────────────────────────────── */
.rmxsf-error {
  font-size: 0.8rem;
  color: #c0392b;
  display: none;
  margin-top: 2px;
}

/* ── Submit ───────────────────────────────────────────────────────────────── */
.rmxsf-submit-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 40px;
}

.rmxsf-btn-submit {
  background: #c9a227;
  color: #fff;
  border: none;
  padding: 14px 56px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
}

.rmxsf-btn-submit:hover:not(:disabled) { background: #b08c1e; }
.rmxsf-btn-submit:active:not(:disabled) { transform: scale(0.98); }
.rmxsf-btn-submit:disabled { background: #d1d5db; cursor: not-allowed; }

/* ── Form-level messages ──────────────────────────────────────────────────── */
.rmxsf-form-msg {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9375rem;
  text-align: center;
}

.rmxsf-msg-error   { background: #fff5f5; color: #c0392b; border: 1px solid #feb2b2; }
.rmxsf-msg-info    { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.rmxsf-msg-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; font-size: 1rem; padding: 20px 24px; }

/* ── reCAPTCHA v3 badge — ensure theme cannot hide it ────────────────────── */
.grecaptcha-badge {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .rmxsf-row { grid-template-columns: 1fr; gap: 0; }
  .rmxsf-row.rmxsf-row-3 { grid-template-columns: 1fr; }
  .rmxsf-row .rmxsf-field { margin-bottom: 18px; }
  .rmxsf-checkbox-group { grid-template-columns: 1fr 1fr; }
  .rmxsf-website-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .rmxsf-website-row input[type="url"] { width: 100%; box-sizing: border-box; }
  .rmxsf-dial-dropdown { width: 240px; }
  .rmxsf-phone-wrap { flex-wrap: nowrap; }
}
