/* =============================================
   Familienportal – Globales Stylesheet
   Design: Warm-minimalistisch, Weiß + Blaugrau
   Schriften: Nunito (Fließtext) + Playfair Display (Akzente)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,400&display=swap');

/* ─── CSS-Variablen ─────────────────────────── */
:root {
  --white:        #ffffff;
  --off-white:    #f7f8fc;
  --bg:           #eef1f7;
  --surface:      #ffffff;
  --surface-alt:  #f0f4fb;

  --blue-100:     #e8eff8;
  --blue-200:     #c5d8ee;
  --blue-400:     #7aaed6;
  --blue-500:     #4a8fc0;
  --blue-600:     #3474a8;
  --blue-700:     #215d8a;

  --gray-100:     #f0f2f7;
  --gray-200:     #dde2ec;
  --gray-300:     #c4ccda;
  --gray-400:     #9aa5bb;
  --gray-500:     #6b7a96;
  --gray-600:     #4a5568;
  --gray-700:     #2d3748;
  --gray-800:     #1a202c;

  --accent:       #4a8fc0;
  --accent-hover: #3474a8;
  --accent-light: #e8eff8;

  --success:      #48bb78;
  --warning:      #ed8936;
  --danger:       #e53e3e;
  --danger-light: #fff5f5;

  --shadow-sm:  0 1px 3px rgba(74,110,160,.08), 0 1px 2px rgba(74,110,160,.06);
  --shadow-md:  0 4px 16px rgba(74,110,160,.12), 0 2px 6px rgba(74,110,160,.06);
  --shadow-lg:  0 12px 40px rgba(74,110,160,.16), 0 4px 12px rgba(74,110,160,.08);
  --shadow-xl:  0 20px 60px rgba(74,110,160,.22);

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  22px;
  --radius-xl:  32px;

  --transition: .2s cubic-bezier(.4,0,.2,1);
  --transition-spring: .35s cubic-bezier(.34,1.56,.64,1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--gray-700);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Typografie ─────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; color: var(--gray-800); line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h3 { font-size: 1.1rem; }

.font-display {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
}

/* ─── Utility ────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
.text-muted { color: var(--gray-400); font-size: .85rem; }
.text-center { text-align: center; }

/* ─── Card ───────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
}

/* ─── Button ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(74,143,192,.35); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-300); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }

.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ─── Input ──────────────────────────────────── */
.input-group {
  display: flex; flex-direction: column; gap: .45rem;
}
.input-group label {
  font-size: .82rem; font-weight: 600; color: var(--gray-500);
  letter-spacing: .03em; text-transform: uppercase;
}
.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem;
  color: var(--gray-700); background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(74,143,192,.15);
}

/* ─── Badge ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 99px; font-size: .75rem; font-weight: 700;
  letter-spacing: .02em;
}
.badge-blue   { background: var(--blue-100);  color: var(--blue-600); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-500); }
.badge-green  { background: #ebf8f0;          color: #276749; }
.badge-orange { background: #fef3e2;          color: #c05621; }
.badge-red    { background: var(--danger-light); color: var(--danger); }

/* ─── Toast ──────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .6rem;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem;
  background: var(--gray-800); color: #fff;
  border-radius: var(--radius);
  font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .3s var(--transition-spring) forwards;
  max-width: 320px;
}
.toast.toast-success { background: #276749; }
.toast.toast-error   { background: var(--danger); }
.toast.fade-out      { animation: fadeOut .3s ease forwards; }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* ─── Modal / Overlay ────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(26,32,44,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeInBackdrop .2s ease;
}
.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  width: min(460px, 94vw);
  animation: modalPop .35s var(--transition-spring);
  position: relative;
}
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-header h3 { font-size: 1.2rem; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--gray-100);
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); font-size: 1.1rem;
  transition: var(--transition); flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }

@keyframes fadeInBackdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop {
  from { transform: scale(.9) translateY(10px); opacity: 0; }
  to   { transform: scale(1)  translateY(0);    opacity: 1; }
}

/* ─── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .btn-lg { padding: .8rem 1.5rem; }
  .modal  { padding: 1.5rem; }
}
