/* ============================================================
   GREEN LABEL SERVICES — QUOTE REQUEST MODAL
   quote-modal.css
   ============================================================ */

/* ── Variables (local supplement) ─────────────────────────── */
:root {
  --qm-radius:      16px;
  --qm-shadow:      0 24px 64px rgba(0, 0, 0, 0.28);
  --qm-border:      #e2e8f0;
  --qm-bg:          #ffffff;
  --qm-step-size:   32px;
  --qm-transition:  0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Overlay ─────────────────────────────────────────────── */
.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 1300; /* above cookie modal (1200) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quote-modal[hidden] {
  display: none;
}

/* ── Backdrop ─────────────────────────────────────────────── */
.quote-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--qm-transition);
}

.quote-modal.is-open .quote-modal__backdrop {
  opacity: 1;
}

/* ── Container ────────────────────────────────────────────── */
.quote-modal__container {
  position: relative;
  z-index: 1;
  background: var(--qm-bg);
  border-radius: var(--qm-radius);
  box-shadow: var(--qm-shadow);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(28px) scale(0.97);
  opacity: 0;
  transition: transform var(--qm-transition), opacity var(--qm-transition);
}

.quote-modal.is-open .quote-modal__container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Close button ─────────────────────────────────────────── */
.quote-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.9rem;
  transition: background 0.18s ease, color 0.18s ease;
  z-index: 2;
}

.quote-modal__close:hover,
.quote-modal__close:focus-visible {
  background: var(--color-accent);
  color: #fff;
  outline: none;
}

/* ── Header ───────────────────────────────────────────────── */
.quote-modal__header {
  padding: 2rem 2rem 0;
  text-align: center;
}

.quote-modal__header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
  padding-right: 2rem; /* avoid overlap with close btn */
}

.quote-modal__header p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* ── Step indicator ───────────────────────────────────────── */
.quote-modal__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1.5rem 2rem 0;
}

.quote-modal__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.quote-modal__step-num {
  width: var(--qm-step-size);
  height: var(--qm-step-size);
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid var(--qm-border);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--qm-transition), border-color var(--qm-transition), color var(--qm-transition);
}

.quote-modal__step.is-active .quote-modal__step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.quote-modal__step.is-complete .quote-modal__step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.quote-modal__step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--qm-transition);
}

.quote-modal__step.is-active .quote-modal__step-label,
.quote-modal__step.is-complete .quote-modal__step-label {
  color: var(--color-primary);
}

/* Step connector line */
.quote-modal__step-connector {
  flex: 1;
  height: 2px;
  background: var(--qm-border);
  margin: 0 0.5rem;
  margin-bottom: 1.1rem; /* align with circles */
  position: relative;
  overflow: hidden;
  min-width: 40px;
}

.quote-modal__step-connector::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--qm-transition);
}

.quote-modal__step-connector.is-complete::after {
  transform: scaleX(1);
}

/* ── Progress bar ─────────────────────────────────────────── */
.quote-modal__progress {
  height: 4px;
  background: #f1f5f9;
  margin: 1rem 2rem 0;
  border-radius: 99px;
  overflow: hidden;
}

.quote-modal__progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ── Form body ────────────────────────────────────────────── */
.quote-modal__body {
  padding: 1.5rem 2rem;
}

/* ── Step panels ──────────────────────────────────────────── */
.quote-modal__panel[hidden] {
  display: none;
}

.quote-modal__panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quote-modal__panel-title i {
  color: var(--color-primary);
  font-size: 0.95rem;
}

/* ── Form rows ────────────────────────────────────────────── */
.quote-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.quote-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

/* ── Labels ───────────────────────────────────────────────── */
.quote-modal__field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.02em;
}

.quote-modal__field label .required-star {
  color: var(--color-accent);
  margin-left: 2px;
}

/* ── Inputs / selects / textareas ─────────────────────────── */
.quote-modal__field input,
.quote-modal__field select,
.quote-modal__field textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1.5px solid var(--qm-border);
  border-radius: 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.quote-modal__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  padding-right: 2.25rem;
}

.quote-modal__field input:focus,
.quote-modal__field select:focus,
.quote-modal__field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(23, 199, 20, 0.12);
}

.quote-modal__field input::placeholder,
.quote-modal__field textarea::placeholder {
  color: #cbd5e1;
}

.quote-modal__field textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── Field error state ────────────────────────────────────── */
.quote-modal__field.has-error input,
.quote-modal__field.has-error select,
.quote-modal__field.has-error textarea {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

/* ── Inline error message ─────────────────────────────────── */
.quote-modal__field-error {
  font-size: 0.75rem;
  color: var(--color-accent);
  display: none;
  margin-top: 2px;
}

.quote-modal__field.has-error .quote-modal__field-error {
  display: block;
}

/* ── Review summary ───────────────────────────────────────── */
.quote-modal__review {
  background: rgba(23, 199, 20, 0.06);
  border: 1.5px solid rgba(23, 199, 20, 0.2);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.quote-modal__review-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin: 0 0 0.875rem;
}

.quote-modal__review dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
}

.quote-modal__review dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.quote-modal__review dd {
  font-size: 0.82rem;
  color: #0f172a;
  margin: 0;
  word-break: break-word;
}

/* ── Success panel ────────────────────────────────────────── */
.quote-modal__success {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.quote-modal__success[hidden] {
  display: none;
}

.quote-modal__success-icon {
  width: 72px;
  height: 72px;
  background: rgba(23, 199, 20, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
  color: var(--color-primary);
}

.quote-modal__success h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.quote-modal__success p {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

/* ── Navigation bar ───────────────────────────────────────── */
.quote-modal__nav {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--qm-border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quote-modal__nav[hidden] {
  display: none;
}

.quote-modal__nav-back {
  background: #f1f5f9;
  color: #374151;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
}

.quote-modal__nav-back:hover,
.quote-modal__nav-back:focus-visible {
  background: #e2e8f0;
  outline: none;
}

.quote-modal__nav-back[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.quote-modal__nav-next,
.quote-modal__nav-submit {
  flex: 1;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
}

.quote-modal__nav-next:hover,
.quote-modal__nav-next:focus-visible,
.quote-modal__nav-submit:hover,
.quote-modal__nav-submit:focus-visible {
  background: #14b012;
  outline: none;
  transform: translateY(-1px);
}

.quote-modal__nav-next:active,
.quote-modal__nav-submit:active {
  transform: translateY(0);
}

.quote-modal__nav-next[hidden],
.quote-modal__nav-submit[hidden] {
  display: none;
}

.quote-modal__nav-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

/* ── Honeypot ─────────────────────────────────────────────── */
.quote-modal__honeypot {
  position: absolute;
  left: -9999px;
  visibility: hidden;
  pointer-events: none;
  aria-hidden: true;
}

/* ── Server error banner ──────────────────────────────────── */
.quote-modal__server-error {
  background: rgba(255, 107, 0, 0.08);
  border: 1.5px solid var(--color-accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #b94a00;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.quote-modal__server-error[hidden] {
  display: none;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE — bottom-sheet style
───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .quote-modal {
    align-items: flex-end;
    padding: 0;
  }

  .quote-modal__container {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--qm-radius) var(--qm-radius) 0 0;
    transform: translateY(100%);
    opacity: 1;
  }

  .quote-modal.is-open .quote-modal__container {
    transform: translateY(0);
    opacity: 1;
  }

  .quote-modal__row {
    grid-template-columns: 1fr;
  }

  .quote-modal__step-label {
    display: none;
  }

  .quote-modal__header {
    padding: 1.5rem 1.25rem 0;
  }

  .quote-modal__body {
    padding: 1.25rem;
  }

  .quote-modal__steps {
    padding: 1.25rem 1.25rem 0;
  }

  .quote-modal__progress {
    margin: 1rem 1.25rem 0;
  }

  .quote-modal__nav {
    padding: 0.875rem 1.25rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   REDUCED MOTION
───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .quote-modal__backdrop,
  .quote-modal__container,
  .quote-modal__progress-bar,
  .quote-modal__step-num,
  .quote-modal__step-connector::after,
  .quote-modal__nav-next,
  .quote-modal__nav-submit,
  .quote-modal__close {
    transition: none;
  }
}
