.quote-form {
  position: relative;
  overflow: hidden;
}

.quote-form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.quote-form label {
  position: relative;
}

.quote-wizard {
  width: min(880px, 100%);
}

.quote-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 12px;
}

.quote-progress span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}

.quote-progress span.is-active {
  border-color: var(--accent);
  background: #fff7e6;
  color: #122033;
}

.quote-progress span.is-done {
  background: #e8f8ee;
  color: #126b36;
}

.quote-step {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

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

.quote-step legend {
  color: var(--primary);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
}

.quote-step p,
.quote-trust span {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.quote-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 4px;
}

.quote-consent {
  align-items: flex-start;
  grid-template-columns: auto 1fr;
  font-weight: 700;
}

.quote-trust {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(18, 32, 51, .12);
  border-radius: 8px;
  background: #f8fafc;
}

.quote-trust strong {
  color: var(--primary);
}

.select-label select {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23122033' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer;
  padding-right: 44px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c5a253;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 154, 18, .14);
  background: #fff;
}

.conditional-field {
  padding: 14px;
  border: 1px solid rgba(217, 154, 18, .36);
  border-radius: 8px;
  background: #fffaf0;
  animation: fieldIn .22s ease;
}

.conditional-field[hidden] {
  display: none;
}

.quote-area-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(18, 32, 51, .12);
  border-radius: 8px;
  background: #f8fafc;
}

.chat-select {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23122033' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

.chat {
  position: fixed;
  right: 22px;
  bottom: 86px;
  z-index: 80;
  width: min(380px, calc(100vw - 32px));
  font-family: Arial, Helvetica, sans-serif;
}

.chat-button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: #122033;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 14px 18px;
  box-shadow: 0 14px 34px rgba(16, 24, 32, .24);
}

.chat-button:hover,
.chat-button:focus-visible {
  background: #0f5f9f;
}

.chat-window {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(18, 32, 51, .16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 32, .26);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #122033;
  color: #fff;
}

.chat-head span {
  margin-left: auto;
  color: #9dd9b8;
  font-size: 12px;
  font-weight: 800;
}

.chat-head button {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.chat-intro {
  padding: 16px;
  border-bottom: 1px solid rgba(18, 32, 51, .1);
  background: #f8fafc;
}

.chat-intro p {
  margin: 6px 0 0;
  color: #5f6f82;
  font-size: 14px;
  line-height: 1.5;
}

.chat-start [data-chat-service-other-input] {
  background: #fffaf0;
  border-color: rgba(217, 154, 18, .5);
}

.chat-window {
  display: flex;
  flex-direction: column;
  max-height: min(640px, calc(100vh - 122px));
}

.chat-window[hidden],
.chat-start [hidden] {
  display: none !important;
}

.chat-window [hidden] {
  display: none !important;
}

.chat-start,
.chat-send {
  gap: 12px;
  padding: 16px;
}

.chat-start label {
  color: var(--primary);
  font-size: 13px;
  gap: 7px;
}

.chat-start input,
.chat-start select,
.chat-send textarea {
  min-height: 44px;
}

.chat-send textarea {
  resize: vertical;
  min-height: 58px;
  max-height: 140px;
  line-height: 1.45;
}

.chat-messages {
  flex: 1 1 auto;
  height: auto;
  min-height: 210px;
  max-height: 310px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 14px;
  background: #f4f6f8;
}

.chat-feedback {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid rgba(18, 32, 51, .12);
  border-radius: 8px;
  background: #f8fafc;
  color: #122033;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  animation: fieldIn .18s ease;
}

.chat-feedback.is-error {
  border-color: rgba(191, 45, 45, .24);
  background: #fff1f1;
  color: #8f1f1f;
}

.chat-feedback.is-success {
  border-color: rgba(18, 140, 126, .22);
  background: #eafaf7;
  color: #0f4f47;
}

.chat-message {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 32, 51, .1);
  border-radius: 8px;
  background: #fff;
  color: #122033;
  font-size: 14px;
  line-height: 1.45;
}

.chat-message.is-admin {
  background: #122033;
  color: #fff;
}

.chat-message.is-visitor {
  margin-left: auto;
  background: #e8f4ff;
}

.chat-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.chat-message small {
  display: block;
  margin-top: 6px;
  opacity: .68;
  font-size: 11px;
}

.chat-whatsapp-link {
  padding: 3px 0;
}

.chat-start button,
.chat-send button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
  font-weight: 900;
  padding: 11px 14px;
}

.chat-start button:hover,
.chat-send button:hover {
  background: #c98d0d;
}

.chat-start button[disabled],
.chat-send button[disabled] {
  cursor: wait;
  opacity: .72;
}

@keyframes fieldIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .form-card {
    padding: 18px;
  }

  .quote-form button {
    width: 100%;
  }

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

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

  .quote-step-actions {
    display: grid;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .chat {
    left: 12px;
    right: 12px;
    bottom: 78px;
  }

  .chat-button {
    width: 100%;
  }

  .chat-window {
    width: 100%;
    max-height: calc(100vh - 96px);
  }

  .chat-head,
  .chat-intro,
  .chat-start,
  .chat-send {
    padding: 12px;
  }

  .chat-messages {
    min-height: 170px;
    max-height: 36vh;
  }

  .chat-send {
    grid-template-columns: 1fr;
  }
}
