/* ============================================================
   YOUNGSTER TROPHY – Shared Design System
   Einbinden in jeder Subdomain:
   <link rel="stylesheet" href="/shared/style.css">
   oder per CDN/absoluter Pfad wenn Subdomains getrennt gehostet
   ============================================================ */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Brand */
  --yt-blue:        #1a56a0;
  --yt-blue-dark:   #0f3d7a;
  --yt-blue-light:  #3a76c0;
  --yt-gold:        #e8a020;
  --yt-gold-light:  #f5c55a;

  /* Rollen-Farben */
  --role-admin:     #9b2335;
  --role-verein:    #1a56a0;
  --role-helfer:    #1e7e34;
  --role-anmeldung: #6f42c1;

  /* UI Neutrals */
  --bg:             #f4f7fb;
  --bg-subtle:      #edf1f7;
  --card:           #ffffff;
  --border:         #d0daea;
  --border-dark:    #b0bfd4;
  --text:           #1e2a3a;
  --text-muted:     #5a6a7e;
  --text-faint:     #8a9ab0;

  /* Semantic */
  --error:          #c0392b;
  --error-bg:       #fdf0ee;
  --success:        #27ae60;
  --success-bg:     #eafaf1;
  --warning:        #d68910;
  --warning-bg:     #fef9e7;
  --info:           #1a56a0;
  --info-bg:        #eef4ff;

  /* Spacing */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;

  /* Shape */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.07);
  --shadow:     0 2px 10px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 18px rgba(0,0,0,0.11);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);

  /* Typography */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

/* ---------- Shared Header / Topbar ---------- */
.yt-topbar {
  background: linear-gradient(135deg, var(--yt-blue-dark) 0%, var(--yt-blue) 60%, var(--yt-blue-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-lg);
  height: 56px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.yt-topbar__logo {
  display: flex; align-items: center; gap: var(--sp-sm);
  font-weight: 800; font-size: 1rem; letter-spacing: 0.3px;
  text-decoration: none; color: white;
}
.yt-topbar__logo span { opacity: 0.75; font-weight: 400; font-size: 0.85rem; }
.yt-topbar__nav { display: flex; align-items: center; gap: var(--sp-md); }
.yt-topbar__nav a {
  color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.88rem;
  padding: var(--sp-xs) var(--sp-sm); border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.yt-topbar__nav a:hover { background: rgba(255,255,255,0.15); color: white; }
.yt-topbar__user {
  display: flex; align-items: center; gap: var(--sp-sm);
  font-size: 0.85rem; color: rgba(255,255,255,0.9);
}

/* ---------- Role Badge ---------- */
.yt-role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.yt-role-badge--admin    { background: var(--role-admin);     color: white; }
.yt-role-badge--verein   { background: var(--role-verein);    color: white; }
.yt-role-badge--helfer   { background: var(--role-helfer);    color: white; }
.yt-role-badge--anmeldung{ background: var(--role-anmeldung); color: white; }

/* ---------- Card ---------- */
.yt-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-lg);
}
.yt-card--lg { padding: var(--sp-xl); }

/* ---------- Section heading ---------- */
.yt-section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--yt-blue);
  border-bottom: 2px solid var(--yt-gold);
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  display: flex; align-items: center; gap: var(--sp-sm);
}

/* ---------- Form Elements ---------- */
.yt-field { display: flex; flex-direction: column; gap: 4px; }
.yt-label {
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.3px;
}
.yt-label .req { color: var(--error); }

.yt-input,
.yt-select,
.yt-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  background: #fafcff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}
.yt-input:focus, .yt-select:focus, .yt-textarea:focus {
  border-color: var(--yt-blue);
  box-shadow: 0 0 0 3px rgba(26,86,160,0.12);
  background: #fff;
}
.yt-input--error { border-color: var(--error) !important; }
.yt-field-error { font-size: 0.75rem; color: var(--error); min-height: 1em; }

.yt-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6a7e' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.yt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-sm);
  padding: 0.65rem 1.5rem;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.yt-btn:hover   { transform: translateY(-1px); }
.yt-btn:active  { transform: translateY(0); }
.yt-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.yt-btn--primary {
  background: linear-gradient(135deg, var(--yt-blue) 0%, var(--yt-blue-dark) 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(26,86,160,0.3);
}
.yt-btn--primary:hover { box-shadow: 0 5px 18px rgba(26,86,160,0.42); }

.yt-btn--secondary {
  background: white; color: var(--yt-blue);
  border: 1.5px solid var(--border);
}
.yt-btn--secondary:hover { border-color: var(--yt-blue); background: var(--info-bg); }

.yt-btn--ghost {
  background: transparent; color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.yt-btn--ghost:hover { background: var(--bg-subtle); color: var(--text); }

.yt-btn--danger {
  background: var(--error); color: white;
  box-shadow: 0 3px 10px rgba(192,57,43,0.25);
}

.yt-btn--full { width: 100%; }
.yt-btn--lg   { padding: 0.85rem 2rem; font-size: 1rem; }
.yt-btn--sm   { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* ---------- Alert / Notice ---------- */
.yt-alert {
  display: flex; gap: var(--sp-sm); align-items: flex-start;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  font-size: 0.85rem; line-height: 1.5;
}
.yt-alert--error   { background: var(--error-bg);   color: var(--error);   border: 1px solid #f5c6c2; }
.yt-alert--success { background: var(--success-bg); color: var(--success); border: 1px solid #a9dfbf; }
.yt-alert--info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #b8d0f0; }
.yt-alert--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #f9d98a; }

/* ---------- Table ---------- */
.yt-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.yt-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.yt-table thead th {
  background: var(--bg-subtle); color: var(--text-muted);
  font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 0.7rem 1rem; text-align: left;
  border-bottom: 1.5px solid var(--border);
}
.yt-table tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.yt-table tbody tr:last-child td { border-bottom: none; }
.yt-table tbody tr:hover { background: var(--bg-subtle); }

/* ---------- Utilities ---------- */
.yt-text-muted  { color: var(--text-muted); }
.yt-text-small  { font-size: 0.82rem; }
.yt-text-center { text-align: center; }
.yt-mt-sm { margin-top: var(--sp-sm); }
.yt-mt-md { margin-top: var(--sp-md); }
.yt-mt-lg { margin-top: var(--sp-lg); }
.yt-mb-md { margin-bottom: var(--sp-md); }
.yt-gap-sm { gap: var(--sp-sm); }
.yt-flex { display: flex; }
.yt-flex-center { display: flex; align-items: center; justify-content: center; }

/* ---------- Loader ---------- */
.yt-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: yt-spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes yt-spin { to { transform: rotate(360deg); } }

/* ---------- Responsive helpers ---------- */
@media (max-width: 640px) {
  .yt-hide-mobile { display: none !important; }
  .yt-card--lg { padding: var(--sp-md); }
}
