/*
 * Plugin Name: Pflegegrad-Rechner SBH
 * Plugin URI:  https://haushaltshilfe-sbh.de
 * License:     GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 *
 * CHANGELOG:
 *   v1.1.0 – Optimierungen für barrierefreie Lesbarkeit (ältere Nutzer)
 *     - Alle Schriftgrößen auf relative em-Einheiten umgestellt.
 *       Das Plugin erbt nun automatisch die Basisschrift des aktiven WordPress-
 *       Themes. Es wird keine eigene px-Grundgröße gesetzt.
 *     - Minimale Lesegrößen angehoben: Fließtext ≥ 1.0625em (~17 px),
 *       Fragen 1.125em (~18 px), Optionen 1em, Navigation 1em.
 *     - Zeilenhöhen (line-height) vergrößert für bessere Lesbarkeit.
 *     - Kontraste überprüft und verstärkt (WCAG AA-konform).
 *     - Google Fonts vollständig entfernt → keine externen HTTP-Anfragen,
 *       100 % DSGVO-konform, 100 % GPL-konform.
 *     - Systemschriften-Stack wird genutzt; Schriftbild richtet sich nach
 *       dem Browser und Betriebssystem des Nutzers.
 *
 * GPL-Konformität:
 *   Sämtliche Ressourcen dieser Datei sind GPL-kompatibel.
 *   Es werden ausschließlich systemseitige Schriften eingesetzt.
 *   Keine externen Font-Dienste, keine Drittbibliotheken.
 *
 * Entwicklung:
 *   Toni Bernd Schlack
 *   Auf der Lehr 4, 78056 Villingen-Schwenningen
 *   https://tonischlack.de
 *
 * (C) haushaltshilfe-sbh.de – Lizenz: GPL v2 or later
 *
 * SCHRIFT-STRATEGIE:
 *   font-size wird NIE absolut (px) gesetzt, ausschließlich in em.
 *   Der Wrapper setzt keine eigene Basisgröße, sodass das Theme-Setting
 *   des Administrators vollständig vererbt wird. Nutzer, die im Browser
 *   eine größere Standardschrift eingestellt haben (z. B. ältere Personen
 *   mit 20 px Basis), erhalten automatisch proportional größere Texte.
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────
   Keine font-size-Angabe! Das Plugin erbt die Basisgröße vollständig
   vom aktiven Theme → barrierefreie Skalierung ohne Eingriff.
   ──────────────────────────────────────────────────────────────────── */
.pgr-sbh-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue',
               Arial, Helvetica, sans-serif;
  color: #1E293B;
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  /* line-height als Basis für alle Kindelemente */
  line-height: 1.6;
}

.pgr-sbh-wrapper * {
  box-sizing: border-box;
}

/* ── Karte ──────────────────────────────────────────────────────────── */
.pgr-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 80, 100, 0.10);
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.pgr-header {
  background: linear-gradient(135deg, #0B5F6D 0%, #0E8A9B 100%);
  padding: 2em 2.2em 1.6em;
  color: #fff;
}

.pgr-header h2 {
  /* Überschrift erbt das Theme – nur relative Vergrößerung */
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.75em;       /* ~28 px bei 16 px Basis, ~35 px bei 20 px Basis */
  margin: 0 0 0.3em;
  color: #fff !important;
  font-weight: 700;
  border: none !important;
  line-height: 1.25;
}

.pgr-header p {
  margin: 0;
  font-size: 1em;           /* immer so groß wie Theme-Basis – nie kleiner */
  opacity: 0.88;
  line-height: 1.5;
}

.pgr-progress-wrap {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  height: 6px;
  margin-top: 1.2em;
  overflow: hidden;
}

.pgr-progress-bar {
  height: 100%;
  background: #7EEAF5;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.pgr-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45em;
  font-size: 0.875em;       /* mindestens lesbar, da Basis bereits vererbt */
  opacity: 0.82;
}

/* ── DSGVO-Banner ────────────────────────────────────────────────────── */
.pgr-dsgvo-banner {
  background: #e0f7fa;
  border: 1px solid #b2ebf2;
  border-radius: 8px;
  padding: 0.9em 1.1em;
  font-size: 1em;           /* = Theme-Basisgröße – gut lesbar */
  color: #006064;
  line-height: 1.65;
  margin-bottom: 1.5em;
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
}

.pgr-dsgvo-banner strong {
  display: block;
  margin-bottom: 0.15em;
  font-size: 1.05em;        /* leicht hervorgehoben */
}

/* ── Body ────────────────────────────────────────────────────────────── */
.pgr-body {
  padding: 1.8em 2.2em 2.2em;
}

/* ── Intro ───────────────────────────────────────────────────────────── */
.pgr-intro {
  text-align: center;
  padding: 2.5em 2.2em;
}

.pgr-intro-icon {
  font-size: 3em;
  margin-bottom: 0.5em;
  line-height: 1;
}

.pgr-intro h3 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.6em;
  color: #0B5F6D;
  margin: 0 0 0.75em;
  line-height: 1.3;
}

.pgr-intro p {
  color: #475569;           /* etwas dunkler als zuvor → besserer Kontrast */
  max-width: 480px;
  margin: 0 auto 1em;
  line-height: 1.75;
  font-size: 1.0625em;      /* ~17 px bei 16 px Basis – Mindestgröße für Senioren */
}

.pgr-meta {
  color: #64748B;
  font-size: 0.9375em;
  margin-bottom: 1.8em;
  line-height: 1.5;
}

/* ── Modulkopf ───────────────────────────────────────────────────────── */
.pgr-module-title {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.375em;       /* ~22 px bei 16 px Basis */
  color: #0B5F6D;
  margin: 0 0 0.3em;
  line-height: 1.3;
}

.pgr-module-desc {
  font-size: 1em;           /* = Basisgröße */
  color: #475569;
  margin: 0 0 1.4em;
  line-height: 1.65;
}

/* ── Fragen ──────────────────────────────────────────────────────────── */
.pgr-question {
  margin-bottom: 1.25em;
  padding: 1em 1.2em;
  background: #F8FAFC;
  border-radius: 12px;
  border-left: 3px solid #0E8A9B;
}

.pgr-question-text {
  /* Fragentext: deutlich über Mindestgröße für ältere Nutzer */
  font-size: 1.125em;       /* ~18 px bei 16 px Basis */
  font-weight: 600;
  margin-bottom: 0.75em;
  color: #1E293B;
  line-height: 1.5;
}

.pgr-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5em;
}

@media (max-width: 520px) {
  .pgr-options {
    grid-template-columns: 1fr;
  }
  .pgr-body,
  .pgr-intro {
    padding-left: 1.1em;
    padding-right: 1.1em;
  }
  .pgr-header {
    padding-left: 1.1em;
    padding-right: 1.1em;
  }
}

.pgr-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  padding: 0.6em 0.8em;
  background: #fff;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  cursor: pointer;
  /* Optionstext ≥ Basisgröße – barrierefreiheitsgerecht */
  font-size: 1em;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  font-family: inherit;
  color: #1E293B;
  width: 100%;
  min-height: 2.75em;       /* Touch-Target mindestens 44 px → WCAG 2.5.5 */
}

.pgr-option:hover {
  border-color: #0E8A9B;
  background: #F0FDFF;
}

.pgr-option.pgr-selected {
  border-color: #0B5F6D;
  background: #E0F7FA;
  font-weight: 600;
  color: #0B5F6D;
}

.pgr-option input[type="radio"] {
  accent-color: #0B5F6D;
  margin-top: 0.2em;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}

/* ── Navigation ──────────────────────────────────────────────────────── */
.pgr-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.6em;
  padding-top: 1.3em;
  border-top: 1px solid #E2E8F0;
  flex-wrap: wrap;
  gap: 0.75em;
}

.pgr-btn {
  padding: 0.65em 1.8em;
  border-radius: 99px;
  font-family: inherit;
  font-size: 1em;           /* = Theme-Basis */
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
  min-height: 2.75em;       /* barrierefreies Touch-Target */
}

.pgr-btn-back {
  background: transparent;
  color: #475569;
  border: 1.5px solid #CBD5E1 !important;
  padding: 0.6em 1.4em;
}

.pgr-btn-back:hover {
  background: #F1F5F9;
  border-color: #94A3B8 !important;
}

.pgr-btn-next {
  background: linear-gradient(135deg, #0B5F6D, #0E8A9B);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11, 95, 109, 0.25);
}

.pgr-btn-next:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 95, 109, 0.3);
}

.pgr-btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.pgr-step-count {
  font-size: 0.9375em;
  color: #64748B;
  font-weight: 500;
}

/* ── Ergebnis ────────────────────────────────────────────────────────── */
.pgr-result {
  padding: 2.5em 2.2em;
  text-align: center;
}

.pgr-result-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 8.5em;
  height: 8.5em;
  border-radius: 50%;
  margin: 0 auto 1.3em;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  color: #fff;
}

.pgr-badge-label {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.pgr-badge-num {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 3.5em;
  font-weight: 700;
  line-height: 1.05;
}

.pgr-result h3 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.6em;
  margin: 0 0 0.4em;
  color: #1E293B;
  line-height: 1.3;
}

.pgr-result-subtitle {
  color: #475569;
  font-size: 1.0625em;      /* ~17 px – gut lesbar für Senioren */
  margin: 0 0 1.5em;
  line-height: 1.6;
}

/* ── Pflegegrad-Skala ────────────────────────────────────────────────── */
.pgr-scale {
  display: flex;
  gap: 0.375em;
  margin: 1.2em 0;
  justify-content: center;
}

.pgr-scale-dot {
  width: 2.25em;
  height: 2.25em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375em;
  transition: transform 0.2s;
  color: #fff;
}

.pgr-scale-dot.pgr-active {
  transform: scale(1.28);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ── Gesamtpunktzahl ─────────────────────────────────────────────────── */
.pgr-total-box {
  background: #F0FDFF;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  padding: 0.8em 1.1em;
  margin-bottom: 1.4em;
  font-size: 1em;
  color: #0369A1;
  line-height: 1.6;
  text-align: left;
}

.pgr-total-box strong {
  font-size: 1.0625em;
}

/* ── Modul-Aufschlüsselung ───────────────────────────────────────────── */
.pgr-breakdown-label {
  text-align: left;
  font-size: 0.8125em;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5em;
}

.pgr-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65em;
  margin-bottom: 1.5em;
  text-align: left;
}

@media (max-width: 480px) {
  .pgr-breakdown-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pgr-breakdown-item {
  background: #F8FAFC;
  border-radius: 10px;
  padding: 0.75em 0.9em;
  border: 1px solid #E2E8F0;
}

.pgr-breakdown-name {
  font-size: 0.8125em;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.pgr-breakdown-score {
  font-size: 1.375em;       /* Ergebniswerte gut sichtbar */
  font-weight: 700;
  color: #0B5F6D;
  font-family: Georgia, 'Times New Roman', Times, serif;
  line-height: 1.2;
}

.pgr-breakdown-max {
  font-size: 0.8125em;
  color: #CBD5E1;
  line-height: 1.4;
}

.pgr-breakdown-bar-bg {
  margin-top: 0.35em;
  height: 4px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
}

.pgr-breakdown-bar-fill {
  height: 100%;
  background: #0B5F6D;
  border-radius: 99px;
}

/* ── Disclaimer ──────────────────────────────────────────────────────── */
.pgr-disclaimer {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 1em 1.2em;
  font-size: 1em;           /* = Basisgröße, gut lesbar */
  color: #92400E;
  text-align: left;
  line-height: 1.7;
}

.pgr-disclaimer strong {
  display: block;
  margin-bottom: 0.25em;
  font-size: 1.0625em;
}

/* ── Footer-Credit ───────────────────────────────────────────────────── */
.pgr-footer-credit {
  margin-top: 1.3em;
  padding-top: 1em;
  border-top: 1px solid #E2E8F0;
  font-size: 0.9375em;      /* etwas kleiner, aber noch gut lesbar */
  color: #64748B;
  text-align: center;
  line-height: 1.6;
}

.pgr-footer-credit a {
  color: #0B5F6D;
  text-decoration: none;
  font-weight: 600;
}

.pgr-footer-credit a:hover {
  text-decoration: underline;
}

/* ── Reset-Button ────────────────────────────────────────────────────── */
.pgr-btn-reset {
  margin-top: 1.2em;
  padding: 0.55em 1.5em;
  background: transparent;
  border: 1.5px solid #0B5F6D;
  color: #0B5F6D;
  border-radius: 99px;
  font-family: inherit;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 2.75em;
}

.pgr-btn-reset:hover {
  background: #E0F7FA;
}
