/* ============================================================
   GET A QUOTE — Premium Multi-Step Modal
   Matches DMEco branding: dark navy, white type, green accent
   ============================================================ */

.quote-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(7,16,24,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .3s ease;
}

.quote-overlay.open{
  display: flex;
}

.quote-overlay.visible{
  opacity: 1;
}

.quote-modal{
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  position: relative;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s ease;
}

.quote-overlay.visible .quote-modal{
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Dark navy header band inside modal, regardless of site theme */
.quote-modal-header{
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 34px 40px 26px;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.quote-close-btn{
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.quote-close-btn:hover{
  background: rgba(255,255,255,0.16);
  transform: rotate(90deg);
}

.quote-close-btn svg{ width:16px; height:16px; }

html[dir="rtl"] .quote-close-btn{
  right: auto;
  left: 20px;
}

.quote-modal-header h2{
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  padding-right: 40px;
}

html[dir="rtl"] .quote-modal-header h2{
  padding-right: 0;
  padding-left: 40px;
}

.quote-modal-header p{
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
}

/* Step indicator / progress bar */
.quote-steps{
  display:flex;
  align-items:center;
  margin-top: 26px;
  gap: 4px;
}

.quote-step-item{
  flex: 1;
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 8px;
  position: relative;
}

.quote-step-dot{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
  color: var(--text-muted);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12.5px;
  font-weight: 800;
  transition: all .3s ease;
  z-index: 2;
}

.quote-step-item.active .quote-step-dot{
  background: var(--green);
  border-color: var(--green);
  color: #0d1b26;
  box-shadow: 0 0 16px rgba(141,198,63,0.5);
}

.quote-step-item.done .quote-step-dot{
  background: rgba(141,198,63,0.2);
  border-color: var(--green);
  color: var(--green);
}

.quote-step-label{
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align:center;
}

.quote-step-item.active .quote-step-label{
  color: #ffffff;
}

.quote-step-track{
  position: absolute;
  top: 15px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 1;
}

.quote-step-item:last-child .quote-step-track{ display:none; }

.quote-step-item.done .quote-step-track{
  background: var(--green);
}

/* Body */
.quote-modal-body{
  padding: 32px 40px 10px;
}

.quote-step-panel{
  display: none;
}

.quote-step-panel.active{
  display: block;
  animation: quoteStepIn .35s ease;
}

@keyframes quoteStepIn{
  from{ opacity:0; transform: translateX(12px); }
  to{ opacity:1; transform: translateX(0); }
}

.quote-field-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.quote-field{
  margin-bottom: 18px;
}

.quote-field.full{
  grid-column: 1 / -1;
}

.quote-field label{
  display:block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 8px;
}

.quote-field label .req{
  color: #e05a5a;
  margin-left: 3px;
}

.quote-field input[type="text"],
.quote-field input[type="email"],
.quote-field input[type="tel"],
.quote-field input[type="date"],
.quote-field select,
.quote-field textarea{
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--content-text);
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus{
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(141,198,63,0.15);
}

.quote-field input.invalid,
.quote-field select.invalid,
.quote-field textarea.invalid{
  border-color: #e05a5a;
}

.quote-field-error{
  font-size: 11.5px;
  color: #e05a5a;
  margin-top: 6px;
  display: none;
}

.quote-field-error.show{
  display: block;
}

.quote-field textarea{
  min-height: 160px;
  resize: vertical;
}

.quote-char-counter{
  text-align: right;
  font-size: 11.5px;
  color: var(--muted-text);
  margin-top: 6px;
}

html[dir="rtl"] .quote-char-counter{
  text-align: left;
}

/* File upload */
.quote-dropzone{
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  margin-bottom: 18px;
}

.quote-dropzone:hover,
.quote-dropzone.dragover{
  border-color: var(--green);
  background: rgba(141,198,63,0.06);
}

.quote-dropzone svg{
  width: 36px;
  height: 36px;
  color: var(--green-2);
  margin-bottom: 12px;
}

.quote-dropzone p{
  font-size: 13.5px;
  color: var(--content-text);
  font-weight: 700;
  margin-bottom: 4px;
}

.quote-dropzone span{
  font-size: 11.5px;
  color: var(--muted-text);
}

.quote-file-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quote-file-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--content-text);
}

.quote-file-item .file-info{
  display:flex;
  align-items:center;
  gap: 10px;
  overflow: hidden;
}

.quote-file-item .file-info svg{
  width: 16px;
  height: 16px;
  color: var(--green-2);
  flex-shrink:0;
}

.quote-file-item .file-name{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.quote-file-item .file-size{
  color: var(--muted-text);
  flex-shrink:0;
  margin-left: 8px;
}

.quote-file-remove{
  background: none;
  border: none;
  color: #e05a5a;
  cursor: pointer;
  padding: 4px;
  display:flex;
  flex-shrink:0;
}

.quote-file-remove svg{ width:15px; height:15px; }

/* Review summary */
.quote-review-block{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.quote-review-block h4{
  font-size: 13px;
  font-weight: 800;
  color: var(--green-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.quote-review-edit{
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-text);
  cursor: pointer;
  text-decoration: underline;
}

.quote-review-row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider-color);
}

.quote-review-row:last-child{ border-bottom:none; }

.quote-review-row .k{ color: var(--muted-text); }
.quote-review-row .v{ color: var(--content-text); font-weight: 600; text-align: right; }

html[dir="rtl"] .quote-review-row .v{ text-align: left; }

/* Consent */
.quote-consent{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  margin: 22px 0 8px;
  font-size: 13px;
  color: var(--content-text);
  line-height: 1.5;
}

.quote-consent input[type="checkbox"]{
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--green);
}

/* Footer nav */
.quote-modal-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 20px 40px 34px;
}

.quote-btn-back,
.quote-btn-next,
.quote-btn-submit{
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  padding: 13px 28px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all .3s ease;
  display:inline-flex;
  align-items:center;
  gap: 8px;
}

.quote-btn-back{
  background: transparent;
  color: var(--muted-text);
  border: 1px solid var(--glass-border);
}

.quote-btn-back:hover{
  color: var(--heading-color);
  border-color: var(--green-2);
}

.quote-btn-back:disabled{
  opacity: 0;
  pointer-events: none;
}

.quote-btn-next,
.quote-btn-submit{
  background: var(--green);
  color: #0d1b26;
  position: relative;
  overflow: hidden;
  margin-left: auto;
}

html[dir="rtl"] .quote-btn-next,
html[dir="rtl"] .quote-btn-submit{
  margin-left: 0;
  margin-right: auto;
}

.quote-btn-next:hover,
.quote-btn-submit:hover{
  background: var(--green-2);
  box-shadow: 0 0 26px rgba(141,198,63,0.5);
  transform: translateY(-2px);
}

.quote-btn-submit:disabled{
  opacity: 0.7;
  pointer-events: none;
  transform: none;
}

/* Ripple */
.quote-ripple{
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: quoteRipple .6s ease-out;
  pointer-events: none;
}

@keyframes quoteRipple{
  to{ transform: scale(3); opacity: 0; }
}

/* Loading spinner */
.quote-spinner{
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(13,27,38,0.3);
  border-top-color: #0d1b26;
  border-radius: 50%;
  animation: quoteSpin .7s linear infinite;
  display: none;
}

.quote-btn-submit.loading .quote-spinner{ display:inline-block; }
.quote-btn-submit.loading .quote-submit-label{ display:none; }

@keyframes quoteSpin{
  to{ transform: rotate(360deg); }
}

/* Success / Error screens */
.quote-result-screen{
  display:none;
  text-align:center;
  padding: 50px 40px 44px;
}

.quote-result-screen.show{
  display:block;
}

.quote-success-icon{
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(141,198,63,0.15);
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 0 auto 24px;
  animation: quoteSuccessPop .5s cubic-bezier(.2,.8,.2,1);
}

@keyframes quoteSuccessPop{
  0%{ transform: scale(0); opacity:0; }
  70%{ transform: scale(1.1); }
  100%{ transform: scale(1); opacity:1; }
}

.quote-success-icon svg{
  width: 44px;
  height: 44px;
  color: var(--green);
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: quoteCheckDraw .5s ease .3s forwards;
}

@keyframes quoteCheckDraw{
  to{ stroke-dashoffset: 0; }
}

.quote-error-icon{
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(224,90,90,0.15);
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 0 auto 24px;
}

.quote-error-icon svg{
  width: 40px;
  height: 40px;
  color: #e05a5a;
}

.quote-result-screen h3{
  font-size: 24px;
  font-weight: 800;
  color: var(--heading-color);
  margin-bottom: 14px;
}

.quote-result-screen p{
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted-text);
  max-width: 420px;
  margin: 0 auto 24px;
}

.quote-result-contact{
  display:flex;
  justify-content:center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  font-size: 13px;
}

.quote-result-contact div{
  display:flex;
  flex-direction: column;
  gap: 4px;
}

.quote-result-contact .label{
  color: var(--muted-text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quote-result-contact .val{
  color: var(--green-2);
  font-weight: 700;
}

.quote-result-actions{
  display:flex;
  justify-content:center;
  gap: 14px;
  flex-wrap: wrap;
}

.quote-result-actions a{
  font-size: 13px;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 8px;
  transition: all .25s ease;
}

.quote-result-actions .primary{
  background: var(--green);
  color: #0d1b26;
}

.quote-result-actions .primary:hover{
  background: var(--green-2);
  box-shadow: 0 0 22px rgba(141,198,63,0.45);
}

.quote-result-actions .secondary{
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--heading-color);
}

.quote-result-actions .secondary:hover{
  border-color: var(--green-2);
}

/* Visually hidden but accessible */
.quote-sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Focus visibility for accessibility */
.quote-modal button:focus-visible,
.quote-modal a:focus-visible,
.quote-modal input:focus-visible,
.quote-modal select:focus-visible,
.quote-modal textarea:focus-visible{
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 640px){
  .quote-modal-header{ padding: 26px 22px 22px; }
  .quote-modal-body{ padding: 24px 22px 6px; }
  .quote-modal-footer{ padding: 16px 22px 26px; }
  .quote-field-grid{ grid-template-columns: 1fr; }
  .quote-step-label{ display:none; }
  .quote-modal-header h2{ font-size: 20px; }
  .quote-result-screen{ padding: 40px 22px 30px; }
}