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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f0e8;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header & Nav ===== */
header {
  background: #2e1f0e;
  color: #f5f0e8;
  padding: 0 1.5rem;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #e8c97a;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: #f5f0e8;
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.85;
  transition: opacity 0.15s;
}

nav a:hover,
nav a.active {
  opacity: 1;
  color: #e8c97a;
}

/* ===== Main Content ===== */
main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== Page Title ===== */
.page-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: #2e1f0e;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: #6b5a3e;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ===== Cards / Sections ===== */
.card {
  background: #fff;
  border: 1px solid #e0d5c0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2e1f0e;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8c97a;
  display: inline-block;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 2rem;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a7055;
  margin-bottom: 0.15rem;
}

.info-value {
  font-size: 0.98rem;
  color: #1a1a1a;
}

/* ===== Hero Banner (index only) ===== */
.hero {
  background: linear-gradient(135deg, #2e1f0e 0%, #4a3020 100%);
  color: #f5f0e8;
  border-radius: 10px;
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '⚫';
  font-size: 8rem;
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.08;
  pointer-events: none;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #e8c97a;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.hero .hero-date {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.4;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #3a7a34;
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: #f5f0e8;
  border: 2px solid rgba(245, 240, 232, 0.5);
}

.btn-secondary:hover {
  border-color: #e8c97a;
  color: #e8c97a;
}

.btn-outline {
  background: transparent;
  color: #3a7a34;
  border: 2px solid #3a7a34;
}

.btn-danger {
  background: #c0392b;
  color: #fff;
}

/* ===== Form Styles ===== */
.form-group {
  margin-bottom: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #3d2b10;
  margin-bottom: 0.35rem;
}

label .optional {
  font-weight: 400;
  color: #8a7055;
  margin-left: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #d0c4a8;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fdfbf7;
  color: #1a1a1a;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: #3a7a34;
  box-shadow: 0 0 0 3px rgba(58, 122, 52, 0.12);
}

input.error {
  border-color: #c0392b;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #3a7a34;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-group label {
  margin: 0;
  font-weight: 400;
  font-size: 0.9rem;
  color: #3d2b10;
  cursor: pointer;
}

.field-hint {
  font-size: 0.8rem;
  color: #8a7055;
  margin-top: 0.3rem;
}

/* ===== Messages ===== */
.message {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.message-success {
  background: #eaf6e9;
  border: 1px solid #a8d8a3;
  color: #1a5e1a;
}

.message-error {
  background: #fdecea;
  border: 1px solid #e8a8a3;
  color: #7a1a1a;
}

.message-info {
  background: #fdf8ee;
  border: 1px solid #e8c97a;
  color: #5a3e10;
}

.token-box {
  background: #f0faf0;
  border: 1.5px solid #3a7a34;
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.token-box h3 {
  color: #1a5e1a;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.token-link {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  background: #fff;
  border: 1px solid #a8d8a3;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  display: block;
  margin: 0.5rem 0;
  color: #1a5e1a;
}

.token-box p {
  font-size: 0.85rem;
  color: #2a6e2a;
  margin-top: 0.5rem;
}

/* ===== Participant Table ===== */
.participants-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.participant-count {
  font-size: 0.9rem;
  color: #6b5a3e;
  font-weight: 600;
}

.participant-count .count-full {
  color: #c0392b;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: #2e1f0e;
  color: #e8c97a;
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

thead th:first-child {
  border-radius: 6px 0 0 0;
  width: 3rem;
  text-align: center;
}

thead th:last-child {
  border-radius: 0 6px 0 0;
}

tbody tr {
  border-bottom: 1px solid #ede5d0;
  transition: background 0.1s;
}

tbody tr:hover {
  background: #faf7f0;
}

tbody td {
  padding: 0.65rem 0.9rem;
  color: #1a1a1a;
}

tbody td:first-child {
  text-align: center;
  color: #8a7055;
  font-size: 0.85rem;
}

.anonym-badge {
  display: inline-block;
  font-size: 0.72rem;
  background: #f0e8d0;
  color: #8a7055;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #8a7055;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: #8a7055;
  font-style: italic;
}

/* ===== Verwaltung ===== */
.registration-details {
  margin-bottom: 1.5rem;
}

.registration-details p {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.registration-details strong {
  color: #3d2b10;
  min-width: 120px;
  display: inline-block;
}

/* ===== Footer ===== */
footer {
  background: #2e1f0e;
  color: rgba(245, 240, 232, 0.6);
  text-align: center;
  font-size: 0.82rem;
  padding: 1rem 1.5rem;
}

footer a {
  color: #e8c97a;
  text-decoration: none;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  nav {
    gap: 1rem;
  }
}
