/* ============================================================
   WM 2026 Tipprunde - Stylesheet
   Reines CSS, keinerlei HTML-Änderungen nötig
   Modern · Responsiv · Barrierefrei
   Farben: Himmelblau (#0ea5e9) + Hellgrün (#4ade80 / #16a34a)
   Schrift: Systemfont des Browsers
   ============================================================ */

/* ---- CSS-Variablen ------------------------------------------- */
:root {
  --sky:         #0ea5e9;
  --sky-dark:    #0369a1;
  --sky-mid:     #38bdf8;
  --sky-light:   #e0f2fe;
  --sky-xlight:  #f0f9ff;

  --green:       #4ade80;
  --green-dark:  #16a34a;
  --green-light: #dcfce7;

  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-md: 0 4px 16px rgba(14,165,233,0.13), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(14,165,233,0.18), 0 2px 12px rgba(0,0,0,0.08);

  --transition: 0.18s ease;
}

/* -- Reset --------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

/* -- Seite --------------------------------------------------- */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
               sans-serif, "Apple Color Emoji";
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-800);
  background-color: #bfdbfe;
  /* Dezentes Raster als Hintergrundtextur */
  background-image:
    linear-gradient(rgba(14,165,233,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.12) 1px, transparent 1px);
  background-size: 36px 36px;
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* Fußzeile unter dem Formular */
body > hr {
  max-width: 860px;
  margin: 0.5rem auto;
  border: none;
  border-top: 1px solid rgba(14,165,233,0.3);
}

body > p {
  max-width: 860px;
  margin: 0.5rem auto 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--gray-500);
}

body > p a,
body > p a:link,
body > p a:visited {
  color: var(--sky-dark);
}

/* -- Formular-Container -------------------------------------- */
form {
  max-width: 860px;
  margin: 0 auto 2rem;
  padding: 2.5rem 2.5rem 2rem;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  /* Farbiger oberer Rand als Eyecatcher */
  border-top: 5px solid var(--sky);
  /* Margin vom Original zurücksetzen */
  margin-top: 0 !important;
}

/* -- Überschriften ------------------------------------------- */
form H1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--sky-dark);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

form H3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-600);
  margin: 0 0 1.25rem 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  line-height: 1.6;
}

form H4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sky-dark);
  background: var(--sky-light);
  border-left: 4px solid var(--sky);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.6rem 1rem;
  margin: 1.25rem 0;
  line-height: 1.5;
}

/* -- Trennlinien --------------------------------------------- */
form HR {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 1.75rem 0;
}

/* -- Fließtext ----------------------------------------------- */
form {
  font-size: 0.925rem;
  color: var(--gray-700);
}

/* -- Links --------------------------------------------------- */
form a,
form a:link,
form a:visited {
  color: var(--sky-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  border-radius: 3px;
  transition: background-color var(--transition), color var(--transition);
}

form a:hover,
form a:focus {
  color: var(--sky-dark);
  background-color: var(--sky-light);
  text-decoration: none;
  outline: none;
}

form a:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

/* -- Fett-Text allgemein ------------------------------------- */
form b,
form strong {
  font-weight: 600;
  color: var(--gray-700);
}

/* -- Frage-Anker (Q1-Q7, comment) --------------------------- */
/* Die <B><A name="Q..."> Konstrukte als Frage-Label stylen */
form b > a[name^="Q"],
form b > a[name="comment"] {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none !important;
  background: none !important;
  color: var(--gray-800) !important;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: default;
}

/* Frage-Nummer als kleines Badge via ::before */
form b > a[name="Q1"]::before  { content: "Q1"; }
form b > a[name="Q2"]::before  { content: "Q2"; }
form b > a[name="Q3"]::before  { content: "Q3"; }
form b > a[name="Q4"]::before  { content: "Q4"; }
form b > a[name="Q5"]::before  { content: "Q5"; }
form b > a[name="Q6"]::before  { content: "Q6"; }
form b > a[name="Q7"]::before  { content: "Q7"; }
form b > a[name="comment"]::before { content: "Q7"; }

form b > a[name^="Q"]::before,
form b > a[name="comment"]::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  background: var(--sky-light);
  color: var(--sky-dark);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.6;
  flex-shrink: 0;
}

/* -- Eingabefelder - Basis ----------------------------------- */
form input[type="text"],
form select,
form textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--gray-800);
  background-color: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.65rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
  vertical-align: middle;
}

form input[type="text"]:hover,
form select:hover {
  border-color: var(--gray-300);
  background-color: #ffffff;
}

form input[type="text"]:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
  background-color: #ffffff;
}

/* -- Tipp-Felder: Spielergebnis (size="2") ------------------- */
form input[type="text"][size="2"] {
  width: 3rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sky-dark);
  background-color: var(--sky-xlight);
  border-color: var(--sky-light);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.1rem;
}

form input[type="text"][size="2"]:focus {
  background-color: #ffffff;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.25);
}

/* -- Persönliche Daten-Felder -------------------------------- */
form input[type="text"][size="12"],
form input[type="text"][size="25"] {
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-md);
}

form input[type="text"][size="40"] {
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-md);
  /* Auf kleinen Bildschirmen volle Breite */
  max-width: min(100%, 400px);
}

/* -- Select-Dropdown ----------------------------------------- */
form select {
  padding: 0.42rem 2.2rem 0.42rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230369a1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 1rem;
}

/* -- Textarea ------------------------------------------------ */
form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 90px;
  resize: vertical;
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  line-height: 1.6;
  margin-top: 0.25rem;
}

/* -- Submit-Button ------------------------------------------- */
form input[type="submit"] {
  display: block;
  margin: 2rem auto 0.5rem;
  padding: 0.85rem 3rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  color: #ffffff;
  background-color: var(--green-dark);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(22,163,74,0.38);
  transition:
    background-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

form input[type="submit"]:hover {
  background-color: #15803d;
  box-shadow: 0 6px 22px rgba(22,163,74,0.48);
  transform: translateY(-2px);
}

form input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}

form input[type="submit"]:focus-visible {
  outline: 3px solid var(--green-dark);
  outline-offset: 3px;
}

/* -- P[align=center] für den Submit-Wrapper ------------------ */
form p[align="center"],
form p[ALIGN="CENTER"] {
  text-align: center;
  margin-top: 1.5rem;
}

/* -- Barrierefreiheit: Reduced Motion ------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* -- Barrierefreiheit: High Contrast ------------------------- */
@media (forced-colors: active) {
  form input[type="text"],
  form select,
  form textarea {
    border: 2px solid ButtonText;
  }
  form input[type="submit"] {
    border: 2px solid ButtonText;
    forced-color-adjust: none;
  }
}

/* -- Responsiv: Tablet --------------------------------------- */
@media (max-width: 720px) {
  body {
    padding: 1rem 0.75rem;
  }

  form {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  form H1 {
    font-size: 1.55rem;
  }
}

/* -- Responsiv: Mobil ---------------------------------------- */
@media (max-width: 480px) {
  body {
    padding: 0.5rem 0.25rem;
    background-size: 24px 24px;
  }

  form {
    padding: 1.25rem 0.9rem;
    border-radius: var(--radius-md);
    border-top-width: 4px;
  }

  form H1 {
    font-size: 1.3rem;
  }

  form H3 {
    font-size: 0.9rem;
  }

  form input[type="text"][size="2"] {
    width: 2.6rem;
  }

  form input[type="text"][size="40"] {
    max-width: 100%;
    width: 100%;
  }

  form input[type="submit"] {
    width: 100%;
    padding: 0.9rem 1rem;
  }
}

/* -- Print --------------------------------------------------- */
@media print {
  body {
    background: white;
    padding: 0;
  }

  form {
    box-shadow: none;
    border: 1px solid #ccc;
    border-top: 3px solid #000;
    max-width: 100%;
    padding: 1rem;
  }

  form input[type="submit"] {
    display: none;
  }

  form a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  form a[name]::after {
    content: none;
  }
}
