/* ==========================================================================
   KLARTEXT – Styling im ÖSKM-Stil (wie SEPP / Relotius)
   Palette angelehnt an oskm.at: Navy + Mint + Indigo, Schrift Montserrat.
   ========================================================================== */

:root {
  /* Flaechen */
  --surface:   #F5F7F9;   /* Seitenhintergrund, kuehles Grau-Weiss */
  --panel:     #FFFFFF;   /* Karten */
  --ink:       #121F36;   /* Haupttext / Navy */
  --muted:     #5E6A85;   /* Sekundaertext */
  --border:    #E4E7EE;   /* Trennlinien */

  /* Navy (Primaer: Buttons, Akzente) */
  --primary:     #121F36;
  --primary-600: #0D1729;
  --primary-700: #080F1B;
  --primary-50:  #EEF1F6;

  /* Mint (Highlights) */
  --accent:     #B3F5A0;
  --accent-100: #E4FAD8;
  --accent-50:  #F4FDF0;
  --accent-400: #94D87E;
  --accent-600: #4F9A3B;

  /* Indigo (Links) */
  --link:     #3940B2;
  --link-600: #2E3590;

  /* Status */
  --warning: #E0A458;
  --danger:  #FF3644;

  --radius-card: 12px;
  --radius-md:   8px;
  --shadow-soft: 0 1px 2px rgba(18,31,54,0.05), 0 4px 14px rgba(18,31,54,0.08);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { letter-spacing: -0.02em; }

/* --- Kopfleiste (weiss, Logo rechts) --- */
.topbar {
  height: 56px;
  flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-logo {
  height: 26px;
  width: auto;
  user-select: none;
}

/* --- Hauptbereich --- */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px;
}

/* --- Karten --- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

/* --- Bildschirme (immer nur einer sichtbar) --- */
.bildschirm[hidden] { display: none; }

/* --- Formular --- */
.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 6px;
}
.label:first-child { margin-top: 0; }

.input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.input::placeholder { color: var(--muted); opacity: 0.8; }

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18,31,54,0.12);
}

textarea.input { resize: vertical; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.12s ease;
  user-select: none;
}

.btn-primary {
  margin-top: 20px;
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-600); }
.btn-primary:active { background: var(--primary-700); }
.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* --- Fehlermeldungen --- */
.fehler {
  margin-top: 16px;
  padding: 12px 14px;
  background: #FDECEA;
  border: 1px solid #F5C6CB;
  border-radius: var(--radius-md);
  color: #A3261C;
  white-space: pre-wrap;
}

/* --- Ladebildschirm --- */
.lade-box { text-align: center; padding: 56px 20px; }
.lade-titel { font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.lade-hinweis {
  color: var(--muted);
  font-size: 14px;
  max-width: 480px;
  margin: 0 auto;
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 20px;
  border: 5px solid var(--accent-100);
  border-top-color: var(--accent-600);
  border-radius: 50%;
  animation: dreh 1s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

/* --- Bewertungsbildschirm --- */
.anleitung {
  background: var(--accent-50);
  border: 1px solid var(--accent-100);
  border-left: 4px solid var(--accent-600);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0 0 20px;
  color: var(--ink);
}

.spalten {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.spalte {
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.spalte h2 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

/* WICHTIG: jeder Textbereich ist einzeln scrollbar + feste Hoehe,
   damit Lesezeit und Scrolltiefe pro Version getrennt messbar sind. */
.text-bereich {
  height: 320px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  white-space: pre-wrap;
  font-size: 15px;
  color: var(--ink);
  flex-grow: 1;
}

/* Spalte, ueber der die Maus liegt (= wird gerade gelesen): Mint-Rahmen. */
.spalte.aktiv {
  box-shadow: 0 0 0 2px var(--accent-400), var(--shadow-soft);
  border-color: var(--accent-400);
}

/* --- Sterne-Bewertung --- */
.bewertung { margin-top: 16px; }

.bewertung-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.sterne { display: flex; gap: 4px; }

.stern {
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: #CFD6DD;            /* leerer Stern */
  padding: 0 2px;
  transition: color 0.1s;
}
.stern:hover { color: var(--warning); }
.stern.gewaehlt { color: var(--warning); }   /* gewaehlt = warmes Amber */

/* --- Dankebildschirm --- */
.danke-box { text-align: center; padding: 48px 20px; }
.danke-box h2 { color: var(--accent-600); margin-top: 0; }
.danke-box p { color: var(--muted); }

/* --- Footer --- */
.footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.footer-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.footer-link:hover { color: var(--link); text-decoration: underline; }

/* --- Schmale Bildschirme: Spalten untereinander --- */
@media (max-width: 800px) {
  .spalten { grid-template-columns: 1fr; }
  .text-bereich { height: 260px; }
}

@media (max-width: 520px) {
  .brand-sub { display: none; }
}
