/* IWT Lead Audit Widget */
.iwt-audit-widget {
  --brand: #1a56db;
  --brand-dark: #1440a8;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ── Hero ── */
.iwt-hero {
  text-align: center;
  padding: 40px 20px 28px;
}
.iwt-hero h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 12px;
  line-height: 1.2;
}
.iwt-hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  margin: 0;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Form card ── */
.iwt-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.iwt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.iwt-field { display: flex; flex-direction: column; gap: 6px; }
.iwt-field label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.iwt-field input,
.iwt-field select {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  background: #fff;
  width: 100%;
}
.iwt-field input:focus,
.iwt-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

/* ── Buttons ── */
.iwt-btn-primary {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.iwt-btn-primary:hover { background: var(--brand-dark); }
.iwt-btn-primary:active { transform: scale(.98); }
.iwt-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.iwt-fine {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  margin: 10px 0 0;
}

/* ── Loading ── */
.iwt-loading-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  margin-top: 16px;
}
.iwt-spinner-large {
  width: 52px; height: 52px;
  border: 4px solid rgba(26,86,219,.15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: iwt-spin .8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes iwt-spin { to { transform: rotate(360deg); } }
.iwt-loading-card h3 { font-size: 1.2rem; margin: 0 0 8px; }
.iwt-loading-card p  { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }

.iwt-progress-bar {
  background: #e5e7eb;
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  max-width: 320px;
  margin: 0 auto;
}
.iwt-progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 100px;
  width: 0%;
  transition: width .4s ease;
}

/* ── Score header ── */
.iwt-score-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--brand);
  border-radius: 16px;
  padding: 24px 28px;
  color: #fff;
  margin: 16px 0 20px;
}
.iwt-score-circle {
  flex-shrink: 0;
  width: 80px; height: 80px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.iwt-score-circle span { font-size: 1.8rem; line-height: 1; }
.iwt-score-circle small { font-size: .7rem; opacity: .75; }
.iwt-score-text h3 { font-size: 1.2rem; margin: 0 0 6px; }
.iwt-score-text p  { margin: 0; opacity: .88; font-size: .9rem; font-style: italic; }

/* ── Audit sections ── */
.iwt-section-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.iwt-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.iwt-section-title { font-size: 1rem; font-weight: 700; }
.iwt-grade-badge {
  padding: 3px 12px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
}
.iwt-section-summary { color: #555; font-size: .9rem; margin-bottom: 10px; line-height: 1.6; }
.iwt-section-issues { margin: 0 0 10px; padding-left: 20px; }
.iwt-section-issues li { font-size: .875rem; color: #374151; margin-bottom: 4px; }
.iwt-priority-fix {
  background: #fef9c3;
  border-left: 3px solid #eab308;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: .875rem;
}
.iwt-priority-fix strong { color: #854d0e; }

/* ── Gate ── */
.iwt-gate-wrapper {
  position: relative;
  margin: 20px 0;
}
.iwt-gate-blur {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  opacity: .4;
  padding: 0 0 8px;
}
.iwt-blur-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 100px;
  margin-bottom: 12px;
}
.iwt-gate-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  width: calc(100% - 32px);
  max-width: 480px;
  text-align: center;
  z-index: 10;
}
.iwt-gate-icon { font-size: 2rem; margin-bottom: 10px; }
.iwt-gate-card h3 { font-size: 1.2rem; font-weight: 800; margin: 0 0 8px; }
.iwt-gate-card p  { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }
.iwt-gate-form .iwt-field { margin-bottom: 10px; }
.iwt-gate-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}
.iwt-gate-form input:focus { border-color: var(--brand); }

/* ── Wins card ── */
.iwt-wins-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
}
.iwt-wins-card h3 { font-size: 1rem; font-weight: 700; color: #15803d; margin: 0 0 10px; }
.iwt-wins-card ul { margin: 0; padding-left: 20px; }
.iwt-wins-card li { font-size: .875rem; color: #374151; margin-bottom: 5px; }

/* ── Closing + CTA ── */
.iwt-closing-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  font-size: .95rem;
  color: #374151;
  line-height: 1.7;
}
.iwt-cta-card {
  background: var(--brand);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  color: #fff;
  margin-top: 12px;
}
.iwt-cta-card h3  { font-size: 1.3rem; margin: 0 0 10px; }
.iwt-cta-card p   { opacity: .88; margin: 0 0 24px; font-size: .95rem; }
.iwt-cta-card a {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

/* ── Spinner (inline) ── */
.iwt-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: iwt-spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── Messages ── */
.iwt-msg { font-size: .875rem; margin-top: 10px; min-height: 20px; }
.iwt-msg.error   { color: #dc2626; }
.iwt-msg.success { color: #15803d; }

/* ── Mobile ── */
@media(max-width: 560px) {
  .iwt-field-row { grid-template-columns: 1fr; }
  .iwt-form-card { padding: 20px 16px; }
  .iwt-score-header { flex-direction: column; text-align: center; }
  .iwt-gate-card { padding: 24px 20px; }
}
