/* ── Tab visibility ─────────────────────────────────────────────────
   JS sets style.display="block" to show a tab */
.tab { display: none; }

/* ── Inline field error message ─────────────────────────────────── */
.ux-field-error {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Raleway', sans-serif;
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── UX: Reusable design-system classes ─────────────────────────── */

/* Floating-label style input */
.ux-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  color: #374151;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.ux-input:focus {
  border-color: #317fb7;
  box-shadow: 0 0 0 3px rgba(49,127,183,0.12);
}
.ux-input.invalid,
.ux-input:user-invalid {
  border-color: #ef4444;
  background-color: #fff5f5;
}
.ux-input::placeholder { color: #9ca3af; }

/* Field label */
.ux-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 4px;
}

/* Primary CTA button */
.ux-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #4CAF50;
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.ux-btn-primary:hover  { opacity: 0.92; }
.ux-btn-primary:active { transform: scale(0.97); }
.ux-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Back / ghost button */
.ux-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #9ca3af;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}
.ux-btn-back:hover { color: #6b7280; }

/* Large tap-target choice card (Yes/No, Own/Rent, etc.) */
.ux-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ux-choice-btn:hover {
  border-color: #317fb7;
  background: #f0f7fd;
}
.ux-choice-btn.selected {
  border-color: #317fb7;
  background: #e8f4fc;
  box-shadow: 0 0 0 3px rgba(49,127,183,0.12);
}

/* Select wrapper — keeps custom arrow */
.ux-select-wrap {
  position: relative;
}
.ux-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: url("../images/br_down.png") no-repeat center / contain;
  pointer-events: none;
}
.ux-select {
  display: block;
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-family: 'Raleway', sans-serif;
  font-size: 15px;
  color: #374151;
  background: #fff;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s;
}
.ux-select:focus { border-color: #317fb7; }
.ux-select:disabled { background: #f9fafb; color: #9ca3af; }
.ux-select.invalid { border-color: #ef4444; background: #fff5f5; }

/* Quantity stepper */
.ux-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  height: 46px;
}
.ux-stepper-btn {
  flex-shrink: 0;
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  color: #374151;
  font-size: 13px;
  transition: background 0.12s;
}
.ux-stepper-btn:hover { background: #e5e7eb; }
.ux-stepper-plus { background: #317fb7; color: #fff; }
.ux-stepper-plus:hover { background: #2a6f9e; }
.ux-stepper-input {
  flex: 1;
  text-align: center;
  border: none !important;
  outline: none;
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #374151;
  background: #fff;
  height: 100%;
  padding: 0;
}

/* ── JS-injected button strings in quote.js ──────────────────────── */
button.prevBtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #9ca3af;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
button.dropBtn {
  background-color: #ef4444;
  color: #fff;
  padding: .5rem 1rem;
  border: none;
  border-radius: .5rem;
  font-family: 'Raleway', sans-serif;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
button.addBtn {
  background-color: #317fb7;
  color: #fff;
  padding: .5rem 1rem;
  border: none;
  border-radius: .5rem;
  font-family: 'Raleway', sans-serif;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}

/* ── VIN loading spinner ─────────────────────────────────────────── */
#vin2.loading {
  background: #fff url("../images/loading.gif") no-repeat 96% center;
  background-size: 25px 25px;
}

/* ── Submission spinner injected by save() in quote.js ───────────── */
.spinner-border {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 0.2em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: -0.125em;
}
.spinner-border-sm { width: .75rem; height: .75rem; border-width: .15em; }
@keyframes spin { to { transform: rotate(360deg); } }
.mr-2 { margin-right: 0.5rem; }

/* ── Validation states ───────────────────────────────────────────── */
input.invalid,
select.invalid { border-color: #ef4444 !important; background-color: #fff5f5 !important; }

/* ── Autofill suppression ────────────────────────────────────────── */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px white inset !important;
}

/* ── Bootstrap color utilities used in dynamic JS content ────────── */
.text-danger  { color: #dc3545 !important; }
.text-success { color: #28a745 !important; }
.text-muted   { color: #6c757d !important; }
.text-primary { color: #317fb7 !important; }

/* ── Legacy select / input fallbacks (non-.ux-select elements) ───── */
select:not(.ux-select) {
  -webkit-appearance: none;
  appearance: none;
  background: transparent url("../images/br_down.png") no-repeat 96% center;
  padding: 5px;
  border: none;
  width: 100%;
  font-size: 17px;
  font-family: 'Raleway', sans-serif;
  color: #5c4f4f;
  outline: none;
}
input[type="text"]:not(.ux-input):not(.ux-stepper-input),
input[type="email"]:not(.ux-input),
input[type="tel"]:not(.ux-input) {
  font-family: 'Raleway', sans-serif;
  font-size: 17px;
  color: #5c4f4f;
  outline: none;
  border: none;
  background: transparent;
  width: 100%;
  padding: 5px;
  display: block;
}
