/* === Layout === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  padding-bottom: 80px;
}

#app { max-width: 480px; margin: 0 auto; }

/* === Header === */
.header {
  background: linear-gradient(135deg, #e94560, #c23152);
  padding: 20px 16px 16px;
  text-align: center;
}
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.header-logo { font-size: 32px; }
.header-title { font-size: 22px; font-weight: 700; color: #fff; }
.header-subtitle { font-size: 13px; color: rgba(255,255,255,0.8); font-style: italic; }

/* === Navigation === */
.nav {
  display: flex;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  padding: 12px 4px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
.nav-btn.active {
  color: #e94560;
  border-bottom-color: #e94560;
  background: rgba(233,69,96,0.1);
}
.nav-btn:active { background: rgba(233,69,96,0.2); }

/* === User bar === */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #16213e;
  font-size: 13px;
  border-bottom: 1px solid #0f3460;
}
.user-bar.hidden { display: none; }
.btn-small {
  padding: 4px 10px;
  border: 1px solid #0f3460;
  background: transparent;
  color: #e94560;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* === Pages === */
.pages { position: relative; }
.page { display: none; }
.page.active { display: block; }
.section { padding: 16px; }
.section + .section { border-top: 1px solid #0f3460; }

/* === Typography === */
.section h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #e94560;
}
.section h3 {
  font-size: 15px;
  margin-bottom: 10px;
  color: #eee;
}
.info-text {
  font-size: 14px;
  line-height: 1.6;
  color: #ccc;
}
.muted { color: #888; font-size: 13px; }

/* === Events list === */
.events-list { display: flex; flex-direction: column; gap: 8px; }
.event-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.event-card:active {
  background: #0f3460;
  transform: scale(0.98);
}
.event-card-title { font-size: 15px; font-weight: 600; }
.event-card-info { font-size: 12px; color: #888; text-align: right; }
.event-card-count {
  display: inline-block;
  background: #e94560;
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.event-card-count.full { background: #555; }
.event-card-inactive {
  opacity: 0.5;
  cursor: default;
}

/* === Buttons === */
.btn-primary, .btn-secondary, .btn-danger {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #e94560, #c23152);
  color: #fff;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: #16213e;
  color: #eee;
  border: 1px solid #0f3460;
}
.btn-secondary:active { background: #0f3460; }
.btn-danger {
  background: #c0392b;
  color: #fff;
  margin-top: 16px;
}

/* === Chips === */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.chip {
  padding: 8px 14px;
  border: 1px solid #0f3460;
  background: #16213e;
  color: #ccc;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.chip.selected {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}
.chip:active { transform: scale(0.95); }

/* === Form fields === */
.reg-form .field {
  margin-bottom: 16px;
}
.reg-form label.field {
  display: block;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 14px;
}
.reg-form label.field span {
  display: block;
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}
.reg-form input[type="text"],
.reg-form input[type="number"],
.reg-form input[type="tel"],
.reg-form input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #0f3460;
  background: #0f3460;
  color: #eee;
  border-radius: 8px;
  font-size: 15px;
}
.reg-form input:focus {
  outline: none;
  border-color: #e94560;
}

/* === Reg steps === */
.reg-step { padding: 0; }
.reg-step.hidden { display: none; }
.reg-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.reg-actions .btn-primary,
.reg-actions .btn-secondary { flex: 1; }

/* === Success / Error / Waitlist === */
.success-box, .waitlist-box {
  text-align: center;
  padding: 24px 16px;
}
.success-box h3, .waitlist-box h3 {
  font-size: 20px;
  margin-bottom: 12px;
}
.summary-box {
  text-align: left;
  background: #16213e;
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.8;
}
.error {
  color: #e94560;
  font-size: 14px;
  padding: 10px;
  background: rgba(233,69,96,0.1);
  border-radius: 8px;
}
.error.hidden { display: none; }

/* === Admin === */
.admin-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #0f3460;
}
.admin-section:last-child { border-bottom: none; }
.admin-login { text-align: center; padding: 20px; }
.admin-login input {
  width: 100%;
  padding: 12px;
  border: 1px solid #0f3460;
  background: #16213e;
  color: #eee;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 10px;
}
.admin-login input:focus {
  outline: none;
  border-color: #e94560;
}
.admin-login .btn-primary { margin-top: 8px; }
.admin-login p { margin-bottom: 12px; color: #ccc; }

/* === Stats === */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: #16213e;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #e94560;
}
.stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* === Registration list (admin) === */
.reg-list-item {
  background: #16213e;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.reg-list-item strong { color: #e94560; }

/* === Modal === */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-content {
  background: #1a1a2e;
  border-radius: 14px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}
.modal-close:hover { color: #fff; }

/* === Loading === */
.loading {
  text-align: center;
  color: #888;
  padding: 20px;
}

/* === No events === */
.no-events {
  text-align: center;
  color: #888;
  padding: 20px;
  font-style: italic;
}

/* === Limit input === */
.limit-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.limit-input-row input {
  flex: 1;
  padding: 8px;
  border: 1px solid #0f3460;
  background: #0f3460;
  color: #eee;
  border-radius: 6px;
  font-size: 14px;
}
.limit-input-row button {
  padding: 8px 14px;
  border: none;
  background: #e94560;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.page.active { animation: fadeIn 0.2s ease; }
