/* ChargeIntel "Kolla din plats / Check your site" widget — scoped styles.
   Reuses the landing-kit template's CSS custom properties (--bg/--card/--line/--field/
   --field-line/--fg/--mut/--brand/--accent-bg/--accent-fg/--accent-line/--focus), which the
   template already tunes for WCAG 2.1/2.2 AA contrast in both light and dark themes — this
   file adds ONLY widget-scoped layout/colour, no new tokens, so light/dark/toggle keeps working.
   Contrast: band chips pair a very dark foreground with a very light background (and the
   inverse on [data-theme="dark"]), all >=4.5:1; band meaning is always also conveyed by text,
   never colour alone. Focus outline is inherited from the page's global :focus-visible rule —
   nothing here removes it. No motion/animation is used, so prefers-reduced-motion needs no
   override. */

.widget-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-width: 640px;
  margin: 0 auto 48px;
}
.widget-card h2 { margin: 0 0 8px; font-size: 24px; }
.widget-intro { color: var(--mut); margin: 0 0 20px; }

.widget-form .field-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.widget-form .field-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
@media (max-width: 480px) { .widget-form .field-row.two-col { grid-template-columns: 1fr; } }
.widget-form label { font-weight: 600; font-size: 14px; color: var(--fg); }
.widget-form .opt { font-weight: 400; color: var(--mut); font-size: 12.5px; }
.widget-form .req { color: #b42318; }
[data-theme="dark"] .widget-form .req { color: #f29999; }

.widget-form input[type="text"],
.widget-form input[type="email"],
.widget-form select {
  background: var(--field);
  border: 1px solid var(--field-line);
  color: var(--fg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  width: 100%;
  min-height: 24px;
}
.widget-form .hint { font-size: 12.5px; color: var(--mut); margin: 0 0 12px; }

.widget-error {
  background: #fdecec; border: 1px solid #f3c2c2; color: #8a1f1f;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 4px 0 14px;
}
[data-theme="dark"] .widget-error { background: #3a1414; border-color: #5a1f1f; color: #f29999; }

#w-submit, #w-gate-submit { min-height: 44px; }
#w-submit[aria-busy="true"] { opacity: .75; cursor: progress; }

.widget-result:empty { display: none; }
.widget-result {
  margin-top: 20px; padding: 18px 20px; border-radius: 14px;
  background: var(--accent-bg); border: 1px solid var(--accent-line);
}
.widget-result .score-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.widget-result .score-num { font-size: 32px; font-weight: 800; color: var(--accent-fg); }
.widget-result .band-chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.widget-result .band-high  { background: #eafaf3; color: #0f5132; border: 1px solid #b7e4cb; }
.widget-result .band-medium{ background: #fff8e6; color: #7a5b00; border: 1px solid #f0dca0; }
.widget-result .band-low   { background: #fdecec; color: #8a1f1f; border: 1px solid #f3c2c2; }
[data-theme="dark"] .widget-result .band-high   { background: #113a2a; color: #7ee2b8; border-color: #1f5a41; }
[data-theme="dark"] .widget-result .band-medium { background: #3a2f0a; color: #f4cf6b; border-color: #5a4a13; }
[data-theme="dark"] .widget-result .band-low    { background: #3a1414; color: #f29999; border-color: #5a1f1f; }
.widget-result .factor { margin: 10px 0 0; color: var(--mut); }

.widget-gate {
  margin-top: 20px; padding: 20px; border-radius: 14px;
  background: var(--brand-soft); border: 1px solid var(--accent-line);
}
.widget-gate h3 { margin: 0 0 6px; font-size: 18px; color: var(--brand-soft-ink); }
.widget-gate p { color: var(--brand-soft-ink); margin: 0 0 12px; }
.widget-gate .lead-form { display: flex; gap: 10px; flex-wrap: wrap; }
.widget-gate input[type="email"] {
  flex: 1; min-width: 200px; background: var(--field); border: 1px solid var(--field-line);
  color: var(--fg); border-radius: 10px; padding: 12px 14px; font-size: 16px; min-height: 24px;
}
.widget-gate .done { color: var(--ok); font-weight: 700; margin: 12px 0 0; }

.widget-disclaimer { font-size: 12.5px; color: var(--mut); margin-top: 18px; line-height: 1.55; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
