/* ============================================================
   Einsingübungen — gemeinsames Design-System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root{
  /* Farben */
  --paper: #F1EDE1;
  --paper-raised: #FBF9F3;
  --ink: #23282B;
  --ink-soft: #565F5F;
  --brass: #B8863A;
  --brass-dark: #93692A;
  --teal: #2F6259;
  --teal-soft: #E4EDE9;
  --line: #DAD3C0;
  --danger: #A23B3B;
  --danger-soft: #F3E3E1;

  /* Typografie */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  /* Sonstiges */
  --radius: 10px;
  --shadow: 0 2px 10px rgba(35,40,43,0.06), 0 1px 2px rgba(35,40,43,0.06);
  --shadow-lg: 0 16px 40px rgba(35,40,43,0.16);
  --max-width: 1180px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

::selection{ background: var(--brass); color: #fff; }

/* Sichtbarer Fokus-Ring überall */
:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .4em;
  color: var(--ink);
}

p{ margin: 0 0 1em; }

.container{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Staff-line Signaturelement: fünf feine Linien, wie ein Notensystem --- */
.staff-divider{
  height: 22px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0px, var(--line) 1px,
    transparent 1px, transparent 5px
  );
  background-position: center;
  background-size: 100% 20px;
  background-repeat: no-repeat;
  opacity: .9;
  margin: 8px 0 28px;
}

/* --- Kategorie-Nummerierungs-„Taktzahl" (Signature-Element) --- */
.cat-code{
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* --- Buttons --- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .92rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--teal); color: #fff; }
.btn-primary:hover{ background: #274f47; }
.btn-brass{ background: var(--brass); color: #fff; }
.btn-brass:hover{ background: var(--brass-dark); }
.btn-outline{ background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover{ border-color: var(--ink-soft); background: var(--paper-raised); }
.btn-danger{ background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover{ background: #ecd0cd; }
.btn-sm{ padding: 7px 12px; font-size: .82rem; }
.btn:disabled{ opacity: .5; cursor: not-allowed; }

/* --- Formularelemente --- */
label{ display:block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select{
  width: 100%;
  font-family: var(--font-body);
  font-size: .95rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-raised);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus{ border-color: var(--teal); }
textarea{ resize: vertical; min-height: 90px; }
.field{ margin-bottom: 16px; }

/* --- Karten --- */
.card{
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Passwort-Gate --- */
.gate-screen{
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(184,134,58,0.10), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(47,98,89,0.12), transparent 45%),
    var(--paper);
}
.gate-box{
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  text-align: center;
}
.gate-box .cat-code{ margin-bottom: 14px; }
.gate-box h1{ font-size: 1.6rem; margin-bottom: 6px; }
.gate-box p.hint{ color: var(--ink-soft); font-size: .9rem; margin-bottom: 22px; }
.gate-error{ color: var(--danger); font-size: .85rem; margin-top: 10px; min-height: 1.2em; }

/* --- Utility --- */
.visually-hidden{
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.muted{ color: var(--ink-soft); }
.small{ font-size: .84rem; }
.spinner{
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite; display:inline-block;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
