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

:root {
  --bg: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --primary: #0071e3;
  --primary-hover: #0060c0;
  --danger: #d42020;
  --danger-hover: #b01818;
  --success: #28a745;
  --border: #d2d2d7;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --radius: 10px;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Form Page ─── */
.form-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 20px;
}

.form-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.event-title {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.req { color: var(--danger); }

.field textarea,
.field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
  background: var(--surface);
}

.field textarea:focus,
.field input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,113,227,.15);
}

.field textarea { resize: vertical; min-height: 100px; }

.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

button[type="submit"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

button[type="submit"] {
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 14px;
  font-size: 1.05rem;
  margin-top: 8px;
}
button[type="submit"]:hover { background: var(--primary-hover); }
button[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }

.form-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
}
.form-message.success { background: #e6f4ea; color: #1a7f37; }
.form-message.error { background: #fdecea; color: #c62828; }

/* ─── Admin Page ─── */
.admin-header {
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.admin-header h1 { font-size: 1.2rem; margin-bottom: 4px; }
.admin-links {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-links code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
}
.admin-links a { color: var(--primary); }
.link-label { font-weight: 600; }

.admin-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 24px;
  min-height: calc(100vh - 80px);
}

@media (max-width: 1200px) {
  .admin-layout { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.admin-col {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

.admin-col h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.col-live { border-top: 3px solid var(--primary); }
.col-hidden { opacity: .85; }

.q-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.col-live .q-card {
  border-color: var(--primary);
  background: #eef6ff;
}

.q-text {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 6px;
  word-break: break-word;
}

.q-author {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.q-author.anon { font-style: italic; }

.q-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.q-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #bbb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.empty-msg {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

/* ─── Projector Screen ─── */
.page-screen {
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 1200px;
  padding: 40px;
  min-height: 100vh;
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.screen-label {
  font-size: 1.5rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #aaa;
  margin-bottom: 24px;
}

.screen-question {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.3;
  max-width: 900px;
  word-break: break-word;
  animation: fadeIn .4s ease-out;
}

@media (max-width: 800px) {
  .screen-question { font-size: 2rem; }
}

.screen-author {
  font-size: 1.2rem;
  color: #aaa;
  margin-top: 20px;
  font-weight: 300;
}

.screen-qr-img {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  margin-top: 32px;
}

.screen-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.screen-idle-text {
  font-size: 2rem;
  font-weight: 400;
  color: #aaa;
  line-height: 1.4;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
