/* ===== SHARED "GET A QUOTE" POPUP (templates/components/quote-popup.html) ===== */
.qp-modal {
  --qp-text: #ffffff;
  --qp-body: rgba(255, 255, 255, 0.74);
  --qp-muted: rgba(255, 255, 255, 0.5);
  --qp-line: rgba(255, 255, 255, 0.1);
  --qp-accent: #e05a1e;
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: "DM Sans", sans-serif;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}
html[data-theme="light"] .qp-modal {
  --qp-text: #141414;
  --qp-body: #3d3d3d;
  --qp-muted: #6b6b6b;
  --qp-line: rgba(0, 0, 0, 0.12);
}
.qp-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}
.qp-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 38px 36px 34px;
  border: 1px solid rgba(224, 90, 30, 0.35);
  border-radius: 24px;
  background: linear-gradient(160deg, #1a120d 0%, #0e0e0e 45%);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(224, 90, 30, 0.12);
  opacity: 0;
  transform: translateY(34px) scale(0.94);
  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease;
}
html[data-theme="light"] .qp-card {
  background: linear-gradient(160deg, #fff3ec 0%, #ffffff 45%);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.25),
    0 0 60px rgba(224, 90, 30, 0.12);
}
.qp-modal.is-open .qp-card {
  opacity: 1;
  transform: none;
}
.qp-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ef6b2c, #ffb088, #ef6b2c, transparent);
  background-size: 200% 100%;
  animation: qpSweep 3.2s linear infinite;
}
.qp-glow {
  position: absolute;
  top: -110px;
  right: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 107, 44, 0.3), transparent 68%);
  pointer-events: none;
  animation: qpFloat 6s ease-in-out infinite;
}
.qp-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--qp-line);
  border-radius: 50%;
  background: transparent;
  color: var(--qp-text);
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    color 0.25s ease,
    background 0.25s ease;
}
.qp-close:hover {
  transform: rotate(90deg);
  border-color: var(--qp-accent);
  background: rgba(224, 90, 30, 0.12);
  color: var(--qp-accent);
}

/* header */
.qp-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 44px;
}
.qp-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ef6b2c 0%, #d14e14 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(224, 90, 30, 0.45);
  animation: qpBadge 3s ease-in-out infinite;
}
.qp-modal .qp-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--qp-accent) !important;
}
.qp-modal .qp-title {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
  text-transform: none;
  color: var(--qp-text);
}
.qp-modal .qp-sub {
  position: relative;
  margin: 16px 0 22px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--qp-body) !important;
}

/* parts rise in one after another when the popup opens */
.qp-rise {
  opacity: 0;
  transform: translateY(14px);
}
.qp-modal.is-open .qp-rise {
  animation: qpRise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(0.12s + var(--i, 0) * 0.06s);
}

/* fields */
.qp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.qp-field {
  position: relative;
  display: block;
  margin: 0 0 12px;
}
.qp-field input,
.qp-field textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 22px 14px 8px;
  border: 1px solid var(--qp-line);
  border-radius: 12px;
  background: rgba(128, 128, 128, 0.08);
  font-family: inherit;
  font-size: 15px;
  color: var(--qp-text);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}
.qp-field textarea {
  display: block;
  min-height: 92px;
  resize: vertical;
}
.qp-field span {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 14.5px;
  color: var(--qp-muted);
  pointer-events: none;
  transform-origin: left top;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.25s ease;
}
.qp-field input:focus,
.qp-field textarea:focus {
  outline: none;
  border-color: var(--qp-accent);
  background: rgba(224, 90, 30, 0.06);
  box-shadow: 0 0 0 4px rgba(224, 90, 30, 0.14);
}
.qp-field input:focus + span,
.qp-field textarea:focus + span,
.qp-field input:not(:placeholder-shown) + span,
.qp-field textarea:not(:placeholder-shown) + span {
  transform: translateY(-9px) scale(0.74);
  color: var(--qp-accent);
}
.qp-field .is-invalid {
  border-color: #e5484d;
  box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.14);
}
.qp-modal .qp-error {
  min-height: 18px;
  margin: 2px 0 12px;
  font-size: 13px;
  color: #e5484d !important;
}

/* buttons */
.qp-btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 24px;
  border: 1px solid var(--qp-line);
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--qp-text);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}
.qp-btn:hover {
  transform: translateY(-2px);
  border-color: var(--qp-accent);
}
.qp-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ef6b2c 0%, #d14e14 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(224, 90, 30, 0.35);
}
.qp-btn:disabled {
  opacity: 0.75;
  cursor: default;
}
.qp-submit {
  position: relative;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  border-radius: 12px;
  font-size: 15px;
  overflow: hidden;
}
.qp-submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.qp-submit:hover::before {
  left: 160%;
}
.qp-submit-arrow {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.qp-submit:hover .qp-submit-arrow {
  transform: translateX(5px);
}
.qp-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: qpSpin 0.7s linear infinite;
}
.qp-submit.is-loading .qp-submit-arrow {
  display: none;
}
.qp-submit.is-loading .qp-spinner {
  display: block;
}
.qp-card.is-shake {
  animation: qpShake 0.45s ease;
}

/* thank-you state */
.qp-done {
  position: relative;
  padding: 14px 0 6px;
  text-align: center;
}
.qp-done[hidden] {
  display: none;
}
.qp-modal .qp-done .qp-title {
  margin: 18px 0 8px;
  font-size: 26px;
  animation: qpRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}
.qp-modal .qp-done .qp-sub {
  margin: 0 0 24px;
  animation: qpRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}
.qp-done .qp-btn {
  animation: qpRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}
.qp-done-mark {
  position: relative;
  display: inline-flex;
  animation: qpPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.qp-check-ring {
  stroke: var(--qp-accent);
  stroke-dasharray: 202;
  stroke-dashoffset: 202;
  animation: qpDraw 0.7s ease 0.1s forwards;
}
.qp-check-mark {
  stroke: var(--qp-accent);
  stroke-dasharray: 46;
  stroke-dashoffset: 46;
  animation: qpDraw 0.4s ease 0.65s forwards;
}
.qp-burst {
  position: absolute;
  inset: 0;
}
.qp-burst i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px;
  border-radius: 50%;
  background: var(--qp-accent);
  opacity: 0;
  animation: qpBurst 0.8s ease-out 0.75s both;
}
.qp-burst i:nth-child(1) { --a: 0deg; }
.qp-burst i:nth-child(2) { --a: 45deg; background: #ffb088; }
.qp-burst i:nth-child(3) { --a: 90deg; }
.qp-burst i:nth-child(4) { --a: 135deg; background: #ffb088; }
.qp-burst i:nth-child(5) { --a: 180deg; }
.qp-burst i:nth-child(6) { --a: 225deg; background: #ffb088; }
.qp-burst i:nth-child(7) { --a: 270deg; }
.qp-burst i:nth-child(8) { --a: 315deg; background: #ffb088; }

@keyframes qpRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes qpSweep {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes qpFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-18px, 14px) scale(1.08); }
}
@keyframes qpBadge {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-4deg); }
}
@keyframes qpSpin {
  to { transform: rotate(360deg); }
}
@keyframes qpShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
@keyframes qpPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes qpDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes qpBurst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(-30px) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-66px) scale(0.3); }
}

@media (max-width: 560px) {
  .qp-card {
    padding: 30px 22px 26px;
  }
  .qp-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .qp-modal .qp-title {
    font-size: 20px;
  }
}
