/* VTC Deal Compare — aligned with vtc-ttl-calculator / CQP form language */

.vtc-dc *,
.vtc-dc *::before,
.vtc-dc *::after {
  box-sizing: border-box;
}

.vtc-dc {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  color: #1a202c;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.vtc-dc input,
.vtc-dc select,
.vtc-dc button {
  font-family: inherit;
}

.vtc-dc__header {
  margin-bottom: 14px;
}

.vtc-dc__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #022345;
}

.vtc-dc__sub {
  margin: 0;
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.45;
  max-width: 40rem;
}

.vtc-dc__hint {
  margin: 0 0 12px;
  font-size: 0.70rem;
  color: #6b7280;
  line-height: 1.45;
}

.vtc-dc__field-note {
  display: block;
  font-size: 0.70rem;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.45;
}

/* Paywall */
.vtc-dc__paywall {
  background: #f0f6ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.vtc-dc__paywall-lead {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #022345;
}

.vtc-dc__paywall-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.vtc-dc__paywall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vtc-dc__paywall-note {
  margin: 10px 0 0;
  color: #b91c1c;
  font-size: 0.78rem;
}

.vtc-dc__login-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
}

.vtc-dc__login-hint a {
  color: #022345;
  font-weight: 600;
}

.vtc-dc__active-badge {
  display: inline-block;
  margin: 0 0 12px;
  border-radius: 20px;
  padding: 3px 10px;
  background: #022345;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.vtc-dc__active-badge--test {
  background: #f0f9ff;
  color: #022345;
  border: 1px solid #A4DFF5;
}

/* Panels / cards */
.vtc-dc__panel,
.vtc-dc__shared,
.vtc-dc__car,
.vtc-dc__tco-shared,
.vtc-dc__details,
.vtc-dc__results {
  background: #fff;
  border: 1px solid #e4f1f5;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(2, 35, 69, 0.06);
}

.vtc-dc__shared {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  align-items: start;
}

.vtc-dc__cars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.vtc-dc__car {
  margin: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.vtc-dc__car legend {
  font-size: 0.88rem;
  font-weight: 700;
  color: #022345;
  padding: 0 4px;
}

/* Fields — same pattern as .cqp-field-group */
.vtc-dc__field {
  margin: 0;
  min-width: 0;
}

.vtc-dc__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.vtc-dc__input,
.vtc-dc__select,
.vtc-dc input[type="text"],
.vtc-dc input[type="number"],
.vtc-dc input[type="email"],
.vtc-dc select {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.84rem;
  color: #1a202c;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vtc-dc input:focus,
.vtc-dc select:focus {
  outline: none;
  border-color: #022345;
  box-shadow: 0 0 0 3px rgba(2, 35, 69, 0.1);
}

/* Don't use CSS grid on raw labels — that broke loan details */
.vtc-dc label:not(.vtc-dc__check) {
  display: block;
  margin: 0;
}

.vtc-dc label:not(.vtc-dc__check) > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

.vtc-dc__check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.vtc-dc__check input {
  width: 16px;
  height: 16px;
  accent-color: #022345;
  flex-shrink: 0;
  cursor: pointer;
}

.vtc-dc__check--legend {
  font-size: 0.88rem;
  font-weight: 700;
  color: #022345;
}

.vtc-dc__grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

/* Accordion-style details */
.vtc-dc__details {
  margin: 0 0 12px;
  padding: 0;
  overflow: hidden;
}

.vtc-dc__details > summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #022345;
  user-select: none;
}

.vtc-dc__details > summary::-webkit-details-marker {
  display: none;
}

.vtc-dc__details > summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #9ca3af;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.vtc-dc__details[open] > summary::before {
  transform: rotate(180deg);
  border-top-color: #022345;
}

.vtc-dc__details > summary:hover {
  background: #E4F1F5;
}

.vtc-dc__details[open] > summary {
  border-bottom: 1px solid #e4f1f5;
}

.vtc-dc__details-body {
  padding: 16px 18px;
}

.vtc-dc__car .vtc-dc__details {
  margin: 0;
  box-shadow: none;
}

.vtc-dc__car .vtc-dc__details > summary {
  padding: 10px 12px;
  font-size: 0.78rem;
}

.vtc-dc__car .vtc-dc__details-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* TCO panel */
.vtc-dc__tco-shared {
  margin: 0 0 12px;
  padding: 16px 18px;
}

.vtc-dc__tco-shared > legend {
  font-size: 0.88rem;
  font-weight: 700;
  color: #022345;
  padding: 0 4px;
}

.vtc-dc__layers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e4f1f5;
  border-radius: 8px;
}

/* Buttons */
.vtc-dc__actions {
  margin: 4px 0 14px;
}

.vtc-dc__btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.vtc-dc__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vtc-dc__btn--primary {
  background: #022345;
  color: #fff;
}

.vtc-dc__btn--primary:hover:not(:disabled) {
  background: #033a6b;
}

.vtc-dc__btn--secondary {
  background: #fff;
  border-color: #e4f1f5;
  color: #022345;
}

.vtc-dc__btn--secondary:hover:not(:disabled) {
  background: #E4F1F5;
}

/* Results */
.vtc-dc__results {
  border-top: 4px solid #022345;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(2, 35, 69, 0.10);
}

.vtc-dc__section-title {
  margin: 16px 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #022345;
}

.vtc-dc__section-title:first-child {
  margin-top: 0;
}

.vtc-dc__winner {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #f0f9ff;
  border: 1px solid #A4DFF5;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #022345;
  line-height: 1.45;
}

.vtc-dc__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.vtc-dc__table th,
.vtc-dc__table td {
  border-bottom: 1px solid #f3f4f6;
  padding: 7px 4px;
  text-align: right;
  vertical-align: top;
}

.vtc-dc__table th:first-child,
.vtc-dc__table td:first-child {
  text-align: left;
  color: #374151;
  font-weight: 500;
}

.vtc-dc__table th {
  font-weight: 700;
  color: #022345;
  border-bottom-color: #e4f1f5;
}

.vtc-dc__table .is-subtotal td {
  font-weight: 700;
  color: #022345;
  background: #f8fafc;
}

.vtc-dc__table .is-total td {
  font-weight: 800;
  color: #022345;
  border-top: 2px solid #022345;
  border-bottom: none;
  padding-top: 12px;
}

.vtc-dc__table .is-emphasis td {
  font-weight: 700;
  color: #022345;
}

.vtc-dc__delta {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: #6b7280;
  line-height: 1.45;
}

.vtc-dc__warnings {
  margin: 14px 0 0;
  padding: 10px 14px;
  background: #f0f9ff;
  border: 1px solid #A4DFF5;
  border-radius: 7px;
  font-size: 0.74rem;
  color: #022345;
  line-height: 1.65;
}

.vtc-dc__warnings ul {
  margin: 6px 0 0;
  padding-left: 1.1rem;
}

.vtc-dc__error {
  color: #b91c1c;
  margin-top: 10px;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .vtc-dc__shared,
  .vtc-dc__cars,
  .vtc-dc__paywall-fields,
  .vtc-dc__grid-2,
  .vtc-dc__layers {
    grid-template-columns: 1fr;
  }
}

/* Paywall modal */
.vtc-dc__modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.vtc-dc__modal[hidden] {
  display: none !important;
}
.vtc-dc__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 35, 69, 0.45);
}
.vtc-dc__modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(2, 35, 69, 0.25);
  padding: 8px;
}
.vtc-dc__modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
}
.vtc-dc__modal-close:hover {
  color: #022345;
}
.vtc-dc__modal .vtc-dc__paywall {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 20px 18px 16px;
}
.vtc-dc__active-badge--locked {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
html.vtc-dc-modal-open,
html.vtc-dc-modal-open body {
  overflow: hidden;
}


.vtc-dc__paywall--modal {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 20px 18px 16px;
}

.vtc-dc__banner {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.vtc-dc__banner p { margin: 0; }
.vtc-dc__banner--pending {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.vtc-dc__banner--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.vtc-dc__banner--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
