/*
 * Wutwunder Matrix Pro — Styles.
 * Fonts are self-hosted (see ../fonts/) so no request ever goes to
 * fonts.googleapis.com or fonts.gstatic.com at runtime (DSGVO).
 *
 * Colours and the button corner radius are NOT hard-coded here: they
 * come from CSS custom properties (--wmp-accent, --wmp-primary,
 * --wmp-bg, --wmp-text, --wmp-radius) set per quiz instance on its own
 * #wmp-root-{quizId} id by a small per-request inline stylesheet built
 * from that quiz's own settings (see WMP_Shortcode::build_dynamic_css()),
 * so two quizzes on the same page can each have their own palette. The
 * values below on .wmp-quiz-root are fallbacks only, used if that inline
 * stylesheet is ever missing.
 */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
}

.wmp-quiz-root, .wmp-quiz-root * { box-sizing: border-box; }
.wmp-quiz-root {
  --wmp-accent: #C87941;
  --wmp-primary: #3D7A78;
  --wmp-bg: #F7F3EE;
  --wmp-text: #1C2D3C;
  --wmp-radius: 8px;
  /* Derived, not independently configurable in Phase 1. */
  --wmp-primary-pale: color-mix(in srgb, var(--wmp-primary) 25%, #fff);
  --wmp-bg-deep: color-mix(in srgb, var(--wmp-bg) 85%, #000);
  --wmp-text-muted: color-mix(in srgb, var(--wmp-text) 65%, #fff);
  --wmp-text-faint: color-mix(in srgb, var(--wmp-text) 45%, #fff);
  --wmp-accent-pale: color-mix(in srgb, var(--wmp-accent) 8%, #fff);

  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--wmp-text);
  max-width: 640px;
  margin: 0 auto;
  padding: 8px;
}
.wmp-quiz-root h1, .wmp-quiz-root h2, .wmp-quiz-root h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--wmp-text);
}
.wmp-quiz-root p { margin: 0 0 16px; line-height: 1.65; color: var(--wmp-text-muted); }
.wmp-card {
  background: var(--wmp-bg);
  border: 1px solid var(--wmp-bg-deep);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(28,45,60,0.08);
}
.wmp-card-inner { padding: 32px 28px 28px; }
@media (max-width: 480px) {
  .wmp-card-inner { padding: 24px 18px 22px; }
}
.wmp-screen { display: none; }
.wmp-screen.active { display: block; animation: wmpFadeIn .35s ease; }
@keyframes wmpFadeIn { from { opacity:0; transform:translateY(6px);} to {opacity:1; transform:translateY(0);} }

/* Intro */
.wmp-eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wmp-primary);
  font-weight: 700;
  margin-bottom: 10px;
}
.wmp-meta { font-size: 14px; color: var(--wmp-text-faint); margin-bottom: 24px; }

.wmp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wmp-accent);
  color: #fff;
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: var(--wmp-radius);
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
  text-decoration: none;
}
.wmp-btn:hover { filter: brightness(0.9); }
.wmp-btn:active { transform: scale(0.98); }
.wmp-btn.block { width: 100%; justify-content: center; }
.wmp-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Question header */
.wmp-qhead {
  margin: -32px -28px 22px;
  padding: 20px 28px 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color .3s ease;
}
@media (max-width: 480px) {
  .wmp-qhead { margin: -24px -18px 18px; padding: 16px 18px 14px; }
}
.wmp-back {
  background: rgba(255,255,255,.22);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex: none;
}
.wmp-back:hover { background: rgba(255,255,255,.35); }
.wmp-qhead h2 { color: #fff; margin: 0; font-size: 21px; flex: 1; }
.wmp-progress { font-size: 12px; color: var(--wmp-text-faint); margin-bottom: 6px; letter-spacing: .03em; }
.wmp-statement {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-style: italic;
  color: var(--wmp-text);
  border-left: 3px solid var(--wmp-primary);
  padding-left: 14px;
  margin-bottom: 20px;
}
.wmp-scale-label {
  display:flex;
  justify-content:space-between;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size:12.5px;
  color:var(--wmp-text-faint);
  margin-top:6px;
}
.wmp-scale-label strong { color: var(--wmp-primary); }
.wmp-scale-label span:last-child { text-align: right; }
.wmp-scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.wmp-scale button {
  aspect-ratio: 1;
  border-radius: var(--wmp-radius);
  border: 1.5px solid var(--wmp-bg-deep);
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--wmp-text);
  cursor: pointer;
  transition: all .15s ease;
}
/* Wrap to two rows of five on narrow phones - a single row of 10 needs
   roughly 640px of min-content width (each button's own minimum size,
   summed), which a flex/grid ancestor outside our control (e.g. an
   Elementor container) can end up honouring literally instead of
   shrinking it, pushing buttons off-screen. Two rows of five roughly
   halves that minimum. The labels below spell out "1 = ..." / "10 = ..."
   in words, so which end is which no longer depends on button 10 lining
   up under the right-hand label. */
@media (max-width: 480px) {
  .wmp-scale { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .wmp-scale-label { font-size: 13px; font-weight: 600; }
}
.wmp-scale button:hover { border-color: var(--wmp-primary); background: var(--wmp-primary-pale); }
.wmp-scale button.selected { background: var(--cat-color, var(--wmp-primary)); border-color: var(--cat-color, var(--wmp-primary)); color: #fff; }

/* Visualisation wrapper — hosts either the SVG wheel or the bar list. */
.wmp-visual-wrap { margin-top: 26px; }
.wmp-visual-wrap.wmp-wheel { text-align: center; }
.wmp-visual-wrap svg { width: 100%; height: auto; max-width: 460px; }

/* Bars visualisation (alternative to the wheel) */
.wmp-bars { display: flex; flex-direction: column; gap: 10px; }
.wmp-bar-row { display: flex; align-items: center; gap: 10px; }
.wmp-bar-label {
  width: 120px;
  flex: none;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--wmp-text);
  text-align: right;
}
.wmp-bar-track {
  flex: 1;
  height: 14px;
  background: var(--wmp-bg-deep);
  border-radius: 999px;
  overflow: hidden;
}
.wmp-bar-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.wmp-bar-score {
  width: 34px;
  flex: none;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 12.5px;
  color: var(--wmp-text-faint);
}

/* Legend / table */
.wmp-legend { margin-top: 18px; border-top: 1px solid var(--wmp-bg-deep); padding-top: 14px; }
.wmp-legend-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 14.5px; color: var(--wmp-text);
  border-bottom: 1px dashed var(--wmp-bg-deep);
}
.wmp-legend-row:last-child { border-bottom: none; }
.wmp-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.wmp-legend-name { flex: 1; }
.wmp-legend-score { font-weight: 700; color: var(--wmp-primary); }

/* Übergang zum eigenen Formular-Bereich */
.wmp-transition-arrow {
  text-align: center;
  font-size: 30px;
  color: var(--wmp-primary);
  margin-top: 6px;
  animation: wmpBounce 1.4s ease-in-out infinite;
}
@keyframes wmpBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* Formular-Bereich: rendert den per Einstellungen hinterlegten Formular-
   Shortcode (z. B. ein Elementor-Vorlagen-Shortcode). Dieser Wrapper wird
   ausschließlich von diesem Plugin selbst erzeugt und referenziert -
   nichts anderes auf der Seite zielt auf seine ID, daher kann fremdes CSS
   diese einfache display-Regel nicht überstimmen (kein "!important" nötig).
   Standardmäßig unsichtbar, wird per JS eingeblendet, sobald die letzte
   Frage beantwortet wurde. */
.wmp-gate-section { display: none; }
.wmp-gate-section.wmp-visible { display: block; animation: wmpFadeIn .35s ease; margin-top: 8px; }

/* Result */
.wmp-result-greeting { font-size: 15px; color: var(--wmp-primary); font-weight: 700; margin-bottom: 4px; }
.wmp-confirm-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--wmp-accent-pale);
  border-left: 3px solid var(--wmp-accent);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0 18px;
  text-align: left;
}
.wmp-confirm-note p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--wmp-text); }
.wmp-confirm-icon { font-size: 18px; line-height: 1.3; color: var(--wmp-accent); flex-shrink: 0; }
@media (max-width: 480px) {
  .wmp-confirm-note { padding: 10px 12px; }
  .wmp-confirm-note p { font-size: 14px; }
}
.wmp-reflection {
  background: var(--wmp-bg-deep);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
}
.wmp-reflection h3 { font-size: 16px; margin-bottom: 8px; margin-top: 18px; }
.wmp-reflection h3:first-child { margin-top: 0; }
.wmp-reflection p:last-child { margin-bottom: 0; }
.wmp-module-hint {
  background: var(--wmp-primary);
  color: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  margin: 18px 0 0;
  text-align: center;
  /* Up to 3 buttons can appear here (main + two optional extras) - stack
     them with a gap instead of letting inline-flex buttons run together. */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.wmp-quiz-root .wmp-module-hint p { color: rgba(255,255,255,0.92); margin-bottom: 0; }
.wmp-module-hint strong { color: #fff; }
.wmp-download-result {
  display: block;
  margin: 16px auto 0;
  padding: 10px 18px;
  background: none;
  border: 1.5px solid var(--wmp-bg-deep);
  border-radius: var(--wmp-radius);
  color: var(--wmp-text-faint);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s ease;
}
.wmp-download-result:hover { border-color: var(--wmp-primary); color: var(--wmp-primary); }
.wmp-download-result:disabled { opacity: .6; cursor: wait; }
.wmp-footer-note { font-size: 12px; color: var(--wmp-text-faint); text-align: center; margin-top: 18px; }
