/* Mad Digi enquiry form. Scoped to .mdef so nothing leaks into the theme. */

.mdef {
  --mdef-accent: #FCAF17;
  --mdef-accent-wash: #FFF4DC;
  --mdef-gold-text: #8a5c00;
  --mdef-ink: #27272E;
  --mdef-ink-2: #31313a;
  --mdef-ink-line: rgba(255, 255, 255, .1);
  --mdef-on-ink: #c9c9d3;
  --mdef-heading: #292930;
  --mdef-text: #525260;
  --mdef-muted: #77778a;
  --mdef-band: #ECF2F6;
  --mdef-line: #d6dee5;
  --mdef-field: #F6F9FB;
  --mdef-error: #c4321f;
  --mdef-error-wash: #fdecea;
  --mdef-white: #fff;
  --mdef-head: "DM Sans", sans-serif;
  --mdef-body: "Poppins", sans-serif;
  --mdef-ease: cubic-bezier(.2, .7, .2, 1);
  display: block;
  padding-block: clamp(56px, 8vw, 112px);
  background: var(--mdef-white);
  color: var(--mdef-text);
  font-family: var(--mdef-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.02em;
  text-align: left;
  scroll-margin-top: 90px;
}
.mdef *, .mdef *::before, .mdef *::after { box-sizing: border-box; }
.mdef :where(h2, h3, p, ol, ul, fieldset, legend) { margin: 0; padding: 0; }
.mdef :where(ol, ul) { list-style: none; }
.mdef :where(li) { margin: 0; padding: 0; }
.mdef :where(li)::before, .mdef :where(li)::marker { content: none; }
.mdef fieldset { border: 0; min-width: 0; }
.mdef a { text-decoration: none; }
.mdef [hidden] { display: none !important; }
.mdef .mdef-i { width: 20px; height: 20px; flex: 0 0 auto; }
.mdef a:focus-visible, .mdef button:focus-visible { outline: 3px solid var(--mdef-accent); outline-offset: 3px; }
.mdef [tabindex="-1"]:focus { outline: none; }

.mdef .mdef__wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 24px); }
.mdef .mdef__shell {
  display: grid; overflow: hidden; border-radius: 30px; background: var(--mdef-white);
  box-shadow: 0 2px 8px rgba(39, 39, 46, .05), 0 50px 100px -50px rgba(39, 39, 46, .45);
  border: 1px solid #e6ecf1;
}
@media (min-width: 1024px) {
  .mdef .mdef__shell { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
}

/* ------------------------------------------------------------------ intro (dark panel) */
.mdef .mdef__intro {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 28px;
  padding: clamp(32px, 4.5vw, 56px); background: var(--mdef-ink); color: var(--mdef-on-ink);
}
.mdef .mdef__intro::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.4px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(80% 70% at 100% 0%, #000, transparent 70%);
          mask-image: radial-gradient(80% 70% at 100% 0%, #000, transparent 70%);
}
.mdef .mdef__intro::after {
  content: ""; position: absolute; z-index: -1; right: -150px; bottom: -170px; width: 380px; height: 380px; border-radius: 50%;
  border: 52px solid rgba(252, 175, 23, .08); pointer-events: none;
}
.mdef .mdef__eyebrow { display: flex; align-items: center; gap: 12px; font-size: .8125rem; font-weight: 600; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--mdef-on-ink); }
.mdef .mdef__eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--mdef-accent); }
.mdef .mdef__title {
  margin-top: -8px; font-family: var(--mdef-head); font-size: clamp(2.25rem, 1.4rem + 3vw, 3.5rem); font-weight: 700;
  line-height: 1.05; letter-spacing: -.045em; color: var(--mdef-white); text-wrap: balance;
}
.mdef .mdef__title span { display: block; }
@media (min-width: 1024px) { .mdef .mdef__title { font-size: clamp(2rem, .8rem + 1.9vw, 2.5rem); } }
.mdef .mdef__title-accent { color: var(--mdef-accent); }
.mdef .mdef__lead { margin-top: -10px; max-width: 42ch; font-size: 1.0625rem; line-height: 1.7; color: var(--mdef-on-ink); }

.mdef .mdef__steps { display: grid; gap: 4px; counter-reset: none; }
.mdef .mdef__steps li { position: relative; display: flex; gap: 16px; padding: 12px 0; }
.mdef .mdef__steps li:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 54px; bottom: -6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--mdef-ink-line), rgba(255, 255, 255, .02)); }
.mdef .mdef__step-n {
  display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 14px;
  background: rgba(252, 175, 23, .12); border: 1px solid rgba(252, 175, 23, .35); color: var(--mdef-accent);
  font-family: var(--mdef-head); font-weight: 700; font-size: 1rem;
}
.mdef .mdef__steps li div { display: grid; gap: 2px; padding-top: 1px; }
.mdef .mdef__steps strong { font-family: var(--mdef-head); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: var(--mdef-white); }
.mdef .mdef__steps span { font-size: .9375rem; line-height: 1.55; color: var(--mdef-on-ink); }

.mdef .mdef__direct { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--mdef-ink-line); }
.mdef .mdef__direct-title { font-size: .875rem; font-weight: 500; color: var(--mdef-on-ink); }
.mdef .mdef__direct-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mdef .mdef__chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; border-radius: 16px;
  border: 1px solid var(--mdef-ink-line); background: rgba(255, 255, 255, .05); color: var(--mdef-white);
  font-size: .9375rem; font-weight: 500; transition: background-color .2s, border-color .2s, color .2s;
}
.mdef .mdef__chip .mdef-i { width: 18px; height: 18px; color: var(--mdef-accent); }
.mdef .mdef__chip:hover { background: var(--mdef-accent); border-color: var(--mdef-accent); color: var(--mdef-ink); }
.mdef .mdef__chip:hover .mdef-i { color: var(--mdef-ink); }

/* ------------------------------------------------------------------ form panel */
.mdef .mdef__panel { position: relative; padding: clamp(28px, 4.5vw, 56px); background: var(--mdef-white); }
.mdef .mdef__form { display: grid; gap: 28px; }
.mdef .mdef__group { display: grid; gap: 16px; }
.mdef .mdef__legend {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 16px; padding: 0;
  font-family: var(--mdef-head); font-size: 1.125rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; color: var(--mdef-heading);
}
.mdef .mdef__legend span { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--mdef-accent-wash); color: var(--mdef-gold-text); font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.mdef .mdef__legend::after { content: ""; flex: 1 1 auto; height: 1px; background: #e6ecf1; }
.mdef .mdef__grid { display: grid; gap: 16px 18px; }
@media (min-width: 640px) {
  .mdef .mdef__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mdef .mdef__field--full { grid-column: 1 / -1; }
}

.mdef .mdef__field { display: grid; gap: 8px; min-width: 0; }
.mdef .mdef__label { display: flex; align-items: baseline; gap: 6px; font-size: .9375rem; font-weight: 500; line-height: 1.3; color: var(--mdef-heading); letter-spacing: -.015em; }
.mdef .mdef__req { color: var(--mdef-error); font-weight: 600; }
.mdef .mdef__opt { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--mdef-band); color: var(--mdef-muted); font-size: .6875rem; font-weight: 500; letter-spacing: .02em; line-height: 1.5; }

.mdef .mdef__control { position: relative; display: flex; align-items: center; }
.mdef .mdef__control > .mdef-i:first-child {
  position: absolute; left: 16px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: #9a9aab; pointer-events: none; transition: color .2s;
}
.mdef .mdef__control--area > .mdef-i:first-child { top: 17px; transform: none; }
.mdef .mdef__input {
  display: block; width: 100%; min-height: 54px; margin: 0; padding: 14px 44px 14px 46px; border: 1.5px solid var(--mdef-line); border-radius: 16px;
  background: var(--mdef-field); color: var(--mdef-ink); font-family: var(--mdef-body); font-size: 16px; font-weight: 400; line-height: 1.4; letter-spacing: -.01em;
  box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, background-color .2s, box-shadow .25s;
}
.mdef input.mdef__input, .mdef select.mdef__input { height: 54px; }
.mdef .mdef__input::placeholder { color: #a2a2b2; opacity: 1; }
.mdef .mdef__input:hover { border-color: #bcc8d2; background: var(--mdef-white); }
.mdef .mdef__input:focus { border-color: var(--mdef-ink); background: var(--mdef-white); box-shadow: 0 0 0 4px rgba(252, 175, 23, .32); }
.mdef .mdef__control:focus-within > .mdef-i:first-child { color: var(--mdef-ink); }
.mdef .mdef__textarea { height: auto; min-height: 132px; padding-top: 15px; resize: vertical; line-height: 1.6; }
.mdef .mdef__select { padding-right: 46px; cursor: pointer; color: var(--mdef-ink); }
.mdef .mdef__select:invalid, .mdef .mdef__select.is-empty { color: #a2a2b2; }
.mdef .mdef__select option { color: var(--mdef-ink); }
.mdef .mdef__control--select > .mdef-i--down { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--mdef-ink); pointer-events: none; transition: transform .25s; }
.mdef .mdef__control--select:focus-within > .mdef-i--down { transform: translateY(-50%) rotate(180deg); }

.mdef .mdef__ok {
  position: absolute; right: 14px; top: 50%; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--mdef-accent); color: var(--mdef-ink); transform: translateY(-50%) scale(.4); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .3s var(--mdef-ease);
}
.mdef .mdef__ok .mdef-i { width: 13px; height: 13px; stroke-width: 3; }
.mdef .mdef__control--area .mdef__ok { top: 16px; transform: scale(.4); }
.mdef .mdef__control--select .mdef__ok { right: 42px; }
.mdef .mdef__field.is-valid .mdef__ok { opacity: 1; transform: translateY(-50%) scale(1); }
.mdef .mdef__field.is-valid .mdef__control--area .mdef__ok { transform: scale(1); }

.mdef .mdef__err { display: none; align-items: flex-start; gap: 6px; font-size: .8125rem; font-weight: 500; line-height: 1.4; color: var(--mdef-error); }
.mdef .is-invalid > .mdef__err { display: flex; animation: mdef-in .25s var(--mdef-ease); }
.mdef .mdef__err::before {
  content: "!"; display: inline-grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%;
  background: var(--mdef-error); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 1;
}
.mdef .mdef__field.is-invalid .mdef__input { border-color: var(--mdef-error); background: var(--mdef-error-wash); }
.mdef .mdef__field.is-invalid .mdef__input:focus { box-shadow: 0 0 0 4px rgba(196, 50, 31, .16); }
.mdef .mdef__field.is-invalid .mdef__control > .mdef-i:first-child { color: var(--mdef-error); }
.mdef .is-shake { animation: mdef-shake .35s; }

/* Consent */
.mdef .mdef__consent { display: grid; gap: 8px; }
.mdef .mdef__check { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: .875rem; line-height: 1.55; color: var(--mdef-text); }
.mdef .mdef__check input { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.mdef .mdef__box {
  display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; margin-top: 0; border: 1.5px solid #b7c3cd; border-radius: 8px;
  background: var(--mdef-white); color: var(--mdef-ink); transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.mdef .mdef__box .mdef-i { width: 15px; height: 15px; stroke-width: 3; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .25s var(--mdef-ease); }
.mdef .mdef__check input:checked + .mdef__box { background: var(--mdef-accent); border-color: var(--mdef-accent); }
.mdef .mdef__check input:checked + .mdef__box .mdef-i { opacity: 1; transform: scale(1); }
.mdef .mdef__check input:focus-visible + .mdef__box { box-shadow: 0 0 0 4px rgba(252, 175, 23, .35); border-color: var(--mdef-ink); }
.mdef .mdef__check:hover .mdef__box { border-color: var(--mdef-ink); }
.mdef .is-invalid .mdef__box { border-color: var(--mdef-error); background: var(--mdef-error-wash); }
.mdef .mdef__check a { color: var(--mdef-ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--mdef-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mdef .mdef__check a:hover { color: var(--mdef-gold-text); }

.mdef .mdef__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Submit */
.mdef .mdef__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.mdef .mdef__btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 58px; margin: 0; padding: 0 12px 0 28px;
  border: 0; border-radius: 20px; background: var(--mdef-accent); color: var(--mdef-ink); cursor: pointer;
  font-family: var(--mdef-body); font-size: 1.0625rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; text-transform: none;
  box-shadow: 0 18px 36px -18px rgba(252, 175, 23, .9); transition: background-color .25s, color .25s, box-shadow .25s, transform .2s;
}
.mdef .mdef__btn-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 14px; background: var(--mdef-ink); color: var(--mdef-accent); transition: transform .3s var(--mdef-ease), background-color .25s, color .25s; }
.mdef .mdef__btn-icon .mdef-i { width: 18px; height: 18px; }
.mdef .mdef__btn:hover, .mdef .mdef__btn:focus-visible { background: var(--mdef-ink); color: var(--mdef-white); box-shadow: 0 18px 36px -18px rgba(39, 39, 46, .7); }
.mdef .mdef__btn:hover .mdef__btn-icon, .mdef .mdef__btn:focus-visible .mdef__btn-icon { background: var(--mdef-accent); color: var(--mdef-ink); transform: rotate(-12deg) translateX(2px); }
.mdef .mdef__btn:active { transform: translateY(1px); }
.mdef .mdef__spinner { display: none; width: 38px; height: 38px; border-radius: 14px; background: var(--mdef-ink); position: relative; }
.mdef .mdef__spinner::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2.5px solid rgba(252, 175, 23, .3); border-top-color: var(--mdef-accent); animation: mdef-spin .8s linear infinite; }
.mdef .mdef__btn[aria-busy="true"] { cursor: progress; background: var(--mdef-accent); color: var(--mdef-ink); }
.mdef .mdef__btn[aria-busy="true"] .mdef__btn-icon { display: none; }
.mdef .mdef__btn[aria-busy="true"] .mdef__spinner { display: block; }
.mdef .mdef__btn:disabled { opacity: 1; }
.mdef .mdef__note { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 220px; font-size: .8125rem; line-height: 1.5; color: var(--mdef-muted); }
.mdef .mdef__note .mdef-i { width: 16px; height: 16px; margin-top: 1px; color: var(--mdef-gold-text); }
.mdef .is-sending .mdef__input, .mdef .is-sending .mdef__check { opacity: .65; pointer-events: none; }

/* Alert */
.mdef .mdef__alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(196, 50, 31, .25);
  background: var(--mdef-error-wash); color: #8f2414; font-size: .9375rem; line-height: 1.5; animation: mdef-in .3s var(--mdef-ease);
}
.mdef .mdef__alert .mdef-i { width: 20px; height: 20px; margin-top: 1px; color: var(--mdef-error); }
.mdef .mdef__alert a { color: #8f2414; font-weight: 600; text-decoration: underline; }

/* Success */
.mdef .mdef__success { display: grid; justify-items: center; align-content: center; gap: 16px; min-height: 100%; padding: clamp(24px, 4vw, 48px) 8px; text-align: center; animation: mdef-in .5s var(--mdef-ease); }
.mdef .mdef__success-badge {
  position: relative; display: grid; place-items: center; width: 88px; height: 88px; border-radius: 30px; background: var(--mdef-accent); color: var(--mdef-ink);
  box-shadow: 0 24px 48px -20px rgba(252, 175, 23, .95); animation: mdef-pop .6s var(--mdef-ease) both .1s;
}
.mdef .mdef__success-badge::after { content: ""; position: absolute; inset: -10px; border-radius: 36px; border: 2px solid rgba(252, 175, 23, .35); animation: mdef-ring 1.6s var(--mdef-ease) .3s both; }
.mdef .mdef__success-badge .mdef-i { width: 42px; height: 42px; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: mdef-draw .5s ease-out .45s forwards; }
.mdef .mdef__success-title { margin-top: 8px; font-family: var(--mdef-head); font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem); font-weight: 700; line-height: 1.15; letter-spacing: -.035em; color: var(--mdef-heading); text-wrap: balance; }
.mdef .mdef__success-text { max-width: 40ch; font-size: 1.0625rem; line-height: 1.7; color: var(--mdef-text); }
.mdef .mdef__success-note { font-size: .9375rem; color: var(--mdef-muted); }
.mdef .mdef__success-note a { color: var(--mdef-ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--mdef-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mdef .mdef__again {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; margin: 8px 0 0; padding: 0 18px; border: 1px solid var(--mdef-line); border-radius: 999px;
  background: var(--mdef-white); color: var(--mdef-ink); font-family: var(--mdef-body); font-size: .9375rem; font-weight: 500; line-height: 1; cursor: pointer; text-transform: none; box-shadow: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.mdef .mdef__again .mdef-i { width: 17px; height: 17px; }
.mdef .mdef__again:hover { background: var(--mdef-ink); border-color: var(--mdef-ink); color: var(--mdef-white); }

@keyframes mdef-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mdef-pop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes mdef-ring { from { opacity: 1; transform: scale(.8); } to { opacity: 0; transform: scale(1.25); } }
@keyframes mdef-draw { to { stroke-dashoffset: 0; } }
@keyframes mdef-spin { to { transform: rotate(360deg); } }
@keyframes mdef-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Mobile */
@media (max-width: 639px) {
  .mdef .mdef__shell { border-radius: 26px; }
  .mdef .mdef__intro { gap: 22px; }
  .mdef .mdef__steps li { padding: 8px 0; }
  .mdef .mdef__steps li:not(:last-child)::after { top: 48px; }
  .mdef .mdef__actions { flex-direction: column; align-items: stretch; }
  .mdef .mdef__btn { width: 100%; justify-content: space-between; }
  .mdef .mdef__direct-links { flex-direction: column; }
  .mdef .mdef__chip { justify-content: flex-start; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .mdef .mdef__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .mdef .mdef__steps li { flex-direction: column; gap: 12px; }
  .mdef .mdef__steps li:not(:last-child)::after { display: none; }
  .mdef .mdef__direct { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mdef *, .mdef *::before, .mdef *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .mdef .mdef__success-badge .mdef-i { stroke-dashoffset: 0; }
}
