/* ============================================================================
 * Terms.Law, Reusable Quote Calc Component
 * File: /shared/quote-calc.css
 *
 * Visual language follows CLAUDE.md S6 CSS variable system (matches CLAB card
 * style: white card, rounded 16px, subtle shadow, sparkle icon in primary
 * color, recommended-tier highlighted with primary color border).
 *
 * Mobile-first: 44px+ tap targets, sliders work on touch, compact below 600px.
 * ========================================================================== */

.qc-shell {
  background: var(--color-card, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 16px;
  padding: 24px 22px;
  color: var(--color-text, #1a1a2e);
  font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  margin: 24px 0 28px 0;
  max-width: 100%;
  box-sizing: border-box;
}

.qc-shell *,
.qc-shell *::before,
.qc-shell *::after { box-sizing: border-box; }

.qc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.qc-spark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #2563eb);
}

.qc-spark svg { width: 100%; height: 100%; display: block; }

.qc-titles { flex: 1 1 auto; min-width: 0; }

.qc-title {
  margin: 0 0 4px 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text, #1a1a2e);
}

.qc-subtitle {
  margin: 0;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- Inputs ---------- */
.qc-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 18px 0;
}

.qc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qc-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  line-height: 1.35;
}

.qc-hint {
  font-size: 0.78rem;
  color: var(--color-text-secondary, #6b7280);
  font-weight: 400;
  line-height: 1.4;
}

.qc-control { display: flex; flex-direction: column; gap: 6px; }

/* Range slider */
.qc-range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qc-range {
  flex: 1 1 auto;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right,
    var(--color-primary, #2563eb) 0%,
    var(--color-primary, #2563eb) var(--qc-fill, 0%),
    #e5e7eb var(--qc-fill, 0%),
    #e5e7eb 100%);
  outline: none;
  min-height: 44px;
  padding: 19px 0;
  cursor: pointer;
  background-clip: content-box;
}

.qc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.qc-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.qc-range-value {
  flex: 0 0 auto;
  min-width: 80px;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text, #1a1a2e);
  font-variant-numeric: tabular-nums;
}

/* Select dropdown */
.qc-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text, #1a1a2e);
  background: #fff;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'><path d='M5.25 7.5L10 12.25L14.75 7.5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  cursor: pointer;
}

.qc-select:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Checkbox chip rows */
.qc-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  font-size: 0.88rem;
  color: var(--color-text, #1a1a2e);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.qc-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.qc-chip:hover { border-color: var(--color-primary, #2563eb); }

.qc-chip--active {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary-dark, #1d4ed8);
  font-weight: 600;
}

/* Number input */
.qc-number {
  height: 44px;
  width: 100%;
  max-width: 160px;
  padding: 8px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text, #1a1a2e);
}

.qc-number:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* ---------- Recommended tier (the showpiece) ---------- */
.qc-result {
  margin-top: 6px;
  border-top: 1px dashed var(--color-border, #e5e7eb);
  padding-top: 18px;
}

.qc-rec {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(99, 102, 241, 0.04));
  border: 2px solid var(--color-primary, #2563eb);
  border-radius: 14px;
  padding: 18px 18px 16px 18px;
  margin-bottom: 14px;
}

.qc-rec-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-primary, #2563eb);
  margin-bottom: 6px;
}

.qc-rec-label {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text, #1a1a2e);
  line-height: 1.25;
  margin: 0 0 4px 0;
}

.qc-rec-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-dark, #1d4ed8);
  margin: 0 0 10px 0;
}

.qc-rec-why {
  margin: 0 0 14px 0;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.9rem;
  line-height: 1.55;
}

.qc-rec-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  background: var(--color-primary, #2563eb);
  color: #ffffff !important;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease;
}

.qc-rec-cta:hover { background: var(--color-primary-dark, #1d4ed8); }

.qc-rec-cta-arrow { display: inline-block; transition: transform 0.15s ease; }
.qc-rec-cta:hover .qc-rec-cta-arrow { transform: translateX(2px); }

.qc-est {
  display: inline-block;
  margin-left: 12px;
  font-size: 0.82rem;
  color: var(--color-text-secondary, #6b7280);
}

/* ---------- Other tiers (compact comparison pills) ---------- */
.qc-others {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.qc-others-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  margin: 0 0 2px 0;
}

.qc-others-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qc-other {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f6f8fa;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--color-text, #1a1a2e);
  cursor: pointer;
  font-family: inherit;
  min-height: 36px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qc-other:hover {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.qc-other-name { font-weight: 600; }
.qc-other-price { color: var(--color-text-secondary, #6b7280); }

/* ---------- Overflow note + disclaimer ---------- */
.qc-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.78rem;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.5;
}

.qc-disclaimer {
  margin: 8px 0 0 0;
  font-size: 0.72rem;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.5;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .qc-shell { padding: 18px 14px; border-radius: 14px; }
  .qc-title { font-size: 1.08rem; }
  .qc-subtitle { font-size: 0.88rem; }
  .qc-rec { padding: 16px 14px; }
  .qc-rec-label { font-size: 1.12rem; }
  .qc-rec-price { font-size: 0.98rem; }
  .qc-rec-cta { width: 100%; justify-content: center; padding: 12px 16px; }
  .qc-est { display: block; margin: 8px 0 0 0; }
  .qc-range-value { min-width: 64px; font-size: 0.88rem; }
  .qc-other { font-size: 0.8rem; }
}

@media (min-width: 720px) {
  .qc-inputs--two-col { grid-template-columns: 1fr 1fr; gap: 16px 20px; }
  .qc-field--full { grid-column: 1 / -1; }
}
