/* form.css — iPhygital CTA visitor-facing form. Scoped via .ipx-* prefix. */
:root {
  --ipx-primary: #f58634;
  --ipx-primary-dark: #e6683c;
  --ipx-primary-text: #ffffff;
  --ipx-primary-shadow: rgba(183, 182, 182, 0.35);
  --ipx-primary-tint: rgba(245, 134, 52, 0.08);
  --ipx-navy: #143058;
  --ipx-dark: #1C1F26;
  --ipx-soft: #FFC7A0;
  --ipx-surface: #ffffff;
  --ipx-input-bg: #fafbfc;
  --ipx-text: #1C1F26;
  --ipx-muted: #606061;
  --ipx-border: #E4E7EC;
  --ipx-header-bg: var(--ipx-navy);
  --ipx-header-text: #ffffff;
  --ipx-header-subtext: rgba(255, 255, 255, 0.78);
  --ipx-header-welcome-bg: rgba(255, 255, 255, 0.15);
  --ipx-radius: 14px;
  --ipx-radius-sm: 10px;
  --ipx-radio-radius: var(--ipx-radius-sm);
  --ipx-font-size: 14px;
  --ipx-shadow-sm: 0 1px 2px rgba(20, 31, 38, .06);
  --ipx-shadow: 0 20px 60px -16px rgba(20, 48, 88, .22), 0 2px 8px rgba(20, 48, 88, .08);
}

/* Theme overrides — inline style on .ipx-cta takes priority over :root */
.ipx-cta {
  --ipx-primary-dark: var(--ipx-primary);
}

[data-iphygital-cta] *,
[data-iphygital-cta] *::before,
[data-iphygital-cta] *::after {
  box-sizing: border-box;
}

/* ===== layout shells ===== */
.ipx-cta {
  margin: 0 auto;
  font-family: var(--ipx-font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--ipx-font-size, 14px);
}

.ipx-cta-header {
  margin-bottom: 0;
}

/* Card layout header */
.ipx-layout-card .ipx-cta-header,
.ipx-layout-inline .ipx-cta-header {
  background: var(--ipx-header-bg);
  padding: 32px 32px 28px;
  border-radius: var(--ipx-radius) var(--ipx-radius) 0 0;
}

.ipx-layout-card .ipx-headline,
.ipx-layout-inline .ipx-headline,
.ipx-modal-backdrop .ipx-headline {
  color: var(--ipx-header-text);
}

.ipx-layout-card .ipx-subheadline,
.ipx-layout-inline .ipx-subheadline {
  color: var(--ipx-header-subtext);
}

.ipx-layout-card .ipx-welcome,
.ipx-layout-inline .ipx-welcome {
  background: var(--ipx-header-welcome-bg);
  color: var(--ipx-header-text);
  backdrop-filter: blur(4px);
}

.ipx-headline {
  font-family: var(--ipx-font-family, 'Syncopate', 'Inter', sans-serif);
  font-size: clamp(22px, 3.5vw, 34px);
  line-height: 1.18;
  color: var(--ipx-navy);
  margin: 0 0 10px;
  letter-spacing: -0.3px;
  font-weight: 700;
}

.ipx-subheadline {
  font-size: 15px;
  color: var(--ipx-muted);
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 56ch;
}

.ipx-welcome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 134, 52, .12), rgba(255, 199, 160, .2));
  color: var(--ipx-navy);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  margin-bottom: 10px;
}

.ipx-form,
.ipx-form-fallback {
  background: var(--ipx-surface, #fff);
  border: 1px solid var(--ipx-border, var(--ipx-border));
  border-top: none;
  border-radius: 0 0 var(--ipx-radius) var(--ipx-radius);
  padding: 28px 32px 32px;
  box-shadow: var(--ipx-shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ipx-layout-inline .ipx-form {
  box-shadow: 0 4px 24px -4px rgba(20, 48, 88, .10);
  border: 1px solid var(--ipx-border);
  border-top: none;
}

/* ===== progress bar ===== */
.ipx-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.ipx-progress-step {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: #EAECF0;
  position: relative;
  overflow: hidden;
  transition: background .3s;
}

.ipx-progress-step.is-active {
  background: var(--ipx-progress-color, var(--ipx-primary));
}

.ipx-progress-step.is-done {
  background: var(--ipx-progress-color, var(--ipx-navy));
}

.ipx-step-label {
  font-size: 12px;
  color: var(--ipx-muted);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ===== field rows ===== */
.ipx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
      margin-bottom: 5px;
}

.ipx-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ipx-text);
  letter-spacing: 0.1px;
}

.ipx-req {
  color: var(--ipx-req-color, var(--ipx-primary));
  margin-left: 1px;
}

.ipx-help {
  font-size: 12px;
  color: var(--ipx-muted);
  line-height: 1.5;
}

.ipx-err {
  font-size: 12px;
  color: #C0392B;
  min-height: 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ipx-err:empty {
  display: none;
}

.ipx-err::before {
  content: '⚠';
  font-size: 11px;
}

.ipx-field.is-valid .ipx-input {
  border-color: #2ECC71;
  background: #f6fff9;
}

.ipx-field.is-invalid .ipx-input {
  border-color: #C0392B;
  background: #FFF5F4;
}

.ipx-status {
  font-size: 12px;
  color: var(--ipx-muted);
  font-weight: 500;
}

.ipx-status.is-ok {
  color: #1aaa55;
  font-weight: 600;
}

.ipx-status.is-ok::before {
  content: '✓ ';
}

/* ===== inputs ===== */
.ipx-input {
  font: inherit;
  font-size: var(--ipx-font-size, 14px);
  line-height: 1.5;
  padding: 11px 14px;
  border: 1.5px solid var(--ipx-border);
  border-radius: var(--ipx-radius-sm);
  background: var(--ipx-input-bg, #fafbfc);
  color: var(--ipx-text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s;
  width: 100%;
}

.ipx-input::placeholder {
  color: #B0B4BB;
}

.ipx-input:hover {
  border-color: #c8cdd6;
  background: var(--ipx-surface, #fff);
}

.ipx-input:focus {
  outline: none;
  border-color: var(--ipx-primary);
  background: var(--ipx-surface, #fff);
  box-shadow: 0 0 0 3px var(--ipx-primary-shadow, rgba(245, 134, 52, .15));
}

.ipx-textarea {
  resize: vertical;
  min-height: 110px;
}

.ipx-file {
  padding: 10px 14px;
  background: #fafbfc;
  cursor: pointer;
}

/* ===== range ===== */
.ipx-range-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ipx-range {
  flex: 1;
  accent-color: var(--ipx-primary);
  height: 6px;
  cursor: pointer;
}

.ipx-range-val {
  font-weight: 700;
  color: var(--ipx-primary);
  min-width: 56px;
  text-align: center;
  background: rgba(245, 134, 52, .1);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ===== chips / multiselect ===== */
.ipx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ipx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--ipx-border);
  border-radius: 999px;
  background: var(--ipx-input-bg, #fff);
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  font-weight: 600;
  color: var(--ipx-text);
  user-select: none;
}

.ipx-chip:hover {
  border-color: var(--ipx-primary);
  color: var(--ipx-primary);
  background: var(--ipx-primary-tint, rgba(245, 134, 52, .04));
}

.ipx-chip input[type=checkbox] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ipx-chip:has(input:checked) {
  background: var(--ipx-primary);
  color: var(--ipx-primary-text, #fff);
  border-color: var(--ipx-primary);
  box-shadow: 0 2px 8px var(--ipx-primary-shadow, rgba(245, 134, 52, .3));
}

/* ===== Other option — full-width row below chips ===== */
.ipx-chip-other {
  width: 100%;
  border-radius: 10px;
  padding: 0px 0 0 0;
  border: none;
  background: transparent;
  cursor: default;
}
.ipx-chip-other:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}
.ipx-chip-other:has(input:checked) {
  background: transparent;
  border: none;
  box-shadow: none;
}
.ipx-chip-other span {
  display: none;
}
/* Hide the hidden checkbox — input is always visible */
.ipx-chip-other input[type=checkbox] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ipx-other-input {
  width: 100%;
  padding: 8px 14px;
  border: 1.5px solid var(--ipx-border, #e4e7ec);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ipx-text, #1c1f26);
  background: var(--ipx-input-bg, #fff);
  outline: none;
  box-sizing: border-box;
  cursor: text;
}
.ipx-other-input:focus {
  border-color: var(--ipx-primary);
}
/* Dropdown Other — hide by default */
.ipx-dropdown-wrap .ipx-other-input {
  display: none;
}
/* Radio Other — stacks below */
.ipx-radio-other {
  flex-direction: column;
  align-items: flex-start;
}
.ipx-radio-other .ipx-other-input {
  display: none !important;
  width: 100%;
  margin-top: 8px;
  border-radius: 8px;
}
.ipx-radio-other:has(input[type=radio]:checked) .ipx-other-input {
  display: block !important;
}

/* ===== radio cards ===== */
.ipx-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ipx-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--ipx-border);
  border-radius: var(--ipx-radio-radius, var(--ipx-radius-sm));
  background: var(--ipx-input-bg, #fff);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  color: var(--ipx-text);
  user-select: none;
}

.ipx-radio:hover {
  border-color: var(--ipx-primary);
  background: var(--ipx-primary-shadow, rgba(245, 134, 52, .04));
}

.ipx-radio:has(input:checked) {
  border-color: var(--ipx-primary);
  background: transparent;
  color: var(--ipx-text, #1c1f26);
}

.ipx-radio input {
  accent-color: var(--ipx-primary);
}



/* ===== checkbox / consent ===== */
.ipx-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ipx-text);
  line-height: 1.5;
}

.ipx-checkbox input {
  margin-top: 3px;
  accent-color: var(--ipx-primary);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ===== toggle ===== */
.ipx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.ipx-toggle input {
  position: absolute;
  opacity: 0;
}

.ipx-toggle-track {
  width: 46px;
  height: 26px;
  background: #D9DCE2;
  border-radius: 999px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.ipx-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
}

.ipx-toggle input:checked+.ipx-toggle-track {
  background: var(--ipx-primary);
}

.ipx-toggle input:checked+.ipx-toggle-track .ipx-toggle-thumb {
  left: 23px;
}

.ipx-toggle-label {
  font-size: 14px;
  color: var(--ipx-text);
  font-weight: 500;
}

/* ===== static text ===== */
.ipx-static {
  font-size: 14px;
  color: var(--ipx-muted);
  padding: 10px 0;
  border-top: 1px dashed var(--ipx-border);
  line-height: 1.6;
}

/* ===== submit button ===== */
.ipx-submit {
  background: linear-gradient(135deg, var(--ipx-primary) 0%, var(--ipx-primary-dark) 100%);
  color: var(--ipx-primary-text, #fff);
  border: none;
  border-radius: var(--ipx-radius-sm);
  padding: 14px 24px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  width: 100%;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px -2px var(--ipx-primary-shadow, rgba(245, 134, 52, .35));
}

.ipx-submit:hover {
  opacity: .92;
  box-shadow: 0 6px 20px -4px var(--ipx-primary-shadow, rgba(245, 134, 52, .45));
  transform: translateY(-1px);
}

.ipx-submit:active {
  transform: translateY(1px);
  box-shadow: none;
}

.ipx-submit:disabled {
  background: #B7B9BD;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.ipx-submit:focus-visible {
  outline: 3px solid var(--ipx-primary-shadow, rgba(245, 134, 52, .5));
  outline-offset: 2px;
}

.ipx-nav {
  display: flex;
  gap: 10px;
}

.ipx-nav .ipx-submit {
  flex: 1;
}

.ipx-back {
  background: transparent;
  color: var(--ipx-primary, #143058);
  border: 1.5px solid var(--ipx-primary, #143058);
  border-radius: var(--ipx-radius-sm);
  padding: 14px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  transition: background .15s, border-color .15s, color .15s;
}

/* alias used by download-mode form */
.ipx-back-btn {
  background: transparent;
  color: var(--ipx-navy, #143058);
  border: 1.5px solid var(--ipx-navy, #143058);
  border-radius: var(--ipx-radius-sm, 10px);
  padding: 14px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.ipx-back-btn:hover {
  background: rgba(20,48,88,.06);
}

.ipx-back:hover {
  background: var(--ipx-primary-tint, rgba(245,134,52,.08));
  border-color: var(--ipx-primary, #143058);
}

/* ===== success / error banners ===== */
.ipx-banner {
  padding: 16px 20px;
  border-radius: var(--ipx-radius-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.ipx-banner-success {
  background: linear-gradient(135deg, rgba(46, 204, 113, .1), rgba(26, 170, 85, .08));
  color: #1aaa55;
  border: 1px solid rgba(46, 204, 113, .35);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ipx-banner-success::before {
  content: '✅';
  font-size: 18px;
  flex-shrink: 0;
}

.ipx-banner-error {
  background: rgba(192, 57, 43, .07);
  color: #8B1F12;
  border: 1px solid rgba(192, 57, 43, .28);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ipx-banner-error::before {
  content: '⚠️';
  font-size: 16px;
  flex-shrink: 0;
}

.ipx-banner-info {
  border-left: 4px solid #2980b9;
  background: rgba(41, 128, 185, .08);
  color: #1a5276;
}

.ipx-banner-info::before {
  content: 'ℹ️';
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== modal layout ===== */
.ipx-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: ipx-backdrop-in .2s ease;
}

@keyframes ipx-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.ipx-modal-backdrop .ipx-cta {
  position: relative;
  z-index: 10000;
  max-width: 540px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px;
  box-shadow: 0 40px 100px -20px rgba(10, 22, 42, .5), 0 0 0 1px rgba(255, 255, 255, .06);
  animation: ipx-modal-in .28s cubic-bezier(.34, 1.28, .64, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--ipx-border) transparent;
}

@keyframes ipx-modal-in {
  from {
    opacity: 0;
    transform: scale(.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ipx-modal-backdrop .ipx-cta::-webkit-scrollbar {
  width: 4px;
}

.ipx-modal-backdrop .ipx-cta::-webkit-scrollbar-track {
  background: transparent;
}

.ipx-modal-backdrop .ipx-cta::-webkit-scrollbar-thumb {
  background: var(--ipx-border);
  border-radius: 99px;
}

.ipx-modal-backdrop .ipx-cta-header {
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, var(--ipx-navy) 100%);
  padding: 30px 30px 26px;
  margin-bottom: 0;
}

.ipx-modal-backdrop .ipx-form {
  max-width: 100%;
  border-radius: 0 0 20px 20px;
  border-top: none;
}

.ipx-modal-backdrop .ipx-subheadline {
  color: var(--ipx-header-subtext);
}

.ipx-modal-backdrop .ipx-welcome {
  background: var(--ipx-header-welcome-bg);
  color: var(--ipx-header-text);
}

.ipx-modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 12px 12px -38px auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  color: var(--ipx-close-color, var(--ipx-primary));
  transition: background .15s, transform .15s, color .15s;
  line-height: 1;
}

.ipx-modal-close:hover {
  background: rgba(255, 255, 255, .35);
  transform: scale(1.1) rotate(5deg);
}

/* ===== honeypot ===== */
.ipx-honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ===== mobile ===== */
@media (max-width: 520px) {

  .ipx-form,
  .ipx-form-fallback {
    padding: 18px 16px 22px;
  }
  .ipx-layout-card .ipx-cta-header,
  .ipx-layout-inline .ipx-cta-header {
    padding: 20px 16px 16px;
  }
  .ipx-headline {
    font-size: 19px;
  }
  .ipx-subheadline {
    font-size: 14px;
  }
  .ipx-welcome {
    font-size: 12px;
    padding: 6px 13px;
  }
  .ipx-chips,
  .ipx-radios {
    gap: 6px;
  }
  .ipx-chip,
  .ipx-radio {
    font-size: 12.5px;
    padding: 7px 11px;
  }
  .ipx-input {
    font-size: 13px;
    padding: 10px 12px;
  }
  .ipx-label {
    font-size: 12.5px;
  }
  .ipx-help {
    font-size: 11.5px;
  }
  .ipx-err {
    font-size: 11.5px;
  }
  .ipx-submit {
    padding: 13px 20px;
    font-size: 14px;
  }
  .ipx-back,
  .ipx-back-btn {
    padding: 13px 18px;
    font-size: 14px;
  }
  .ipx-banner {
    padding: 14px 16px;
    font-size: 13px;
  }
  .ipx-modal-backdrop .ipx-cta {
    border-radius: 14px;
  }
  .ipx-modal-backdrop .ipx-cta-header {
    border-radius: 14px 14px 0 0;
    padding: 18px 16px;
  }
  .ipx-modal-close {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .ipx-progress-step {
    height: 4px;
  }
  .ipx-step-label {
    font-size: 11px;
  }
  .ipx-range-val {
    min-width: 50px;
    font-size: 13px;
    padding: 3px 8px;
  }
  .ipx-toggle-track {
    width: 42px;
    height: 24px;
  }
  .ipx-toggle-thumb {
    width: 18px;
    height: 18px;
  }
  .ipx-toggle input:checked+.ipx-toggle-track .ipx-toggle-thumb {
    left: 20px;
  }
  .ipx-toggle-label {
    font-size: 13px;
  }
  .ipx-checkbox {
    font-size: 13px;
  }
  .ipx-checkbox input {
    width: 16px;
    height: 16px;
  }
  .ipx-static {
    font-size: 13px;
  }
  .ipx-success-card {
    padding: 32px 24px;
  }
  .ipx-success-check {
    width: 64px;
    height: 64px;
  }
  .ipx-success-heading {
    font-size: 20px;
  }
  .ipx-success-msg {
    font-size: 13px;
  }
  .ipx-phone-picker {
    padding: 0 8px;
    font-size: 12.5px;
  }
  .ipx-phone-number {
    padding: 11px 12px;
    font-size: 13px;
  }
  .ipx-phone-dropdown {
    width: 260px;
  }
  .ipx-addr-label {
    font-size: 11.5px;
  }
  .ipx-addr-input {
    padding: 9px 11px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .ipx-form,
  .ipx-form-fallback {
    padding: 16px 14px 20px;
  }
  .ipx-layout-card .ipx-cta-header,
  .ipx-layout-inline .ipx-cta-header {
    padding: 18px 14px 14px;
  }
  .ipx-headline {
    font-size: 18px;
  }
  .ipx-subheadline {
    font-size: 13.5px;
  }
  .ipx-welcome {
    font-size: 11.5px;
    padding: 5px 12px;
  }
  .ipx-input {
    font-size: 12.5px;
    padding: 9px 11px;
  }
  .ipx-label {
    font-size: 12px;
  }
  .ipx-submit {
    padding: 12px 18px;
    font-size: 13.5px;
  }
  .ipx-back,
  .ipx-back-btn {
    padding: 12px 16px;
    font-size: 13.5px;
  }
  .ipx-chip,
  .ipx-radio {
    font-size: 12px;
    padding: 6px 10px;
  }
  .ipx-modal-backdrop .ipx-cta-header {
    padding: 16px 14px;
  }
  .ipx-success-card {
    padding: 28px 20px;
  }
}

/* ===== focus visibility ===== */
.ipx-chip:focus-within,
.ipx-radio:focus-within {
  outline: 2px solid var(--ipx-primary);
  outline-offset: 2px;
}

/* ===== Placement: Slide-in (from bottom) ===== */
.ipx-slidein {
  position: fixed;
  z-index: 9990;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px -12px rgba(15,23,42,.35);
  transform: translateY(120%);
  transition: transform .35s cubic-bezier(.34,1.28,.64,1);
}
.ipx-slidein.ipx-slidein-visible { transform: translateY(0); }
.ipx-slidein.ipx-slidein-bottom-right { bottom: 20px; right: 20px; }
.ipx-slidein.ipx-slidein-bottom-left  { bottom: 20px; left:  20px; }

/* ===== Placement: Slide-up (from top) ===== */
.ipx-slideup {
  position: fixed;
  z-index: 9990;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px -12px rgba(15,23,42,.35);
  transform: translateY(-120%);
  transition: transform .35s cubic-bezier(.34,1.28,.64,1);
}
.ipx-slideup.ipx-slideup-visible { transform: translateY(0); }
.ipx-slideup.ipx-slideup-top-left  { top: 20px; left:  20px; }
.ipx-slideup.ipx-slideup-top-right { top: 20px; right: 20px; }

.ipx-slidein-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  background: rgba(255,255,255,.2); border: none; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: 16px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.ipx-slidein-close:hover { background: rgba(255,255,255,.35); }

/* ===== Placement: Sticky Bar ===== */
.ipx-stickybar {
  position: fixed;
  left: 0; right: 0;
  z-index: 9990;
  padding: 10px 20px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(15,23,42,.12);
  display: flex;
  align-items: center;
  gap: 16px;
}
.ipx-stickybar-top    { top: 0;    border-bottom: 1px solid #e5e7eb; }
.ipx-stickybar-bottom { bottom: 0; border-top:    1px solid #e5e7eb; }
.ipx-stickybar .ipx-cta-header { display: none; }
.ipx-stickybar .ipx-form { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0; border: none; box-shadow: none; border-radius: 0; }
.ipx-stickybar .ipx-field { flex: 1; min-width: 160px; }
.ipx-stickybar .ipx-nav { width: auto; }
.ipx-stickybar .ipx-nav .ipx-submit { width: auto; white-space: nowrap; }

.ipx-stickybar-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: #9ca3af; padding: 4px 8px;
  margin-left: auto; flex-shrink: 0;
  transition: color .15s;
}
.ipx-stickybar-close:hover { color: #374151; }

/* ===== Placement: Full Page ===== */
.ipx-fullpage {
  position: fixed; inset: 0; z-index: 9995;
  background: #fff;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}
.ipx-fullpage .ipx-cta { max-width: 600px; width: 100%; }

/* ===== Placement: Sidebar Panel (right) ===== */
.ipx-sidebar-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 100vw;
  z-index: 9990;
  background: #fff;
  box-shadow: -8px 0 40px rgba(15,23,42,.18);
  overflow-y: auto;
  padding: 54px 20px 20px; /* top padding leaves room for the absolute close button */
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}


/* ===== Placement: Sidebar Panel (left) ===== */
.ipx-sidebar-panel.ipx-sidebar-left {
  right: auto; left: 0;
  box-shadow: 8px 0 40px rgba(15,23,42,.18);
  transform: translateX(-100%);
}
.ipx-sidebar-panel.ipx-sidebar-open { transform: translateX(0); }
.ipx-sidebar-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  background: #f3f4f6; border: none; border-radius: 7px;
  width: 30px; height: 30px; cursor: pointer;
  font-size: 18px; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ipx-sidebar-close:hover { background: #fee2e2; color: #ef4444; }

.ipx-sidebar-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9989;
  writing-mode: vertical-rl;
  background: var(--ipx-primary, #f58634);
  color: #fff;
  border: none;
  padding: 12px 10px;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  box-shadow: -4px 0 16px rgba(0,0,0,.15);
  transition: opacity .15s;
}
.ipx-sidebar-toggle:hover { opacity: .9; }

.ipx-sidebar-toggle-left {
  right: auto;
  left: 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 4px 0 16px rgba(0,0,0,.15);
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

@media (max-width: 480px) {
  .ipx-slidein { width: calc(100vw - 24px); bottom: 12px; right: 12px; left: 12px; }
  .ipx-slideup  { width: calc(100vw - 24px); top: 12px; right: 12px; left: 12px; }
  .ipx-sidebar-panel { width: 100vw; }
}

/* ===== inline success overlay ===== */
.ipx-success-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  overflow: hidden;
  min-height: 100%;
}
/* When inside a modal backdrop, cover the full modal */
.ipx-modal-backdrop .ipx-success-overlay {
  position: fixed;
  border-radius: 20px;
}
.ipx-success-overlay.ipx-success-visible {
  opacity: 1;
  pointer-events: auto;
}
.ipx-success-overlay.ipx-success-hiding {
  opacity: 0;
  pointer-events: none;
}
.ipx-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 32px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px -12px rgba(20,48,88,.18);
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: ipx-success-pop .4s cubic-bezier(.34,1.28,.64,1) both;
  position: relative;
  z-index: 1;
  margin: auto;
}
@keyframes ipx-success-pop {
  from { transform: scale(.8) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}
.ipx-success-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34,197,94,.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ipx-success-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}
.ipx-success-msg {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

/* ===== phone field with country picker ===== */
.ipx-phone-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--ipx-border);
  border-radius: var(--ipx-radius-sm);
  background: var(--ipx-input-bg, #fafbfc);
  overflow: visible;
  transition: border-color .15s;
}
.ipx-phone-wrap:focus-within {
  border-color: var(--ipx-primary);
  box-shadow: 0 0 0 3px var(--ipx-primary-tint, rgba(245,134,52,.12));
}
.ipx-field.is-valid   .ipx-phone-wrap { border-color: #2ECC71; background: #f6fff9; }
.ipx-field.is-invalid .ipx-phone-wrap { border-color: #C0392B; background: #FFF5F4; }

.ipx-phone-picker {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-right: 1.5px solid var(--ipx-border);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ipx-text);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .12s;
  border-radius: var(--ipx-radius-sm) 0 0 var(--ipx-radius-sm);
}
.ipx-phone-picker:hover { background: rgba(0,0,0,.04); }
.ipx-phone-flag  { font-size: 18px; line-height: 1; }
.ipx-phone-code  { font-size: 13px; color: var(--ipx-muted); }
.ipx-phone-chevron { font-size: 10px; color: var(--ipx-muted); margin-left: 1px; }

.ipx-phone-number {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: var(--ipx-font-size, 14px);
  border: none;
  background: transparent;
  color: var(--ipx-text);
  outline: none;
}
.ipx-phone-number::placeholder { color: #B0B4BB; }

.ipx-phone-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 280px;
  background: #fff;
  border: 1.5px solid var(--ipx-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 9999;
  overflow: hidden;
}
.ipx-phone-dropdown.open { display: block; }

.ipx-phone-search {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--ipx-border);
  font: inherit;
  font-size: 13px;
  outline: none;
  background: #f8f9fb;
  box-sizing: border-box;
}
.ipx-phone-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
}
.ipx-phone-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
}
.ipx-phone-option:hover { background: var(--ipx-primary-tint, #fff8f2); }
.ipx-phone-opt-flag { font-size: 17px; flex-shrink: 0; }
.ipx-phone-opt-name { flex: 1; color: var(--ipx-text); font-weight: 500; }
.ipx-phone-opt-code { color: var(--ipx-muted); font-size: 12px; flex-shrink: 0; }

/* ===== address group field ===== */
.ipx-address-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.ipx-field:has(.ipx-address-group) .ipx-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ipx-muted);
  font-weight: 600;
  white-space: nowrap;
}
.ipx-field:has(.ipx-address-group) .ipx-label::before,
.ipx-field:has(.ipx-address-group) .ipx-label::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--ipx-border);
}
.ipx-addr-field { display: flex; flex-direction: column; gap: 4px; }
.ipx-addr-full  { grid-column: 1 / -1; }
.ipx-addr-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ipx-muted);
  letter-spacing: .01em;
}
.ipx-addr-input {
  padding: 10px 12px;
  font-size: 13.5px;
}
@media (max-width: 480px) {
  .ipx-address-group { grid-template-columns: 1fr; }
  .ipx-addr-full { grid-column: 1; }
}

/* ===== multi-column field layout ===== */
.ipx-fields-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0 12px;
  width: 100%;
}
/* Default: full width */
.ipx-fields-grid .ipx-field {
  grid-column: span 6;
}
/* Half width — 2 per row */
.ipx-fields-grid .ipx-field.ipx-col-half {
  grid-column: span 3;
}
/* One-third — 3 per row */
.ipx-fields-grid .ipx-field.ipx-col-third {
  grid-column: span 2;
}
/* On mobile — always full width */
@media (max-width: 560px) {
  .ipx-fields-grid .ipx-field.ipx-col-half,
  .ipx-fields-grid .ipx-field.ipx-col-third {
    grid-column: span 6;
  }
}
