/* ============================================================
   SA Teambuilding — quote request form
   Pairs with quote-form.html and sa-quote.js
   ============================================================ */

.sa-quote {
  --q-green: #4DA528;
  --q-green-dark: #3d8420;
  --q-green-pale: #dff3d2;
  --q-orange: #FF970D;
  --q-ink: #12261a;
  --q-label: #3f4a42;
  --q-muted: #6b7a70;
  --q-line: #d8ddd6;

  max-width: 940px;
  margin: 0 auto;
}

.sa-quote__card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .09);
}

/* ---------- honeypot ---------- */
.sa-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- brand panel ---------- */
.sa-quote__aside {
  background: var(--q-green);
  color: #fff;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sa-quote__logo {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

.sa-quote__rule {
  height: 1px;
  background: rgba(255, 255, 255, .35);
}

.sa-quote__stats {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sa-quote__stats div { margin: 0; }

.sa-quote__stats dt {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.sa-quote__stats dt span {
  font-size: 13px;
  font-weight: 400;
  color: var(--q-green-pale);
}

.sa-quote__stats dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--q-green-pale);
}

.sa-quote__promise {
  margin: auto 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--q-green-pale);
}

/* ---------- fields ---------- */
.sa-quote__body { padding: 26px; }

.sa-quote__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sa-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.sa-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--q-label);
}

.sa-field label span { color: var(--q-orange); }

.sa-field input,
.sa-field select,
.sa-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--q-line);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  color: var(--q-ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.sa-field textarea { resize: vertical; min-height: 84px; }

.sa-field input:hover,
.sa-field select:hover,
.sa-field textarea:hover { border-color: #b9c2b6; }

.sa-field input:focus,
.sa-field select:focus,
.sa-field textarea:focus {
  outline: none;
  border-color: var(--q-green);
  box-shadow: 0 0 0 3px rgba(77, 165, 40, .17);
}

.sa-field input[aria-invalid="true"],
.sa-field select[aria-invalid="true"] {
  border-color: #d33;
  box-shadow: 0 0 0 3px rgba(221, 51, 51, .14);
}

/* ---------- footer ---------- */
.sa-quote__foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sa-quote__note {
  margin: 0;
  font-size: 13px;
  color: var(--q-muted);
}

.sa-quote__submit {
  background: var(--q-green);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 13px 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease;
}

.sa-quote__submit:hover { background: var(--q-green-dark); }
.sa-quote__submit[disabled] { opacity: .7; cursor: default; }

.sa-quote__error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 14px;
  border-radius: 8px;
  background: #fdecec;
  color: #98211f;
  font-size: 14px;
}

/* ---------- success ---------- */
.sa-quote__done { text-align: center; padding: 54px 16px; }

.sa-quote__tick {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #eaf5e3;
  color: var(--q-green);
  display: grid;
  place-items: center;
}

.sa-quote__tick svg { width: 28px; height: 28px; }

.sa-quote__done-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--q-ink);
}

.sa-quote__done-text {
  margin: 0;
  font-size: 15px;
  color: var(--q-muted);
  line-height: 1.6;
}

/* ---------- responsive ---------- */
@media (max-width: 767px) {
  .sa-quote__card { grid-template-columns: 1fr; }

  .sa-quote__aside {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 24px;
    padding: 18px;
  }

  .sa-quote__logo { width: 150px; }
  .sa-quote__rule { display: none; }
  .sa-quote__stats { flex-direction: row; gap: 20px; }
  .sa-quote__stats dt { font-size: 19px; }
  .sa-quote__stats dd { font-size: 12px; }
  .sa-quote__promise { flex-basis: 100%; margin: 0; }

  .sa-quote__body { padding: 20px; }
  .sa-quote__fields { grid-template-columns: 1fr; }
  .sa-quote__submit { width: 100%; }
}

/* ---------- accessibility ---------- */
.sa-quote__submit:focus-visible,
.sa-field input:focus-visible,
.sa-field select:focus-visible,
.sa-field textarea:focus-visible {
  outline: 3px solid var(--q-orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sa-field input, .sa-field select,
  .sa-field textarea, .sa-quote__submit { transition: none; }
}

/* ============================================================
   Modal mode — used by the floating "Contact us" tab
   ============================================================ */

.sa-quote-modal {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 20, 10, .78);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.sa-quote-modal[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.sa-quote-modal .sa-quote {
  width: 100%;
  position: relative;
  transform: translateY(16px);
  transition: transform .25s ease;
}

.sa-quote-modal[data-open="true"] .sa-quote {
  transform: translateY(0);
}

.sa-quote-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #12261a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
  transition: background .18s ease, color .18s ease;
}

.sa-quote-modal__close:hover {
  background: #4DA528;
  color: #fff;
}

.sa-quote-modal__close:focus-visible {
  outline: 3px solid #FF970D;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .sa-quote-modal { padding: 16px; align-items: start; }
  .sa-quote-modal__close { top: 6px; right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .sa-quote-modal, .sa-quote-modal .sa-quote { transition: none; }
}

/* ============================================================
   Container queries — the form adapts to the width of whatever
   column it is dropped into, not just the viewport. This means
   it works inside a half-width column and full width alike,
   without editing the page's grid.
   Browsers without @container support fall back to the
   viewport media query above, which is still correct.
   ============================================================ */

.sa-quote { container-type: inline-size; }

@container (max-width: 700px) {
  .sa-quote__card { grid-template-columns: 1fr; }

  .sa-quote__aside {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 24px;
    padding: 18px;
  }

  .sa-quote__logo { width: 150px; }
  .sa-quote__rule { display: none; }
  .sa-quote__stats { flex-direction: row; gap: 20px; }
  .sa-quote__stats dt { font-size: 19px; }
  .sa-quote__stats dd { font-size: 12px; }
  .sa-quote__promise { flex-basis: 100%; margin: 0; }
  .sa-quote__body { padding: 20px; }
}

@container (max-width: 520px) {
  .sa-quote__fields { grid-template-columns: 1fr; }
  .sa-quote__submit { width: 100%; }
  .sa-quote__foot { flex-direction: column-reverse; align-items: stretch; }
  .sa-quote__note { text-align: center; }
}
