/* Lead-form submission panel + error box - shared by the homepage (style.css)
   and the inner pages (base.css). Used by new/js/lead-forms.js. */

/* ===== Enquiry / site-visit submission panel (new/js/script.js statusLayer)
   is-sending: the form recedes (blur + drift), the panel fades up and an
   orange ring traces the circle. is-sent: the ring closes into a filled
   disc, the tick draws, a soft halo pulses and sparks burst out, the copy
   rises in and a thin bar counts down. is-leaving: the drawer eases out
   to the right while fading. */
.sv-form { transition: opacity 450ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1), filter 450ms ease; }
.sv-host.is-sending .sv-form {
  opacity: 0; transform: translateY(-14px) scale(0.98); filter: blur(6px);
  pointer-events: none;
}
.sv-close { transition: background 200ms ease, opacity 300ms ease; }
.sv-host.is-sending .sv-close { opacity: 0; pointer-events: none; }

/* base.css opens the drawer with transform: none - give it an identity transform
   while the panel shows, so the panel's position: fixed is relative to the drawer */
.sv-drawer.is-open.is-sending { transform: translateX(0); }

.sv-status {
  /* fixed inside the transformed drawer = pinned to the drawer, not the page */
  position: fixed; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(28px, 4vw, 40px);
  background:
    radial-gradient(120% 70% at 50% 38%, rgba(241, 89, 34, 0.10), rgba(241, 89, 34, 0) 60%),
    #FFF9F7;
  opacity: 0; visibility: hidden;
  transition: opacity 450ms ease 120ms, visibility 0s linear 600ms;
  text-align: center;
}
.sv-host.is-sending .sv-status { opacity: 1; visibility: visible; transition: opacity 450ms ease 120ms, visibility 0s; }
.sv-status__inner { width: 100%; max-width: 300px; }

/* the mark: track + travelling arc, later a filled disc with a tick */
.sv-status__mark { position: relative; width: 96px; height: 96px; margin: 0 auto 26px; }
.sv-status__mark svg { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.sv-status__track { fill: none; stroke: rgba(241, 89, 34, 0.14); stroke-width: 3; }
.sv-status__ring {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 26 74; stroke-dashoffset: 0;
  transform-origin: 44px 44px;
  animation: sv-orbit 1.1s cubic-bezier(0.5, 0.15, 0.5, 0.85) infinite;
}
@keyframes sv-orbit {
  0%   { transform: rotate(-90deg); stroke-dasharray: 8 92; }
  50%  { stroke-dasharray: 46 54; }
  100% { transform: rotate(270deg); stroke-dasharray: 8 92; }
}
.sv-status__disc {
  fill: var(--accent); stroke: none;
  transform-origin: 44px 44px; transform: scale(0.2); opacity: 0;
}
.sv-status__tick {
  fill: none; stroke: #FFFFFF; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
}
.sv-status__halo {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(241, 89, 34, 0.28); opacity: 0;
}
.sv-status__spark {
  position: absolute; top: 50%; left: 50%;
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--accent); opacity: 0;
  transform: rotate(calc(var(--i) * 45deg)) translateY(0) scale(0.4);
}
.sv-status__spark:nth-child(odd) { background: #F6A57F; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }

/* sent: ring locks to a full circle, disc pops, tick draws */
.sv-host.is-sent .sv-status__ring { animation: none; stroke-dasharray: 100 0; transform: rotate(-90deg); }
.sv-host.is-sent .sv-status__disc { animation: sv-pop 620ms cubic-bezier(0.34, 1.56, 0.64, 1) 220ms forwards; }
.sv-host.is-sent .sv-status__tick { animation: sv-draw 420ms cubic-bezier(0.65, 0, 0.35, 1) 560ms forwards; }
.sv-host.is-sent .sv-status__halo { animation: sv-halo 1100ms cubic-bezier(0.22, 1, 0.36, 1) 380ms forwards; }
.sv-host.is-sent .sv-status__spark { animation: sv-spark 900ms cubic-bezier(0.22, 1, 0.36, 1) 420ms forwards; }
@keyframes sv-pop  { 0% { transform: scale(0.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes sv-draw { to { stroke-dashoffset: 0; } }
@keyframes sv-halo { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes sv-spark {
  0%   { opacity: 0; transform: rotate(calc(var(--i) * 45deg)) translateY(0) scale(0.4); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(calc(var(--i) * 45deg)) translateY(-72px) scale(1); }
}

/* copy: rises in, and again when it swaps to the thank-you text */
.sv-status__eyebrow {
  margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
}
.sv-status__title {
  margin: 10px 0 0; font-family: var(--font-serif); font-style: italic; font-weight: 500;
  font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; color: var(--ink);
}
.sv-status__text { margin: 12px auto 0; max-width: 280px; font-size: 14px; line-height: 1.6; color: rgb(90, 72, 60); }
.sv-host.is-sending .sv-status__eyebrow,
.sv-host.is-sending .sv-status__title,
.sv-host.is-sending .sv-status__text { animation: sv-rise 600ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.sv-host.is-sending .sv-status__title { animation-delay: 60ms; }
.sv-host.is-sending .sv-status__text { animation-delay: 120ms; }
.sv-host.is-sent .sv-status__eyebrow,
.sv-host.is-sent .sv-status__title,
.sv-host.is-sent .sv-status__text { animation: sv-rise2 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.sv-host.is-sent .sv-status__eyebrow { animation-delay: 650ms; }
.sv-host.is-sent .sv-status__title { animation-delay: 730ms; }
.sv-host.is-sent .sv-status__text { animation-delay: 810ms; }
@keyframes sv-rise  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes sv-rise2 { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* sending: a light sweeps along the bar; sent: the bar counts down to the exit */
.sv-status__bar {
  position: relative; overflow: hidden;
  width: 120px; height: 3px; margin: 28px auto 0; border-radius: 3px;
  background: rgba(241, 89, 34, 0.14);
}
.sv-status__bar span {
  position: absolute; inset: 0; border-radius: inherit; background: var(--accent);
  transform-origin: left center; transform: translateX(-100%) scaleX(0.35);
  animation: sv-shimmer 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes sv-shimmer { 0% { transform: translateX(-100%) scaleX(0.35); } 100% { transform: translateX(100%) scaleX(0.35); } }
.sv-host.is-sent .sv-status__bar span { animation: sv-countdown 2.6s linear 600ms both; }
@keyframes sv-countdown { from { transform: translateX(0) scaleX(1); } to { transform: translateX(0) scaleX(0); } }

/* exit: the drawer eases out with a slight fade (the backdrop fades with it) */
.sv-drawer.is-leaving {
  opacity: 0;
  transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1), opacity 500ms ease 180ms;
}

@media (prefers-reduced-motion: reduce) {
  .sv-form, .sv-status, .sv-drawer.is-leaving { transition-duration: 1ms; transition-delay: 0s; }
  .sv-status__ring, .sv-status__bar span { animation: none; stroke-dasharray: 100 0; }
  .sv-host.is-sent .sv-status__disc { animation: none; transform: none; opacity: 1; }
  .sv-host.is-sent .sv-status__tick { animation: none; stroke-dashoffset: 0; }
  .sv-host.is-sent .sv-status__halo, .sv-host.is-sent .sv-status__spark { animation: none; }
  .sv-status__eyebrow, .sv-status__title, .sv-status__text { animation: none !important; }
}

.sv-form .error-form {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 10px;
  background: rgba(200, 60, 40, 0.1); color: rgb(170, 45, 25);
  font-size: 13px; font-weight: 600;
}

/* a form on the page (e.g. Contact): the panel covers just the form's box,
   then the form fades back in, reset (no drawer to close) */
.sv-host:not(.sv-drawer) { position: relative; }
.sv-host:not(.sv-drawer) > .sv-status { position: absolute; border-radius: inherit; }

/* lead-form date fields open their calendar on a click anywhere (new/js/lead-forms.js) */
.sv-form input[type="date"] { cursor: pointer; }
