/* ============================================================
   checker.css — Sofort-Check-Werkzeuge (sundpark.de)
   Kontrast-Checker (clientseitig) + Barriere-Erstcheck (check.php).
   Nutzt ausschließlich die Tokens aus styles.css. Wird NUR auf
   barrierefreiheits-check.html geladen.
   ============================================================ */

/* ---- Gemeinsame Karte (auf dunklem Grund) ---- */
.tool {
  background: var(--ink-3);
  border: 1px solid var(--line-dark);
  border-radius: var(--r-md);
  padding: clamp(22px, 3vw, 36px);
  box-shadow: var(--shadow-card);
}
.tool + .tool { margin-top: clamp(20px, 3vw, 32px); }
.tool__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.tool__head h3 {
  font-family: var(--serif); font-weight: 400; line-height: 1.1;
  font-size: clamp(1.35rem, 2.3vw, 1.9rem); color: var(--paper); margin: 0;
}
.tool__kicker { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--aqua); }
.tool__lead { color: var(--on-dark-muted); margin: 4px 0 22px; max-width: 60ch; }

/* ============================================================
   1 — KONTRAST-CHECKER
   ============================================================ */
.cc__controls {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  gap: clamp(14px, 2vw, 24px);
}
.cc__field { display: flex; flex-direction: column; gap: 9px; }
.cc__field > label { font-size: 0.82rem; letter-spacing: 0.06em; color: var(--on-dark-muted); }
.cc__color { display: flex; align-items: stretch; gap: 10px; }
.cc__color input[type="color"] {
  -webkit-appearance: none; appearance: none; border: 1px solid var(--line-dark);
  width: 52px; height: 48px; padding: 0; border-radius: var(--r-sm); background: none; cursor: pointer; flex: none;
}
.cc__color input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.cc__color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }
.cc__color input[type="color"]::-moz-color-swatch { border: none; border-radius: 3px; }
.cc__hex {
  flex: 1; min-width: 0; background: var(--ink); border: 1px solid var(--line-dark); color: var(--paper);
  font-family: var(--sans); font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0 14px; border-radius: var(--r-sm); min-height: 48px;
}
.cc__hex:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(63,199,194,0.18); }
.cc__swap {
  align-self: center; margin-bottom: 0; flex: none;
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-dark); border-radius: var(--r-pill); color: var(--on-dark-muted);
  transition: border-color 200ms var(--ease), color 200ms var(--ease), transform 320ms var(--ease);
}
.cc__swap:hover { border-color: var(--aqua); color: var(--aqua); transform: rotate(180deg); }

.cc__preview {
  margin-top: 22px; border: 1px solid var(--line-dark); border-radius: var(--r-sm);
  padding: clamp(20px, 3vw, 30px); display: flex; flex-direction: column; gap: 10px;
  transition: background-color 160ms linear, color 160ms linear;
}
.cc__sample-lg { margin: 0; font-size: 1.6rem; font-weight: 500; line-height: 1.2; }
.cc__sample-sm { margin: 0; font-size: 1rem; line-height: 1.5; }

.cc__result { margin-top: 22px; display: grid; grid-template-columns: auto 1fr; gap: clamp(18px, 3vw, 32px); align-items: center; }
.cc__ratio {
  font-family: var(--serif); font-weight: 400; line-height: 1; color: var(--paper);
  font-size: clamp(2.6rem, 6vw, 3.8rem); white-space: nowrap;
}
.cc__ratio small { font-size: 0.34em; color: var(--on-dark-faint); letter-spacing: 0.1em; display: block; margin-top: 6px; font-family: var(--sans); text-transform: uppercase; }
.cc__checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cc__check {
  display: flex; align-items: center; gap: 9px; font-size: 0.88rem; color: var(--on-dark-muted);
  padding: 9px 12px; border: 1px solid var(--line-dark); border-radius: var(--r-sm);
}
.cc__check b { font-weight: 500; color: var(--paper); margin-right: auto; }
.cc__badge { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; padding: 2px 9px; border-radius: var(--r-pill); white-space: nowrap; }
.cc__badge--pass { background: rgba(63,199,194,0.16); color: var(--aqua); }
.cc__badge--fail { background: rgba(229,115,107,0.16); color: #F0A39C; }

/* ============================================================
   2 — BARRIERE-ERSTCHECK (URL)
   ============================================================ */
.uc__form { display: flex; gap: 12px; flex-wrap: wrap; }
.uc__input {
  flex: 1 1 280px; min-width: 0; background: var(--ink); border: 1px solid var(--line-dark); color: var(--paper);
  font-family: var(--sans); font-size: 1.05rem; padding: 0 16px; border-radius: var(--r-sm); min-height: 52px;
}
.uc__input::placeholder { color: var(--on-dark-faint); }
.uc__input:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(63,199,194,0.18); }
.uc__form .btn { flex: none; }
.uc__note { font-size: 0.82rem; color: var(--on-dark-faint); margin: 12px 0 0; }

.uc__out { margin-top: 0; }
.uc__out:empty { margin: 0; }

/* Lade-/Fehlerzustand */
.uc__status {
  margin-top: 24px; display: flex; align-items: center; gap: 12px;
  color: var(--on-dark-muted); font-size: 0.95rem;
}
.uc__spin {
  width: 20px; height: 20px; flex: none; border: 2px solid var(--line-dark); border-top-color: var(--aqua);
  border-radius: 50%; animation: uc-spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .uc__spin { animation: none; } }
@keyframes uc-spin { to { transform: rotate(360deg); } }
.uc__error { margin-top: 24px; padding: 16px 20px; border-radius: var(--r-sm);
  background: rgba(229,115,107,0.1); border: 1px solid rgba(229,115,107,0.4); color: #F0A39C; }

/* Ergebnis */
.uc__report { margin-top: 28px; }
.uc__score { display: flex; align-items: center; gap: clamp(16px, 3vw, 26px); flex-wrap: wrap; }
.uc__gauge {
  --p: 0; --c: var(--aqua); flex: none;
  width: 104px; height: 104px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-dark) 0);
  display: grid; place-items: center; position: relative;
}
.uc__gauge::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--ink-3); }
.uc__gauge span { position: relative; font-family: var(--serif); font-size: 1.9rem; color: var(--paper); }
.uc__verdict h4 { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 1.4rem; color: var(--paper); }
.uc__verdict p { margin: 0; color: var(--on-dark-muted); max-width: 48ch; font-size: 0.95rem; }
.uc__host { color: var(--aqua); word-break: break-all; }

.uc__tally { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 4px; }
.uc__tally-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--on-dark-muted);
  border: 1px solid var(--line-dark); border-radius: var(--r-pill); padding: 6px 14px; }
.uc__tally-item b { color: var(--paper); font-weight: 600; }
.uc__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.uc__dot--error { background: #E5736B; }
.uc__dot--warn  { background: var(--amber); }
.uc__dot--pass  { background: var(--aqua); }
.uc__dot--info  { background: var(--on-dark-faint); }

.uc__list { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--line-dark); }
.uc__finding { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start;
  padding: 16px 0; border-bottom: 1px solid var(--line-dark); }
.uc__finding .uc__dot { margin-top: 7px; }
.uc__finding h5 { margin: 0; font-size: 1rem; font-weight: 500; color: var(--paper); font-family: var(--sans); }
.uc__finding p { margin: 4px 0 0; grid-column: 2 / -1; font-size: 0.9rem; color: var(--on-dark-muted); max-width: 70ch; }
.uc__count { font-size: 0.82rem; color: var(--on-dark-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Funnel-Hinweis am Ende des Berichts */
.uc__cta {
  margin-top: 28px; padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(63,199,194,0.4); border-radius: var(--r-sm); background: rgba(63,199,194,0.07);
}
.uc__cta p { margin: 0 0 18px; color: var(--on-dark); max-width: 60ch; }
.uc__cta strong { color: var(--aqua); font-weight: 600; }

/* ============================================================
   3 — PAGESPEED-CHECK (Google PSI-API, kompakte Übersicht)
   ============================================================ */
.ps__toggle { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px;
  border: 1px solid var(--line-dark); border-radius: var(--r-pill); }
.ps__toggle button { background: transparent; color: var(--on-dark-muted); border: none;
  padding: 7px 18px; border-radius: var(--r-pill); font-size: 0.88rem; display: inline-flex; align-items: center; gap: 7px;
  transition: background 200ms var(--ease), color 200ms var(--ease); }
.ps__toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.ps__scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vw, 22px); }
.ps__score { display: flex; flex-direction: column; align-items: center; gap: 11px; text-align: center; }
.ps__ring { --p: 0; --c: var(--aqua); width: clamp(80px, 11vw, 104px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-dark) 0); display: grid; place-items: center; position: relative; }
.ps__ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--ink-3); }
.ps__ring span { position: relative; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); color: var(--paper); }
.ps__ring span small { font-size: 0.55em; color: var(--on-dark-faint); }
.ps__score b { font-weight: 500; color: var(--paper); font-size: 0.9rem; }

.ps__metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 26px; }
.ps__metric { border: 1px solid var(--line-dark); border-radius: var(--r-sm); padding: 13px 15px; }
.ps__mlabel { font-size: 0.78rem; color: var(--on-dark-muted); display: flex; align-items: center; gap: 8px; }
.ps__mval { font-family: var(--serif); font-size: 1.45rem; color: var(--paper); margin-top: 5px; }
.ps__mdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ps__dot--good { background: var(--aqua); }
.ps__dot--avg  { background: var(--amber); }
.ps__dot--poor { background: #E5736B; }
.ps__legend { margin-top: 22px; font-size: 0.8rem; color: var(--on-dark-faint); display: flex; gap: 16px; flex-wrap: wrap; }
.ps__legend span { display: inline-flex; align-items: center; gap: 7px; }
.ps__src { margin-top: 18px; font-size: 0.78rem; color: var(--on-dark-faint); }
.ps__src a { color: var(--amber); }

/* ============================================================
   Responsiv
   ============================================================ */
@media (max-width: 560px) { .ps__scores { grid-template-columns: repeat(2, 1fr); row-gap: 22px; } }
@media (max-width: 620px) {
  .cc__controls { grid-template-columns: 1fr; }
  .cc__swap { justify-self: center; transform: rotate(90deg); }
  .cc__swap:hover { transform: rotate(270deg); }
  .cc__result { grid-template-columns: 1fr; text-align: left; }
  .uc__form .btn { width: 100%; justify-content: center; }
}
