/* PVV v5 — Caregiver mode + care package styles. Minimal, no framework. */

.pvv-caregiver-toggle {
  /* Keep vertical footprint small — this is a top-of-article toggle
     that must not push content below the fold. */
  margin: 0.75rem 0 1.25rem;
  padding: 0;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.pvv-care-card {
  border: 1px solid #dbeafe;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #f8fafc;
}
.pvv-care-head {
  margin: 0 0 0.6rem;
}
.pvv-care-title {
  /* Plain heading — no fieldset/legend semantics, no browser quirks. */
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}
.pvv-care-intro {
  margin: 0;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.45;
}
.pvv-care-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
  margin: 0;
}
.pvv-care-option {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  position: relative;
}
.pvv-care-option:hover { border-color: #60a5fa; }
.pvv-care-option.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}
/* Hide the native radio — the whole label is the hit-target + visual
   state carrier. Still focusable via keyboard (tab to the input) and
   still announced by screen readers because the radio stays in DOM. */
.pvv-care-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.pvv-care-option input:focus-visible + .pvv-care-option-title {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 3px;
}
.pvv-care-option-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.92rem;
}
.pvv-care-option-desc {
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Legacy selectors kept so in-flight renders don't break if the CSS
   loads before the refreshed JS. Aliased to the new card styles. */
.pvv-care-fieldset {
  border: 1px solid #dbeafe;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  display: block;
}
.pvv-care-legend {
  display: block;
  width: 100%;
  float: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  border: 0;
}
.pvv-care-privacy {
  margin: 0.5rem 0 0;
  color: #64748b;
  font-size: 0.8rem;
}

.pvv-care-banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #78350f;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.93rem;
}
.pvv-care-banner-icon { font-size: 1.15rem; }
.pvv-care-banner-switch {
  background: transparent;
  border: 1px solid #b45309;
  color: #78350f;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 0.5rem;
  font: inherit;
}
.pvv-care-banner-switch:hover { background: #b45309; color: #fffbeb; }

.pvv-care-package-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pvv-care-package-btn:hover { background: #115e59; }

/* ── Modal ──────────────────────────────────────────────────────────── */

.pvv-care-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem 1rem;
  z-index: 9999;
  overflow-y: auto;
}
.pvv-care-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  color: #0f172a;
  font: 15px/1.45 system-ui, sans-serif;
}
.pvv-care-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.pvv-care-modal-header h2 { margin: 0; font-size: 1.2rem; }
.pvv-care-modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}
.pvv-care-modal-close:hover { color: #0f172a; }
.pvv-care-modal-body { padding: 1.1rem 1.25rem 1.25rem; }
.pvv-care-modal-intro { margin-top: 0; color: #475569; }
.pvv-care-action { margin: 1rem 0; }
.pvv-care-action h3 {
  font-size: 0.98rem;
  margin: 0 0 0.25rem;
  color: #1e293b;
}
.pvv-care-action p { margin: 0 0 0.5rem; color: #475569; font-size: 0.9rem; }
.pvv-care-btn {
  display: inline-block;
  background: #1e40af;
  color: #fff;
  border: none;
  padding: 0.45rem 0.95rem;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.pvv-care-btn:hover { background: #1e3a8a; }
.pvv-care-btn-link { display: inline-block; }
.pvv-care-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.pvv-care-link {
  flex: 1;
  padding: 0.4rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font: inherit;
  background: #f8fafc;
}
.pvv-care-disclaimer {
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.82rem;
  font-style: italic;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .pvv-care-card,
  .pvv-care-fieldset { background: #1e293b; border-color: #334155; border-left-color: #3b82f6; }
  .pvv-care-title,
  .pvv-care-legend,
  .pvv-care-option-title { color: #f1f5f9; }
  .pvv-care-intro { color: #cbd5e1; }
  .pvv-care-legend { border-bottom-color: rgba(148, 163, 184, 0.3); }
  .pvv-care-option { background: #0f172a; border-color: #334155; }
  .pvv-care-option.is-active { background: #172554; border-color: #3b82f6; }
  .pvv-care-option-desc { color: #94a3b8; }
  .pvv-care-privacy, .pvv-care-modal-intro, .pvv-care-disclaimer { color: #94a3b8; }
  .pvv-care-banner { background: #422006; border-color: #92400e; color: #fef3c7; }
  .pvv-care-modal { background: #1e293b; color: #e2e8f0; }
  .pvv-care-modal-header { border-color: #334155; }
  .pvv-care-action h3 { color: #f1f5f9; }
  .pvv-care-action p { color: #cbd5e1; }
  .pvv-care-link { background: #0f172a; border-color: #334155; color: #e2e8f0; }
}

/* Print */
@media print {
  .pvv-caregiver-toggle,
  .pvv-care-banner,
  .pvv-care-package-btn,
  .pvv-care-modal-backdrop { display: none !important; }
}
