:root { --erm-default-accent: #eb660c; }
body.erm-modal-open { overflow: hidden; }

.erm-trigger-button {
  --erm-button-accent: var(--erm-default-accent);
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border: 1px solid var(--erm-button-accent);
  border-radius: 999px;
  color: #fff;
  background: var(--erm-button-accent);
  font: 600 15px/1 "Poppins", sans-serif;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.erm-trigger-button:hover { color: #fff; filter: brightness(.88); box-shadow: 0 12px 28px rgb(235 102 12 / 24%); transform: translateY(-2px); }

.erm-modal,
.erm-modal *,
.erm-modal *::before,
.erm-modal *::after { box-sizing: border-box; }

.erm-modal {
  --erm-accent: var(--erm-default-accent);
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 24px;
  place-items: center;
  color: #1c1917;
  font: 400 16px/1.5 "Poppins", sans-serif;
}

.erm-modal[hidden] { display: none; }
.erm-modal button, .erm-modal input { font: inherit; }
.erm-modal button { cursor: pointer; }

.erm-modal__backdrop { position: fixed; inset: 0; background: rgb(16 12 9 / 68%); backdrop-filter: blur(5px); opacity: 0; transition: opacity 220ms ease; }

.erm-modal__dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 30px 100px rgb(0 0 0 / 24%);
  opacity: 0;
  outline: 0;
  transform: translateY(16px) scale(.985);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.22, 1, .36, 1);
}

.erm-modal.is-visible .erm-modal__backdrop, .erm-modal.is-visible .erm-modal__dialog { opacity: 1; }
.erm-modal.is-visible .erm-modal__dialog { transform: none; }

.erm-modal__close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #6f6863;
  background: #f7f4f2;
  place-items: center;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.erm-modal__close:hover { color: var(--erm-accent); background: #fff6f0; transform: rotate(4deg); }
.erm-modal__close svg, .erm-captcha__refresh svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.erm-progress { height: 4px; margin: -4px 54px 34px 0; overflow: hidden; border-radius: 999px; background: #f0ece9; }
.erm-progress__bar { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--erm-accent); transition: width 320ms cubic-bezier(.22, 1, .36, 1); }
.erm-heading { margin-bottom: 30px; }

.erm-heading__eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--erm-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.erm-heading h2, .erm-success h2 { margin: 0; color: #1c1917; font: 700 clamp(27px, 4vw, 39px)/1.12 "Poppins", sans-serif; letter-spacing: -.035em; }
.erm-heading p, .erm-success p { margin: 12px 0 0; color: #6f6863; font-size: 15px; line-height: 1.7; }
.erm-step { display: none; }
.erm-step.is-active { display: block; animation: erm-step-in 280ms ease both; }
.erm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 18px; }
.erm-field { min-width: 0; }
.erm-field--wide { grid-column: 1 / -1; }
.erm-field label { display: block; margin-bottom: 7px; color: #1c1917; font-size: 13px; font-weight: 600; }

.erm-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #e8e2dd;
  border-radius: 10px;
  color: #1c1917;
  background: #fff;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.erm-field input:hover { border-color: #cec5bf; }
.erm-field input:focus { border-color: var(--erm-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--erm-accent) 12%, transparent); outline: 0; }
.erm-field input.is-invalid { border-color: #b42318; background: #fff8f7; }
.erm-field__hint, .erm-field__error { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; }
.erm-field__hint { color: #6f6863; }
.erm-field__error { color: #b42318; font-weight: 500; }
.erm-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(1px, 1px, 1px, 1px) !important; }

.erm-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.erm-button--full { width: 100%; margin-top: 28px; }
.erm-button--primary { border: 1px solid var(--erm-accent); color: #fff; background: var(--erm-accent); }
.erm-button--primary:hover:not(:disabled) { color: #fff; filter: brightness(.88); box-shadow: 0 9px 24px color-mix(in srgb, var(--erm-accent) 24%, transparent); transform: translateY(-1px); }
.erm-button--secondary { border: 1px solid #e8e2dd; color: #1c1917; background: #fff; }
.erm-button--secondary:hover { border-color: #cec5bf; background: #f8f6f4; }
.erm-button:disabled { cursor: wait; opacity: .72; }
.erm-actions { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 26px; }

.erm-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; padding: 18px; border: 1px solid #e8e2dd; border-radius: 12px; background: #fcfbfa; }
.erm-summary__item span { display: block; color: #6f6863; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.erm-summary__item strong { display: block; overflow: hidden; margin-top: 3px; color: #1c1917; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.erm-captcha { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; padding: 16px 18px; border: 1px solid #f3d0b9; border: 1px solid color-mix(in srgb, var(--erm-accent) 26%, #fff); border-radius: 12px; background: #fff7f2; background: color-mix(in srgb, var(--erm-accent) 7%, #fff); }
.erm-captcha__label { color: var(--erm-accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.erm-captcha p { margin: 4px 0 0; color: #1c1917; font-weight: 600; }
.erm-captcha__refresh { display: grid; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 1px solid color-mix(in srgb, var(--erm-accent) 28%, #fff); border-radius: 50%; color: var(--erm-accent); background: #fff; place-items: center; transition: transform 180ms ease; }
.erm-captcha__refresh:hover { transform: rotate(25deg); }
.erm-form-error { margin-top: 16px; padding: 12px 14px; border: 1px solid #f3b7b1; border-radius: 9px; color: #b42318; background: #fff4f2; font-size: 13px; }

.erm-button__spinner { display: none; width: 17px; height: 17px; border: 2px solid rgb(255 255 255 / 42%); border-top-color: #fff; border-radius: 50%; animation: erm-spin 650ms linear infinite; }
.erm-button.is-loading .erm-button__spinner { display: block; }
.erm-success { padding: 30px 0 8px; text-align: center; }
.erm-success__icon { display: grid; width: 72px; height: 72px; margin: 0 auto 25px; border-radius: 50%; color: #fff; background: var(--erm-accent); box-shadow: 0 13px 34px color-mix(in srgb, var(--erm-accent) 28%, transparent); place-items: center; }
.erm-success__icon svg { width: 35px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.erm-success p { max-width: 500px; margin-right: auto; margin-left: auto; }
.erm-success .erm-button { min-width: 180px; margin-top: 30px; }

.erm-trigger-button:focus-visible, .erm-modal button:focus-visible, .erm-modal input:focus-visible { outline: 3px solid color-mix(in srgb, var(--erm-accent, var(--erm-default-accent)) 28%, transparent); outline-offset: 3px; }

@keyframes erm-step-in { from { opacity: 0; transform: translateX(9px); } to { opacity: 1; transform: none; } }
@keyframes erm-spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) { .erm-modal { padding: 12px; } .erm-modal__dialog { max-height: calc(100vh - 24px); } }
@media (max-width: 540px) { .erm-fields, .erm-summary { grid-template-columns: 1fr; } .erm-field--wide { grid-column: auto; } .erm-actions { grid-template-columns: 1fr; } .erm-actions .erm-button--secondary { order: 2; } }
@media (prefers-reduced-motion: reduce) { .erm-modal *, .erm-modal *::before, .erm-modal *::after, .erm-trigger-button { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
