/* =======================================================================
   Transdoc — Conversion UI
   Quote modal + Sticky mobile CTA + Exit-intent popup + Lead magnets
   ======================================================================= */

:root {
  --tdc-navy: #0A1628;
  --tdc-blue: #1A4DC8;
  --tdc-blue-light: #2563EB;
  --tdc-gold: #F0B429;
  --tdc-green: #16A34A;
  --tdc-red: #DC2626;
  --tdc-gray-50: #F8FAFC;
  --tdc-gray-100: #F1F5F9;
  --tdc-gray-200: #E2E8F0;
  --tdc-gray-400: #94A3B8;
  --tdc-gray-600: #475569;
  --tdc-gray-800: #1E293B;
}

/* ── MODAL OVERLAY ── */
.tdc-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10, 22, 40, .55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  font-family: 'Inter', system-ui, sans-serif;
}
.tdc-modal.open { opacity: 1; visibility: visible; }
.tdc-modal-card {
  background: white; border-radius: 20px; width: 100%; max-width: 600px;
  max-height: 92vh; overflow-y: auto; position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
  transform: scale(.96); transition: transform .28s cubic-bezier(.2,.9,.3,1.25);
}
.tdc-modal.open .tdc-modal-card { transform: scale(1); }
.tdc-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--tdc-gray-100); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--tdc-gray-600); transition: .2s;
}
.tdc-modal-close:hover { background: var(--tdc-gray-200); color: var(--tdc-navy); }

/* ── MODAL HEADER (navy gradient) ── */
.tdc-modal-head {
  background: linear-gradient(135deg, var(--tdc-navy) 0%, #14306E 100%);
  color: white; padding: 28px 32px 24px; border-radius: 20px 20px 0 0;
  position: relative; overflow: hidden;
}
.tdc-modal-head::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 30%, rgba(240,180,41,.18) 0%, transparent 55%);
}
.tdc-modal-head > * { position: relative; }
.tdc-modal-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(240,180,41,.15); border: 1px solid rgba(240,180,41,.35);
  color: var(--tdc-gold); padding: 4px 12px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; margin-bottom: 12px;
}
.tdc-modal-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin: 0 0 6px; line-height: 1.2; }
.tdc-modal-sub { font-size: 14px; color: #CBD5E1; margin: 0; line-height: 1.5; }

/* ── PROGRESS BAR ── */
.tdc-progress {
  display: flex; gap: 6px; padding: 14px 32px;
  background: var(--tdc-gray-50); border-bottom: 1px solid var(--tdc-gray-100);
}
.tdc-progress-step {
  flex: 1; height: 5px; border-radius: 3px; background: var(--tdc-gray-200);
  transition: background .25s;
}
.tdc-progress-step.active { background: var(--tdc-blue); }
.tdc-progress-step.done { background: var(--tdc-green); }

/* ── MODAL BODY ── */
.tdc-modal-body { padding: 28px 32px 20px; }
.tdc-step { display: none; }
.tdc-step.active { display: block; animation: tdcFadeIn .3s ease; }
@keyframes tdcFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.tdc-step-title {
  font-size: 17px; font-weight: 700; color: var(--tdc-navy);
  margin: 0 0 6px; letter-spacing: -.2px;
}
.tdc-step-sub {
  font-size: 13.5px; color: var(--tdc-gray-600); margin: 0 0 22px; line-height: 1.55;
}

/* ── RADIO CARDS (for document type, delivery) ── */
.tdc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tdc-card-radio {
  position: relative; border: 1.5px solid var(--tdc-gray-200); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: .18s;
  display: flex; align-items: flex-start; gap: 12px; background: white;
}
.tdc-card-radio:hover { border-color: var(--tdc-blue-light); background: var(--tdc-gray-50); }
.tdc-card-radio.selected { border-color: var(--tdc-blue); background: rgba(26,77,200,.04); box-shadow: 0 0 0 3px rgba(26,77,200,.12); }
.tdc-card-radio input { position: absolute; opacity: 0; pointer-events: none; }
.tdc-card-ico {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--tdc-blue), var(--tdc-blue-light));
  color: white; display: flex; align-items: center; justify-content: center;
}
.tdc-card-label { flex: 1; }
.tdc-card-name { font-size: 14px; font-weight: 700; color: var(--tdc-navy); line-height: 1.3; }
.tdc-card-desc { font-size: 12px; color: var(--tdc-gray-600); margin-top: 2px; line-height: 1.4; }
.tdc-card-price { font-size: 12.5px; font-weight: 700; color: var(--tdc-blue); margin-top: 4px; }

/* ── SELECTS / INPUTS ── */
.tdc-field { margin-bottom: 16px; }
.tdc-field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--tdc-gray-800);
  margin-bottom: 6px;
}
.tdc-field label .req { color: var(--tdc-red); }
.tdc-field input[type="text"],
.tdc-field input[type="email"],
.tdc-field input[type="tel"],
.tdc-field select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--tdc-gray-200);
  border-radius: 9px; font-size: 14px; color: var(--tdc-gray-800);
  background: white; transition: .18s; font-family: inherit;
}
.tdc-field input:focus, .tdc-field select:focus {
  outline: none; border-color: var(--tdc-blue); box-shadow: 0 0 0 3px rgba(26,77,200,.15);
}
.tdc-field input.error, .tdc-field select.error { border-color: var(--tdc-red); }
.tdc-field-err { font-size: 12px; color: var(--tdc-red); margin-top: 4px; display: none; }
.tdc-field.has-error .tdc-field-err { display: block; }

.tdc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── PRICE SUMMARY (last step) ── */
.tdc-summary {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF4FF 100%);
  border: 1px solid var(--tdc-gray-200); border-radius: 14px;
  padding: 20px 22px; margin-bottom: 18px;
}
.tdc-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; font-size: 13.5px; color: var(--tdc-gray-600);
  border-bottom: 1px dashed var(--tdc-gray-200);
}
.tdc-summary-row:last-of-type { border-bottom: none; }
.tdc-summary-row strong { color: var(--tdc-navy); font-weight: 600; }
.tdc-summary-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 14px; margin-top: 8px; border-top: 2px solid var(--tdc-gray-200);
}
.tdc-summary-total-label { font-size: 13px; color: var(--tdc-gray-600); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.tdc-summary-total-value { font-size: 28px; font-weight: 800; color: var(--tdc-navy); letter-spacing: -.6px; }
.tdc-summary-total-value small { font-size: 13px; font-weight: 500; color: var(--tdc-gray-600); margin-left: 4px; }

.tdc-trust {
  display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--tdc-gray-600);
  justify-content: center; margin-top: 14px;
}
.tdc-trust-item { display: flex; align-items: center; gap: 4px; }
.tdc-trust-item svg { color: var(--tdc-green); }

/* ── MODAL FOOTER (buttons) ── */
.tdc-modal-foot {
  padding: 18px 32px 28px; border-top: 1px solid var(--tdc-gray-100);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tdc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none; font-family: inherit;
  transition: .18s;
}
.tdc-btn-primary {
  background: var(--tdc-blue); color: white;
  box-shadow: 0 4px 14px rgba(26,77,200,.35);
}
.tdc-btn-primary:hover { background: #1540A0; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,77,200,.45); }
.tdc-btn-primary[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.tdc-btn-ghost {
  background: transparent; color: var(--tdc-gray-600); border: 1.5px solid var(--tdc-gray-200);
}
.tdc-btn-ghost:hover { border-color: var(--tdc-blue); color: var(--tdc-blue); }
.tdc-btn-gold {
  background: linear-gradient(135deg, var(--tdc-gold) 0%, #D99B0A 100%);
  color: var(--tdc-navy);
  box-shadow: 0 4px 14px rgba(240,180,41,.45);
}
.tdc-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(240,180,41,.55); }

/* ── SUCCESS STATE ── */
.tdc-success {
  text-align: center; padding: 40px 32px;
}
.tdc-success-icon {
  width: 72px; height: 72px; border-radius: 50%; background: rgba(22,163,74,.12);
  color: var(--tdc-green); margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.tdc-success h3 { font-size: 22px; font-weight: 800; color: var(--tdc-navy); margin: 0 0 8px; }
.tdc-success p { font-size: 14px; color: var(--tdc-gray-600); margin: 0 0 20px; line-height: 1.6; }

/* ── STICKY MOBILE CTA ── */
.tdc-sticky-mobile {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: white; border-top: 1px solid var(--tdc-gray-200);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(10,22,40,.12);
  font-family: 'Inter', system-ui, sans-serif;
}
.tdc-sticky-mobile-inner { display: flex; gap: 10px; align-items: center; }
.tdc-sticky-mobile a.tdc-sticky-call {
  flex: 0 0 46px; height: 46px; border-radius: 50%;
  background: var(--tdc-gray-100); color: var(--tdc-navy);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.tdc-sticky-mobile button.tdc-sticky-cta {
  flex: 1; padding: 13px 18px; border-radius: 10px;
  background: var(--tdc-blue); color: white; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(26,77,200,.4);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

/* ── EXIT INTENT POPUP ── */
.tdc-exit {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(10,22,40,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  font-family: 'Inter', system-ui, sans-serif;
}
.tdc-exit.open { opacity: 1; visibility: visible; }
.tdc-exit-card {
  background: white; border-radius: 20px; width: 100%; max-width: 440px;
  overflow: hidden; position: relative;
  transform: scale(.92); transition: transform .3s cubic-bezier(.2,.9,.3,1.25);
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.tdc-exit.open .tdc-exit-card { transform: scale(1); }
.tdc-exit-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--tdc-gray-800);
}
.tdc-exit-head {
  background: linear-gradient(135deg, var(--tdc-navy), #14306E);
  color: white; padding: 30px 28px 24px; text-align: center;
}
.tdc-exit-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tdc-gold); color: var(--tdc-navy);
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: 12px;
}
.tdc-exit-head h3 { font-size: 22px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.3px; line-height: 1.25; }
.tdc-exit-head p { font-size: 14px; color: #CBD5E1; margin: 0; line-height: 1.5; }
.tdc-exit-body { padding: 24px 28px 28px; }
.tdc-exit-body input[type="email"] {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--tdc-gray-200);
  border-radius: 10px; font-size: 15px; margin-bottom: 10px; font-family: inherit;
  color: var(--tdc-gray-800);
}
.tdc-exit-body input[type="email"]:focus {
  outline: none; border-color: var(--tdc-blue); box-shadow: 0 0 0 3px rgba(26,77,200,.15);
}
.tdc-exit-body button { width: 100%; padding: 13px; font-size: 15px; }
.tdc-exit-legal { font-size: 11px; color: var(--tdc-gray-400); text-align: center; margin-top: 10px; line-height: 1.5; }

/* ── LEAD MAGNET BANNER (embed on pages) ── */
.tdc-leadmagnet {
  background: linear-gradient(135deg, #EFF4FF 0%, #F8FAFC 100%);
  border: 1px solid rgba(26,77,200,.2); border-radius: 16px;
  padding: 28px; margin: 36px 0; display: grid;
  grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center;
}
.tdc-leadmagnet-icon {
  width: 100px; height: 120px; border-radius: 10px;
  background: linear-gradient(135deg, var(--tdc-blue) 0%, var(--tdc-navy) 100%);
  color: white; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(10,22,40,.15); position: relative;
}
.tdc-leadmagnet-icon::after {
  content: "PDF"; position: absolute; bottom: 10px; right: -8px;
  background: var(--tdc-gold); color: var(--tdc-navy);
  padding: 3px 9px; border-radius: 5px; font-size: 10px; font-weight: 800;
  letter-spacing: 1px;
}
.tdc-leadmagnet-title { font-size: 18px; font-weight: 800; color: var(--tdc-navy); margin: 0 0 6px; letter-spacing: -.2px; }
.tdc-leadmagnet-text { font-size: 14px; color: var(--tdc-gray-600); margin: 0; line-height: 1.55; }
.tdc-leadmagnet button {
  padding: 13px 24px; background: var(--tdc-navy); color: white;
  border: none; border-radius: 10px; font-weight: 700; font-size: 14px;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(10,22,40,.25);
  display: inline-flex; align-items: center; gap: 8px;
  transition: .18s;
}
.tdc-leadmagnet button:hover { background: var(--tdc-blue); transform: translateY(-1px); }

/* ── MEDIA ── */
@media (max-width: 768px) {
  .tdc-modal-card { max-height: 96vh; border-radius: 16px; }
  .tdc-modal-head { padding: 22px 20px 18px; }
  .tdc-modal-title { font-size: 19px; }
  .tdc-modal-body { padding: 22px 20px 16px; }
  .tdc-modal-foot { padding: 14px 20px 22px; }
  .tdc-cards { grid-template-columns: 1fr; }
  .tdc-field-row { grid-template-columns: 1fr; }
  .tdc-sticky-mobile { display: block; }
  body.tdc-has-sticky { padding-bottom: 80px; }
  .tdc-leadmagnet { grid-template-columns: 1fr; text-align: center; }
  .tdc-leadmagnet-icon { margin: 0 auto; }
  .tdc-progress { padding: 12px 20px; }
}
@media (max-width: 420px) {
  .tdc-modal-foot .tdc-btn { flex: 1; min-width: 0; }
}
