/* ═══════════════════════════════════════════════════════════════════
   EEQUOTE — Reusable Quote Request Module Styles
   All classes are namespaced with .qq- to avoid host-page conflicts.
   Override CSS custom properties on .qq-wrapper to theme per-client.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────────────────────── */
.qq-wrapper {
  --qq-accent:       #6366f1;
  --qq-accent-dark:  #4f46e5;
  --qq-accent-light: #eef2ff;
  --qq-accent-ring:  rgba(99, 102, 241, 0.25);
  --qq-bg:           #f1f5f9;
  --qq-surface:      rgba(255, 255, 255, 0.82);
  --qq-border:       rgba(148, 163, 184, 0.35);
  --qq-border-solid: #e2e8f0;
  --qq-text:         #1e293b;
  --qq-text-muted:   #64748b;
  --qq-text-light:   #94a3b8;
  --qq-error:        #ef4444;
  --qq-error-bg:     #fef2f2;
  --qq-success:      #22c55e;
  --qq-radius-card:  18px;
  --qq-radius-input: 9px;
  --qq-radius-btn:   10px;
  --qq-shadow:       0 8px 40px rgba(99, 102, 241, 0.12), 0 1px 3px rgba(0,0,0,0.06);
  --qq-shadow-sm:    0 2px 8px rgba(0,0,0,0.06);
  --qq-blur:         blur(14px);
  --qq-transition:   280ms cubic-bezier(0.4, 0, 0.2, 1);
  --qq-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
}

/* ── Base Reset (scoped) ─────────────────────────────────────────── */
.qq-wrapper *,
.qq-wrapper *::before,
.qq-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.qq-wrapper {
  font-family: var(--qq-font);
  color: var(--qq-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Module Card Shell ───────────────────────────────────────────── */
.qq-card {
  background: var(--qq-surface);
  backdrop-filter: var(--qq-blur);
  -webkit-backdrop-filter: var(--qq-blur);
  border: 1px solid var(--qq-border);
  border-radius: var(--qq-radius-card);
  box-shadow: var(--qq-shadow);
  overflow: hidden;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.qq-card-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--qq-border-solid);
  background: linear-gradient(135deg, var(--qq-accent-light) 0%, rgba(255,255,255,0.6) 100%);
}

.qq-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--qq-text);
  letter-spacing: -0.02em;
}

.qq-card-subtitle {
  font-size: 0.85rem;
  color: var(--qq-text-muted);
  margin-top: 3px;
}

/* ── Progress Bar ────────────────────────────────────────────────── */
.qq-progress {
  display: flex;
  align-items: center;
  padding: 20px 32px 0;
  gap: 0;
}

.qq-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.qq-progress-step:last-child {
  flex: 0;
}

.qq-progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--qq-border-solid);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--qq-text-muted);
  transition: var(--qq-transition);
  z-index: 1;
  position: relative;
  cursor: default;
}

.qq-progress-dot svg {
  width: 13px;
  height: 13px;
  display: none;
}

.qq-progress-step.completed .qq-progress-dot {
  background: var(--qq-accent);
  border-color: var(--qq-accent);
  color: white;
}

.qq-progress-step.completed .qq-progress-dot .qq-dot-num { display: none; }
.qq-progress-step.completed .qq-progress-dot svg { display: block; }

.qq-progress-step.active .qq-progress-dot {
  background: var(--qq-accent);
  border-color: var(--qq-accent);
  color: white;
  box-shadow: 0 0 0 4px var(--qq-accent-ring);
}

.qq-progress-line {
  flex: 1;
  height: 2px;
  background: var(--qq-border-solid);
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.qq-progress-line-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--qq-accent);
  transition: width 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

.qq-progress-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--qq-text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color var(--qq-transition);
}

.qq-progress-step.active .qq-progress-label,
.qq-progress-step.completed .qq-progress-label {
  color: var(--qq-accent);
}

/* ── Step Container & Animation ──────────────────────────────────── */
.qq-steps-container {
  position: relative;
  overflow: hidden;
}

.qq-step {
  padding: 28px 32px 24px;
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
  transition: opacity var(--qq-transition), transform var(--qq-transition);
}

.qq-step.qq-step--active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.qq-step.qq-step--leaving {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-40px);
}

.qq-step.qq-step--back {
  transform: translateX(-40px);
}

.qq-step.qq-step--back-leaving {
  transform: translateX(40px);
}

@media (prefers-reduced-motion: reduce) {
  .qq-step, .qq-progress-line-fill, .qq-progress-dot {
    transition: none !important;
  }
}

/* ── Step Heading ────────────────────────────────────────────────── */
.qq-step-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--qq-text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qq-step-heading:focus {
  outline: none;
}

.qq-step-heading-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--qq-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qq-step-heading-icon svg {
  width: 16px;
  height: 16px;
  color: var(--qq-accent);
}

/* ── Form Grid ───────────────────────────────────────────────────── */
.qq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.qq-grid--full {
  grid-template-columns: 1fr;
}

.qq-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

/* ── Labels & Required Marker ────────────────────────────────────── */
.qq-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--qq-text);
  letter-spacing: 0.01em;
}

.qq-required {
  color: var(--qq-accent);
  margin-left: 2px;
}

/* ── Inputs ──────────────────────────────────────────────────────── */
.qq-input,
.qq-select,
.qq-textarea {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 10px 13px;
  font-family: var(--qq-font);
  font-size: 0.88rem;
  color: var(--qq-text);
  background: white;
  border: 1.5px solid var(--qq-border-solid);
  border-radius: var(--qq-radius-input);
  outline: none;
  transition: border-color var(--qq-transition), box-shadow var(--qq-transition);
  line-height: 1.5;
}

.qq-input::placeholder,
.qq-textarea::placeholder {
  color: var(--qq-text-light);
}

.qq-input:focus,
.qq-select:focus,
.qq-textarea:focus {
  border-color: var(--qq-accent);
  box-shadow: 0 0 0 3px var(--qq-accent-ring);
}

.qq-input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.qq-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
  cursor: pointer;
}

.qq-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ── Error States ────────────────────────────────────────────────── */
.qq-input--error,
.qq-select--error,
.qq-textarea--error {
  border-color: var(--qq-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.qq-field-error {
  font-size: 0.75rem;
  color: var(--qq-error);
  display: none;
  align-items: center;
  gap: 4px;
}

.qq-field-error.qq-visible {
  display: flex;
}

.qq-field-error svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ── Product Option Cards ────────────────────────────────────────── */
.qq-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.qq-option-card {
  border: 2px solid var(--qq-border-solid);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--qq-transition), box-shadow var(--qq-transition), transform var(--qq-transition);
  background: white;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

.qq-option-card:hover {
  border-color: var(--qq-accent);
  box-shadow: var(--qq-shadow-sm);
  transform: translateY(-2px);
}

.qq-option-card.qq-selected {
  border-color: var(--qq-accent);
  box-shadow: 0 0 0 1px var(--qq-accent), var(--qq-shadow-sm);
}

.qq-option-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: var(--qq-accent-light);
}

.qq-option-card-body {
  padding: 10px 12px;
}

.qq-option-card-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--qq-text);
}

.qq-option-card-desc {
  font-size: 0.73rem;
  color: var(--qq-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.qq-option-card-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--qq-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--qq-transition), transform var(--qq-transition);
}

.qq-option-card-check svg {
  width: 12px;
  height: 12px;
  color: white;
}

.qq-selected .qq-option-card-check {
  opacity: 1;
  transform: scale(1);
}

/* ── Dimension Calculator ────────────────────────────────────────── */
.qq-calc-section {
  background: var(--qq-accent-light);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.qq-calc-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--qq-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.qq-unit-toggle {
  display: flex;
  background: white;
  border: 1.5px solid var(--qq-border-solid);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
  margin-bottom: 12px;
}

.qq-unit-btn {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--qq-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--qq-transition), color var(--qq-transition);
  font-family: var(--qq-font);
}

.qq-unit-btn.qq-active {
  background: var(--qq-accent);
  color: white;
}

.qq-calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.qq-calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qq-calc-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--qq-text-muted);
}

.qq-calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.qq-calc-input-wrap .qq-input {
  padding-right: 36px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.qq-unit-suffix {
  position: absolute;
  right: 11px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--qq-text-muted);
  pointer-events: none;
}

.qq-size-display {
  text-align: center;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid rgba(99,102,241,0.2);
}

.qq-size-display-label {
  font-size: 0.7rem;
  color: var(--qq-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qq-size-display-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--qq-accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.qq-size-display-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--qq-text-muted);
}

/* ── Dropdowns Grid ──────────────────────────────────────────────── */
.qq-dropdowns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── File Upload Zone ────────────────────────────────────────────── */
.qq-upload-zone {
  border: 2px dashed var(--qq-border-solid);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--qq-transition), background var(--qq-transition);
  background: white;
  margin-bottom: 12px;
  position: relative;
}

.qq-upload-zone:hover,
.qq-upload-zone.qq-drag-over {
  border-color: var(--qq-accent);
  background: var(--qq-accent-light);
}

.qq-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.qq-upload-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--qq-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.qq-upload-icon svg {
  width: 20px;
  height: 20px;
  color: var(--qq-accent);
}

.qq-upload-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--qq-text);
  margin-bottom: 3px;
}

.qq-upload-text span {
  color: var(--qq-accent);
  text-decoration: underline;
}

.qq-upload-hint {
  font-size: 0.73rem;
  color: var(--qq-text-muted);
}

/* ── File List ───────────────────────────────────────────────────── */
.qq-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.qq-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: white;
  border: 1px solid var(--qq-border-solid);
  border-radius: 8px;
  font-size: 0.82rem;
}

.qq-file-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--qq-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qq-file-item-icon svg {
  width: 14px;
  height: 14px;
  color: var(--qq-accent);
}

.qq-file-item-name {
  flex: 1;
  font-weight: 500;
  color: var(--qq-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qq-file-item-size {
  font-size: 0.72rem;
  color: var(--qq-text-muted);
  flex-shrink: 0;
}

.qq-file-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: var(--qq-error);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--qq-transition);
  font-family: var(--qq-font);
}

.qq-file-remove:hover {
  background: #fca5a5;
}

.qq-file-remove svg {
  width: 11px;
  height: 11px;
}

/* ── Review Step ─────────────────────────────────────────────────── */
.qq-review-section {
  background: white;
  border: 1px solid var(--qq-border-solid);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.qq-review-section-header {
  padding: 11px 16px;
  background: var(--qq-accent-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qq-review-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--qq-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qq-review-edit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--qq-accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--qq-font);
  transition: color var(--qq-transition);
}

.qq-review-edit:hover {
  color: var(--qq-accent-dark);
}

.qq-review-body {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.qq-review-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.qq-review-row--full {
  grid-column: 1 / -1;
}

.qq-review-key {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--qq-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qq-review-val {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--qq-text);
}

.qq-captcha-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.qq-review-empty {
  font-size: 0.82rem;
  color: var(--qq-text-muted);
  font-style: italic;
}

/* ── Navigation Buttons ──────────────────────────────────────────── */
.qq-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 28px;
  gap: 12px;
}

.qq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  font-family: var(--qq-font);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--qq-radius-btn);
  border: none;
  cursor: pointer;
  transition: background var(--qq-transition), box-shadow var(--qq-transition), transform var(--qq-transition), opacity var(--qq-transition);
  text-decoration: none;
  white-space: nowrap;
}

.qq-btn:active {
  transform: scale(0.97);
}

.qq-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.qq-btn--primary {
  background: var(--qq-accent);
  color: white;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.qq-btn--primary:hover {
  background: var(--qq-accent-dark);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.qq-btn--ghost {
  background: transparent;
  color: var(--qq-text-muted);
  border: 1.5px solid var(--qq-border-solid);
}

.qq-btn--ghost:hover {
  background: var(--qq-accent-light);
  color: var(--qq-accent);
  border-color: var(--qq-accent);
}

.qq-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Submit button states */
.qq-btn--submit { min-width: 140px; }

.qq-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: qq-spin 0.65s linear infinite;
  display: none;
  flex-shrink: 0;
}

.qq-btn--loading .qq-spinner { display: block; }
.qq-btn--loading .qq-btn-label { display: none; }

.qq-btn--success {
  background: var(--qq-success) !important;
  box-shadow: 0 4px 14px rgba(34,197,94,0.35) !important;
  pointer-events: none;
}

@keyframes qq-spin {
  to { transform: rotate(360deg); }
}

/* ── Success Screen ──────────────────────────────────────────────── */
.qq-success-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
  gap: 14px;
}

.qq-success-screen.qq-visible {
  display: flex;
}

.qq-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: qq-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qq-success-icon svg {
  width: 32px;
  height: 32px;
  color: var(--qq-success);
}

.qq-success-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--qq-text);
  letter-spacing: -0.02em;
}

.qq-success-msg {
  font-size: 0.88rem;
  color: var(--qq-text-muted);
  max-width: 340px;
  line-height: 1.6;
}

@keyframes qq-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Error Banner ────────────────────────────────────────────────── */
.qq-error-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--qq-error-bg);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--qq-error);
  font-weight: 500;
  margin: 0 32px 14px;
}

.qq-error-banner.qq-visible {
  display: flex;
}

.qq-error-banner svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── Live region for a11y ────────────────────────────────────────── */
.qq-sr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .qq-card-header { padding: 20px 20px 16px; }
  .qq-progress     { padding: 16px 20px 0; }
  .qq-progress-label { display: none; }
  .qq-step         { padding: 20px 20px 20px; }
  .qq-nav          { padding: 0 20px 22px; }
  .qq-grid         { grid-template-columns: 1fr; }
  .qq-dropdowns-grid { grid-template-columns: 1fr; }
  .qq-calc-inputs  { grid-template-columns: 1fr; }
  .qq-cards-grid   { grid-template-columns: repeat(2, 1fr); }
  .qq-review-body  { grid-template-columns: 1fr; }
  .qq-error-banner { margin: 0 20px 14px; }
}
