/* IWT Site Scanner Widget */
.iwt-scanner-widget {
  --brand: #1a56db;
  --brand-dk: #1440a8;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ── Hero ── */
.iwts-hero { text-align: center; padding: 36px 16px 24px; }
.iwts-hero h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800; color: #fff; margin: 0 0 10px; line-height: 1.2;
}
.iwts-hero p { font-size: 1rem; color: rgba(255,255,255,.75); margin: 0 auto; max-width: 500px; }

/* ── URL input card ── */
.iwts-url-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 24px 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.iwts-url-row {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--border); border-radius: 10px;
  padding: 4px 4px 4px 14px; margin-bottom: 16px;
  transition: border-color .15s;
}
.iwts-url-row:focus-within { border-color: var(--brand); }
.iwts-url-icon { font-size: 1.3rem; flex-shrink: 0; }
.iwts-url-row input {
  flex: 1; border: none; outline: none; font-size: 1rem;
  color: var(--text); padding: 10px 0; background: transparent;
}
.iwts-url-row input::placeholder { color: #9ca3af; }

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

/* ── Loading / radar ── */
.iwts-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;
}
.iwts-radar {
  position: relative; width: 90px; height: 90px;
  margin: 0 auto 24px;
}
.iwts-radar-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(26,86,219,.2);
  animation: iwts-pulse 2s ease-out infinite;
}
.iwts-ring-2 { animation-delay: .6s; }
.iwts-ring-3 { animation-delay: 1.2s; }
@keyframes iwts-pulse {
  0%   { transform: scale(.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.iwts-radar-dot {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 1.8rem;
}
.iwts-loading-card h3 { font-size: 1.15rem; margin: 0 0 8px; }
.iwts-loading-card p  { color: var(--muted); font-size: .875rem; margin: 0 0 20px; }
.iwts-progress-bar { background: #e5e7eb; border-radius: 100px; height: 6px; overflow: hidden; max-width: 320px; margin: 0 auto 16px; }
.iwts-progress-fill { height: 100%; background: var(--brand); border-radius: 100px; width: 0%; transition: width .5s ease; }
.iwts-scan-checks { font-size: .8rem; color: var(--muted); min-height: 20px; }
.iwts-scan-checks span { display: inline-block; margin: 2px 6px; }
.iwts-check-done { color: #15803d; }

/* ── Report header ── */
.iwts-report-header {
  background: var(--brand); border-radius: 16px; padding: 24px 28px;
  color: #fff; margin: 16px 0 20px; display: flex;
  align-items: center; gap: 20px; flex-wrap: wrap;
}
.iwts-score-ring { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.iwts-ring-svg   { width: 110px; height: 110px; }
.iwts-ring-label {
  position: absolute; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.iwts-ring-label span { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.iwts-ring-label small { font-size: .65rem; opacity: .75; }
.iwts-report-header-text { flex: 1; }
.iwts-grade-tag {
  display: inline-block; background: rgba(255,255,255,.2);
  border-radius: 6px; padding: 3px 12px; font-weight: 700;
  font-size: .9rem; margin-bottom: 8px;
}
.iwts-report-header-text h3 { font-size: 1rem; margin-bottom: 6px; word-break: break-all; }
.iwts-report-header-text p  { opacity: .88; font-size: .875rem; font-style: italic; }
.iwts-ps-pills { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.iwts-ps-pill  {
  background: rgba(255,255,255,.15); border-radius: 100px;
  padding: 3px 10px; font-size: .75rem; font-weight: 600;
}

/* ── Section cards ── */
.iwts-sec-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,.05);
}
.iwts-sec-hdr  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.iwts-sec-title { font-size: 1rem; font-weight: 700; }
.iwts-grade-badge { padding: 3px 12px; border-radius: 100px; font-size: .72rem; font-weight: 700; }
.iwts-sec-summary { color: #555; font-size: .9rem; margin-bottom: 10px; line-height: 1.6; }
.iwts-sec-issues  { margin: 0 0 10px; padding-left: 20px; }
.iwts-sec-issues li { font-size: .875rem; color: #374151; margin-bottom: 4px; }
.iwts-priority-fix {
  background: #fef9c3; border-left: 3px solid #eab308;
  border-radius: 0 6px 6px 0; padding: 10px 14px; font-size: .875rem;
}
.iwts-priority-fix strong { color: #854d0e; }

/* ── Gate ── */
.iwts-gate-wrap { position: relative; margin: 20px 0; }
.iwts-gate-blur { filter: blur(5px); pointer-events: none; user-select: none; opacity: .35; }
.iwts-blur-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; height: 110px; margin-bottom: 12px; }
.iwts-blur-short { height: 70px; }
.iwts-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: 460px;
  text-align: center; z-index: 10;
}
.iwts-gate-lock { font-size: 2rem; margin-bottom: 10px; }
.iwts-gate-card h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 8px; }
.iwts-gate-card p  { color: var(--muted); font-size: .875rem; margin: 0 0 18px; }
.iwts-gate-form input {
  display: block; width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .95rem; margin-bottom: 10px; outline: none;
  transition: border-color .15s;
}
.iwts-gate-form input:focus { border-color: var(--brand); }

/* ── Share bar ── */
.iwts-share-bar {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.iwts-share-bar span { font-size: .85rem; color: #1e40af; font-weight: 600; white-space: nowrap; }
.iwts-share-bar input {
  flex: 1; min-width: 180px; padding: 8px 12px;
  border: 1px solid #bfdbfe; border-radius: 6px;
  font-size: .8rem; color: #374151; background: #fff;
}
.iwts-copy-btn {
  padding: 8px 16px; background: var(--brand); color: #fff;
  border: none; border-radius: 6px; font-size: .8rem;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}

/* ── Wins / closing / CTA ── */
.iwts-wins-card { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 20px 24px; margin-bottom: 12px; }
.iwts-wins-card h3 { color: #15803d; font-size: 1rem; margin: 0 0 10px; }
.iwts-wins-card ul { padding-left: 20px; margin: 0; }
.iwts-wins-card li { font-size: .875rem; margin-bottom: 5px; }
.iwts-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.75; }
.iwts-cta-card { background: var(--brand); border-radius: 16px; padding: 32px; text-align: center; color: #fff; margin-top: 12px; }
.iwts-cta-card h3 { font-size: 1.3rem; margin: 0 0 10px; }
.iwts-cta-card p  { opacity: .88; margin: 0 0 24px; font-size: .95rem; }
.iwts-cta-card a  { display: inline-block; background: #fff; color: var(--brand); padding: 14px 28px; border-radius: 8px; font-weight: 700; text-decoration: none; font-size: 1rem; }

/* ── Msg + spinner ── */
.iwts-msg { font-size: .875rem; margin-top: 10px; min-height: 18px; }
.iwts-msg.error   { color: #dc2626; }
.iwts-msg.success { color: #15803d; }
.iwts-spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: iwts-spin .7s linear infinite;
  display: inline-block; vertical-align: middle; margin-right: 6px;
}
@keyframes iwts-spin { to { transform: rotate(360deg); } }

/* ── Mobile ── */
@media(max-width:560px) {
  .iwts-report-header { flex-direction: column; text-align: center; }
  .iwts-gate-card { padding: 22px 18px; }
  .iwts-url-card  { padding: 18px 16px; }
  .iwts-share-bar { flex-direction: column; align-items: stretch; }
  .iwts-copy-btn  { width: 100%; }
}
