/* ═══════════════════════════════════════════════════════════
   Midnight Milk Club — Design-System
   Pastell-Pop · Lavendel · Rosa · Butter-Gelb
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Abenddämmerungs-Violett (Login-Hintergrund) */
  --ink:        #2E2554;
  --ink-soft:   #3A2F66;
  --ink-card:   #443878;
  --ink-line:   rgba(255, 255, 255, 0.14);
  --ink-text:   #FDFBFF;
  --ink-muted:  rgba(253, 251, 255, 0.66);

  /* Tag */
  --paper:      #FBF9FF;
  --surface:    #FFFFFF;
  --cream:      #FFF7E0;
  --line:       #EAE4F7;
  --text:       #3B3361;
  --muted:      #8D86A8;

  /* Marke — Pastell-Pop (entschärft, weniger knallig) */
  --violet:       #9B82EE;
  --violet-deep:  #7E66C9;
  --violet-soft:  #F1ECFE;
  --lavender:     #D8CDFC;
  --pink:         #F3AED1;
  --pink-soft:    #FDE7F3;
  --grad:         linear-gradient(135deg, #C7B9FB, #FBD0E6);
  --grad-head:    linear-gradient(135deg, #D6CBFB 0%, #F7D4EB 70%, #FCE7C7 115%);
  /* Pastell-Gelb (Sterne, Diagramm-Akzente) */
  --gold:         #F8D98A;
  --gold-deep:    #C99A2E;
  --gold-soft:    #FEF5DC;

  /* Semantik */
  --green:      #3BA57E;
  --green-soft: #E8F7F0;
  --amber:      #C2810F;
  --amber-soft: #FCF3DE;
  --red:        #EE6A6A;
  --red-soft:   #FDEDED;
  --night:      #7B84DE;
  --night-soft: #EFF1FC;
  --day:        #ECB54E;
  --day-soft:   #FDF5E2;
  --rose:       #E58BB1;

  /* Form — runder & weicher */
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(155, 130, 238, 0.05), 0 4px 14px rgba(155, 130, 238, 0.07);
  --shadow-md: 0 4px 10px rgba(155, 130, 238, 0.07), 0 14px 34px rgba(155, 130, 238, 0.12);
  --shadow-lg: 0 8px 20px rgba(155, 130, 238, 0.13), 0 28px 64px rgba(155, 130, 238, 0.18);

  /* Schrift — rund & kräftig */
  --serif: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --sans:  'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}

/* ── Dunkelmodus ── */
html[data-theme="dark"] {
  --paper:      #1E1A33;
  --surface:    #2A2447;
  --cream:      #352B50;
  --line:       rgba(255, 255, 255, 0.10);
  --text:       #F4F1FC;
  --muted:      #ADA6C9;

  --violet-soft: rgba(155, 130, 238, 0.18);
  --pink-soft:   rgba(243, 174, 209, 0.16);
  --gold-soft:   rgba(248, 217, 138, 0.16);
  --green-soft:  rgba(59, 165, 126, 0.18);
  --amber-soft:  rgba(194, 129, 15, 0.18);
  --red-soft:    rgba(238, 106, 106, 0.18);
  --night-soft:  rgba(123, 132, 222, 0.18);
  --day-soft:    rgba(236, 181, 78, 0.18);

  --amber:     #E0A83D;
  --gold-deep: #F0C25C;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.20), 0 4px 14px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.22), 0 14px 34px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.28), 0 28px 64px rgba(0, 0, 0, 0.38);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: 'ss01' on;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; }

::selection { background: rgba(91, 79, 232, 0.18); }

/* ── Typografie ── */
.display {
  font-family: var(--serif);
  font-weight: 480;
  letter-spacing: -0.015em;
  line-height: 1.08;
}
.display em, .h-serif em {
  font-style: italic;
  font-weight: 430;
  color: var(--violet);
}
.h-serif {
  font-family: var(--serif);
  font-weight: 520;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--gold);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 99px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.975); }

.btn-primary { background: var(--grad); color: #3B2A66; font-weight: 800; box-shadow: 0 8px 20px rgba(199, 185, 251, 0.45); }
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 10px 26px rgba(199, 185, 251, 0.55); transform: translateY(-1px); }

.btn-ink { background: var(--ink); color: var(--ink-text); }
.btn-ink:hover { background: var(--ink-soft); transform: translateY(-1px); }

.btn-cream { background: var(--ink-text); color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.btn-cream:hover { background: #fff; transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }

.btn-outline-dark { background: transparent; color: var(--ink-text); border: 1px solid var(--ink-line); }
.btn-outline-dark:hover { border-color: var(--lavender); color: var(--lavender); }

.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { color: var(--red); }

.btn-danger-soft { background: var(--red-soft); color: var(--red); border: 1px solid rgba(214, 69, 69, 0.25); }
.btn-danger-soft:hover { background: #F9DCDA; }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-xs { padding: 5px 11px; font-size: 0.75rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ── Formulare ── */
label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
label .opt { font-weight: 450; opacity: 0.75; }

input, select, textarea {
  width: 100%;
  padding: 12px 15px;
  background: var(--violet-soft);
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: #B6A9DC; font-weight: 400; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--violet);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}
input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--violet);
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: auto;
  padding: 0;
  background: none;
  border: none;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23716C87' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Karten ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 24px;
  box-shadow: var(--shadow-md);
}
.card-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: var(--violet);
  margin-bottom: 16px;
}
.card-label svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--violet); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-gold   { background: var(--gold-soft);   color: var(--gold-deep); }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-night  { background: var(--night-soft);  color: var(--night); }
.badge-day    { background: var(--day-soft);    color: var(--amber); }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--ink-text);
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  border: 1px solid var(--ink-line);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Utility ── */
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ── Theme-Toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--violet); color: var(--violet); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Scrollbar (dezent) ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D4CFC2; border-radius: 99px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-color: var(--paper); }

/* ── Dunkelmodus: hartkodierte Rahmenfarben ── */
html[data-theme="dark"] .alert-warn { border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .alert-info { border-color: rgba(255, 255, 255, 0.10); }

/* ── Reduzierte Bewegung ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
