/* Quote wizard — modal overlay + multi-step form.
   Injected once per page by quote-wizard.js. Uses shared design tokens
   from styles.css (--accent, --serif, --rule, etc.). */

.qw-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
  background: rgba(26, 24, 20, 0.55);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.qw-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.qw-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(26, 24, 20, 0.28);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.qw-overlay.is-open .qw-modal {
  transform: translateY(0);
}

.qw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}

.qw-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
  display: block;
}

.qw-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

.qw-close {
  flex: none;
  width: 36px;
  height: 36px;
  margin: -6px -6px 0 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.qw-close:hover {
  background: var(--bg);
  border-color: var(--ink-3);
}

.qw-progress {
  display: flex;
  gap: 6px;
  padding: 16px 24px 0;
}

.qw-progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  transition: background 0.2s ease;
}

.qw-progress-step.is-active,
.qw-progress-step.is-done {
  background: var(--accent);
}

.qw-body {
  padding: 20px 24px 0;
}

.qw-step {
  display: none;
}

.qw-step.is-active {
  display: block;
}

.qw-step-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
  display: block;
}

.qw-field {
  display: block;
  margin-bottom: 16px;
}

.qw-field > span {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.qw-field abbr {
  color: var(--accent);
  text-decoration: none;
}

.qw-field input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.qw-field input::placeholder {
  color: var(--ink-3);
}

.qw-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.qw-field input[aria-invalid="true"] {
  border-color: var(--accent-2);
}

.qw-field-error {
  display: none;
  font-size: 13px;
  color: var(--accent-2);
  margin-top: 6px;
}

.qw-field-error.is-shown {
  display: block;
}

.qw-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.qw-hint {
  font-size: 13px;
  color: var(--ink-3);
  margin: -4px 0 16px;
}

.qw-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 24px 20px;
}

.qw-nav {
  display: flex;
  gap: 10px;
}

/* The .btn class sets an explicit display, which overrides the [hidden]
   attribute's display:none. Restore hiding for the step nav buttons. */
.qw-nav .btn[hidden] {
  display: none;
}

.qw-back {
  visibility: hidden;
}

.qw-back.is-shown {
  visibility: visible;
}

.qw-micro {
  font-size: 13px;
  color: var(--ink-3);
  padding: 0 24px 20px;
  margin: 0;
}

.qw-micro a {
  color: var(--accent);
}

@media (max-width: 560px) {
  .qw-overlay {
    padding: 0;
    align-items: stretch;
  }

  .qw-modal {
    max-width: none;
    min-height: 100%;
    border: none;
    border-radius: 0;
  }

  .qw-row {
    grid-template-columns: 1fr;
  }
}

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