/**
 * IVIG Brand Comparison Tool — styles.
 *
 * v1.2.0
 * - Font sizes are in px, ~25% larger than the original design. The site theme
 *   sets html { font-size: 10px }, so the old rem sizes rendered at ~60%.
 * - A reset block (right after the #ivig-tool wrapper rule) stops theme rules
 *   for button / input / table / h2 / h3 / a from restyling the tool, so it
 *   renders the same as the reference HTML page.
 *
 * @package IVIG_Comparison_Tool
 */

#ivig-tool * {
  box-sizing: border-box;
}
#ivig-tool {
  --ap-primary: #102e61; /* AmeriPharma midnight blue */
  --ap-accent: #019cde; /* bright accent: decoration only (borders, underline, hover, focus) */
  --ap-accent-strong: #0a6d97; /* accessible accent: text + button fills, >=4.5:1 on white */
  --ap-grad: linear-gradient(290deg, #0a6d97 0px, #102e61 100%);
  --ap-accent-soft: #edf8fd;
  --ap-line: #d7e3ee;
  --ap-ok: #1c7a4d;
  --ap-warn: #9a6b00;
  --ap-bg: #ffffff;
  --ap-ghost: #f8f9fb;
  --ap-muted: #5a6573;
  --ap-ink: #1f2733;
  --ap-font:
 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
 Arial, sans-serif;
  font-family: var(--ap-font);
  font-size: 18px;
  line-height: 1.55;
  text-align: left;
  color: var(--ap-ink);
  background: var(--ap-bg);
  border: 1px solid var(--ap-line);
  border-radius: 14px;
  overflow: hidden;
  margin: 28px 0;
  box-shadow: 0 2px 8px rgba(16, 46, 97, 0.08);
}

/* Reset: neutralize theme rules that leak into the tool */
#ivig-tool h2,
#ivig-tool h3,
#ivig-tool h4 {
  font-family: var(--ap-font);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  hyphens: manual;
  word-break: normal;
  border: none;
  padding: 0;
}
#ivig-tool p {
  padding: 0;
  line-height: 1.55;
}
#ivig-tool button,
#ivig-tool input,
#ivig-tool select,
#ivig-tool textarea {
  font-family: var(--ap-font);
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  min-height: 0;
  box-shadow: none;
}
#ivig-tool button {
  border-radius: 0;
  transition-duration: 0.16s;
}
#ivig-tool input[type="radio"],
#ivig-tool input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 0;
  padding: 0;
  border: revert;
  border-radius: revert;
  background: revert;
  accent-color: var(--ap-accent-strong);
}
#ivig-tool a {
  color: var(--ap-accent-strong);
  text-decoration: underline;
  border: 0;
}
#ivig-tool table {
  border: 0;
  margin: 0;
}
#ivig-tool strong,
#ivig-tool b {
  font-weight: 700;
}
#ivig-tool .ap-head {
  background: var(--ap-grad);
  color: #fff;
  padding: 20px 22px;
}
#ivig-tool .ap-head h2 {
  margin: 0;
  line-height: 1.25;
  font-size: 26px;
  color: #fff;
  border: none;
  padding: 0;
}
#ivig-tool .ap-head p {
  margin: 0.3em 0 0;
  font-size: 18px;
  color: #fff;
  opacity: 0.92;
}
#ivig-tool .ap-tabs {
  display: flex;
  border-bottom: 1px solid var(--ap-line);
  background: var(--ap-ghost);
}
#ivig-tool .ap-tab {
  flex: 1;
  padding: 14px 10px;
  border: none;
  background: none;
  font-size: 19px;
  font-weight: 600;
  color: var(--ap-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition:
 color 0.16s ease,
 border-color 0.16s ease,
 background-color 0.16s ease;
}
#ivig-tool .ap-tab:hover {
  color: var(--ap-accent-strong);
}
#ivig-tool .ap-tab[aria-selected="true"] {
  color: var(--ap-accent-strong);
  border-bottom-color: var(--ap-accent);
  background: #fff;
}
#ivig-tool .ap-body {
  padding: 20px 22px;
}
#ivig-tool .ap-panel {
  display: none;
}
#ivig-tool .ap-panel.active {
  display: block;
}

/* Guided path */
#ivig-tool .ap-q {
  margin-bottom: 18px;
}
#ivig-tool .ap-q h3 {
  margin: 0 0 10px;
  font-size: 21px;
  color: var(--ap-primary);
}
#ivig-tool .ap-progress {
  font-size: 16px;
  color: var(--ap-muted);
  margin-bottom: 14px;
}
#ivig-tool .ap-opts {
  display: grid;
  gap: 10px;
}
#ivig-tool .ap-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--ap-line);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition:
 border-color 0.16s cubic-bezier(0.22, 1, 0.36, 1),
 background-color 0.16s cubic-bezier(0.22, 1, 0.36, 1),
 box-shadow 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  background: #fff;
}
#ivig-tool .ap-opt:hover {
  border-color: var(--ap-accent);
  background: var(--ap-accent-soft);
}
#ivig-tool .ap-opt.sel {
  border-color: var(--ap-accent);
  background: var(--ap-accent-soft);
  box-shadow: inset 0 0 0 1px var(--ap-accent);
}
#ivig-tool .ap-opt input {
  margin: 2px 0 0;
  flex: 0 0 auto;
}
#ivig-tool .ap-opt .txt {
  display: flex;
  flex-direction: column;
}
#ivig-tool .ap-opt .lbl {
  display: block;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
}
#ivig-tool .ap-opt .sub {
  display: block;
  font-size: 16.5px;
  color: var(--ap-muted);
  margin-top: 4px;
  line-height: 1.45;
}
#ivig-tool .ap-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
#ivig-tool button.ap-btn {
  background: var(--ap-accent-strong);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  transition:
 filter 0.16s cubic-bezier(0.22, 1, 0.36, 1),
 transform 0.1s ease,
 background-color 0.16s ease;
}
#ivig-tool button.ap-btn:hover {
  filter: brightness(0.94);
}
#ivig-tool button.ap-btn:active {
  transform: translateY(1px);
}
#ivig-tool button.ap-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
#ivig-tool button.ap-btn.secondary {
  background: #fff;
  color: var(--ap-accent-strong);
  border: 1px solid var(--ap-accent-strong);
}
#ivig-tool button.ap-btn.secondary:hover {
  background: var(--ap-accent-soft);
  filter: none;
}

/* Filters */
#ivig-tool .ap-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
}
#ivig-tool .ap-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#ivig-tool .ap-filter label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ap-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
#ivig-tool .ap-filter select,
#ivig-tool .ap-filter input[type="text"] {
  border: 1px solid var(--ap-line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 18px;
  background: #fff;
  min-width: 140px;
}
#ivig-tool .ap-checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
#ivig-tool .ap-checks label {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
#ivig-tool .ap-count {
  font-size: 16.5px;
  color: var(--ap-muted);
  margin-bottom: 10px;
}
#ivig-tool .ap-reset {
  background: none;
  border: none;
  color: var(--ap-accent-strong);
  font-size: 16.5px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 2px;
}

/* Matrix table */
#ivig-tool .ap-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ap-line);
  border-radius: 10px;
}
#ivig-tool table {
  border-collapse: collapse;
  width: 100%;
  font-size: 17px;
  min-width: 1000px;
}
#ivig-tool th,
#ivig-tool td {
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--ap-line);
  vertical-align: top;
  line-height: 1.45;
}
#ivig-tool thead th {
  background: var(--ap-ghost);
  color: var(--ap-primary);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  padding: 0;
}
#ivig-tool thead th:last-child {
  padding: 12px 14px;
}
#ivig-tool tbody tr:hover {
  background: var(--ap-ghost);
}
#ivig-tool td .brand {
  font-weight: 700;
  color: var(--ap-primary);
}
#ivig-tool td .mfr {
  font-size: 15.5px;
  color: var(--ap-muted);
}
#ivig-tool .tag {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.4;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--ap-accent-soft);
  color: #0b6e9c;
  margin: 2px 3px 0 0;
  white-space: nowrap;
}
#ivig-tool .pill-ok {
  color: var(--ap-ok);
  font-weight: 600;
}
#ivig-tool .pill-warn {
  color: var(--ap-warn);
  font-weight: 600;
}
#ivig-tool td a.lnk {
  font-size: 16px;
  color: var(--ap-accent-strong);
  display: block;
  white-space: nowrap;
  margin-bottom: 6px;
  padding: 2px 0;
}
#ivig-tool td a.lnk.copaybtn {
  display: inline-block;
  background: var(--ap-grad);
  color: #fff;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  text-decoration: none;
  margin-bottom: 6px;
}
#ivig-tool td a.lnk.copaybtn:hover {
  filter: brightness(0.94);
}

/* Result cards (guided path output) */
#ivig-tool .ap-results {
  margin-top: 8px;
}
#ivig-tool .ap-card {
  border: 1px solid var(--ap-line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
#ivig-tool .ap-card h4 {
  margin: 0 0 4px;
  color: var(--ap-primary);
  font-size: 21px;
}
#ivig-tool .ap-card .why {
  font-size: 17px;
  color: var(--ap-muted);
  margin: 6px 0 0;
}
#ivig-tool .ap-card .specs {
  font-size: 16.5px;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}
#ivig-tool .ap-card .specs b {
  color: #33404f;
}
#ivig-tool .ap-card .links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
#ivig-tool .ap-card .links a {
  font-size: 16.5px;
  text-decoration: none;
  border: 1px solid var(--ap-line);
  border-radius: 22px;
  padding: 8px 16px;
  color: var(--ap-accent-strong);
  background: #fff;
}
#ivig-tool .ap-card .links a.copay {
  background: var(--ap-grad);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  padding: 10px 20px;
  box-shadow: 0 1px 3px rgba(16, 46, 97, 0.2);
}
#ivig-tool .ap-card .links a.copay:hover {
  filter: brightness(0.94);
}
#ivig-tool .ap-card .links a.secondary {
  color: var(--ap-muted);
}

/* Email gate (PLACEHOLDER) */
#ivig-tool .ap-gate {
  border: 2px dashed var(--ap-accent);
  background: var(--ap-accent-soft);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
#ivig-tool .ap-gate h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--ap-primary);
}
#ivig-tool .ap-gate p {
  font-size: 17.5px;
  color: #33404f;
  margin: 0.3em 0;
}
#ivig-tool .ap-gate .ac-slot {
  margin: 14px auto;
  max-width: 360px;
}
#ivig-tool .ap-gate input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--ap-line);
  border-radius: 8px;
  font-size: 19px;
  margin-bottom: 8px;
  min-width: 0;
  background: #fff;
}
#ivig-tool .ap-gate .placeholder-flag {
  font-size: 14.5px;
  color: var(--ap-warn);
  background: #fff;
  border: 1px dashed var(--ap-warn);
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 12px;
  display: inline-block;
}
#ivig-tool .ap-skip {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: var(--ap-muted);
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
}

#ivig-tool .ap-disclaimer {
  font-size: 15.5px;
  color: var(--ap-muted);
  background: var(--ap-ghost);
  border-top: 1px solid var(--ap-line);
  padding: 14px 22px;
  line-height: 1.5;
}
#ivig-tool .ap-disclaimer strong {
  color: #33404f;
}
#ivig-tool .ap-sources {
  font-size: 15px;
  color: var(--ap-muted);
  background: var(--ap-ghost);
  padding: 14px 22px 0;
  line-height: 1.5;
}
#ivig-tool .ap-sources a {
  color: var(--ap-accent-strong);
}
#ivig-tool .ap-empty {
  padding: 20px;
  text-align: center;
  color: var(--ap-muted);
  font-size: 18px;
}

/* Accessibility: visible focus, sort buttons, screen-reader-only text */
#ivig-tool button:focus-visible,
#ivig-tool select:focus-visible,
#ivig-tool input:focus-visible,
#ivig-tool [role="tab"]:focus-visible,
#ivig-tool a:focus-visible {
  outline: 2px solid var(--ap-accent-strong);
  outline-offset: 2px;
  border-radius: 4px;
}
#ivig-tool .ap-opt:focus-within {
  border-color: var(--ap-accent);
  box-shadow: 0 0 0 2px var(--ap-accent);
}
#ivig-tool #ap-q-heading:focus {
  outline: none;
}
#ivig-tool thead th button.ap-sort {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  background: none;
  border: none;
  padding: 12px 14px;
  margin: 0;
  font: inherit;
  border-radius: 0;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
#ivig-tool thead th .arrow {
  opacity: 0.55;
  font-size: 14px;
}
#ivig-tool .ap-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  #ivig-tool *,
  #ivig-tool *::before,
  #ivig-tool *::after {
 transition-duration: 0.01ms !important;
 animation-duration: 0.01ms !important;
  }
}
@media (max-width: 560px) {
  #ivig-tool .ap-card .specs {
 grid-template-columns: 1fr;
  }
  #ivig-tool .ap-head h2 {
 font-size: 22px;
  }
  #ivig-tool .ap-body {
 padding: 16px;
  }
}
