/* style.css – Mobile Quiz App Design */

body {
  font-family: system-ui, Arial, sans-serif;
  margin: 0;
  background: #f6f7fb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 100vw;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.10);
  width: 100%;
  max-width: 420px;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  text-align: center;
  color: #1a2233;
}

.question-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.question-label {
  font-size: 0.95rem;
  color: #666;
  text-align: center;
  letter-spacing: 0.2px;
  font-weight: 700; /* Label fett */
}

.question {
  display: block;
  text-align: center !important;
  font-size: 1.05rem;
  margin: 8px 0;
  line-height: 1.35;
  color: #0f1724;
  padding: 0 6px;
  word-break: break-word;
  font-weight: 400; /* nicht fett */
}

.user-info {
  text-align: center;
  font-style: italic;
  color: #555;
  margin-bottom: 8px;
}

.consent-note {
  text-align: center;
  font-size: 0.92rem;
  color: #666;
  margin-top: 10px;
  line-height: 1.3;
}

.consent-note a {
  color: #111827;
  font-weight: 600;
  text-decoration: underline;
}

.muted {
  color: #666;
  font-size: 1rem;
  text-align: center;
}

.error {
  background: #ffe7e7;
  border: 1px solid #ffb6b6;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
  text-align: center;
}

.answers {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid #e5e7ef;
  border-radius: 14px;
  cursor: pointer;
  background: #f8fafd;
  transition: border-color 0.2s, background 0.2s;
}
label.opt:hover, label.opt:focus-within {
  border-color: #cfd4e6;
  background: #f0f4fa;
}

.btn {
  background: linear-gradient(90deg, #ff6a00 0%, #ffb347 100%);
  color: #fff;
  border: 0;
  padding: 14px 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  width: 100%;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(255,106,0,0.08);
  transition: background 0.2s, box-shadow 0.2s;
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}
.modal {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  text-align: center;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}
.field input {
  padding: 12px;
  border: 1px solid #e5e7ef;
  border-radius: 12px;
  font-size: 1rem;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}
.btn-secondary {
  background: #e5e7eb;
  color: #111827;
  font-weight: 600;
}

@media (max-width: 480px) {
  /* Card: full-bleed, full-height auf Mobilgeräten */
  .card {
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top, 16px) + 20px) 6vw calc(env(safe-area-inset-bottom, 16px) + 32px);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .modal {
    max-width: 98vw;
    padding: 12px 6vw;
  }

  .wrap {
    padding: 0;
    min-height: 100vh;
    justify-content: flex-start;
  }

  h1 {
    font-size: 1.1rem;
  }

  /* Mehr Abstand an den Seiten für Antwort‑Buttons, größere Touchfläche */
  .answers {
    gap: 14px;
    padding: 0 6vw; /* Abstand zu den Rändern */
    box-sizing: border-box;
  }

  .answers label.opt {
    padding: 16px 14px;
    font-size: 1.05rem;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .row {
    padding: 0 6vw;
  }

  .btn {
    margin-bottom: 14px;
  }
}

/* Footer */
.site-footer {
  text-align: center;
  color: rgba(17,24,39,0.65);
  font-size: 0.88rem;
  padding: 18px 6vw;
  background: transparent;
}
.site-footer .footer-copy {
  opacity: 0.85;
  margin-bottom: 6px;
}
.site-footer .footer-powered a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}
.site-footer .footer-link a {
  color: #666;
  text-decoration: underline;
  font-weight: 500;
}

@media (max-width:480px) {
  .site-footer { padding: 20px 6vw; font-size: 0.9rem; }
}

/* Admin (vertical layout) */
.admin-vertical {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e6eef8;
  box-shadow: 0 6px 18px rgba(13, 18, 31, 0.04);
}
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.panel-title { font-size:1rem; font-weight:700; margin-top:2px; color:#0f1724; }
.panel-sub { margin-top:4px; color:#6b7280; font-size:0.92rem; }
.small-btn { background: linear-gradient(90deg,#1e3a8a,#60a5fa); color:#fff; padding:8px 12px; border-radius:10px; border:0; cursor:pointer; font-weight:700; box-shadow:0 6px 18px rgba(30,58,138,0.08); }
.small-btn.disabled, .small-btn[disabled] { opacity: 0.45; cursor: not-allowed; background:#93c5fd; color:#fff; box-shadow:none; }


.panel-body { margin-top:10px; }
.answers-compact { display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.answer-item { background:#f8fbff; padding:10px 12px; border-radius:10px; border:1px solid #e1f0fb; color:#0f1724; }
.panel-ops { display:flex; gap:8px; }

.stat-total { font-weight:700; margin-bottom:10px; }

/* Ensure admin buttons show the admin blue gradient (extra specificity) */
.admin-vertical .small-btn, .card .small-btn { background: linear-gradient(90deg,#2563eb,#60a5fa) !important; color:#fff; border:0; }

/* Mark correct answer in preview */
.answer-item.correct { background:#ecfdf5; border-color:#bbf7d0; color:#065f46; font-weight:700; }
.badge-correct { display:inline-block; margin-left:8px; background:#10b981; color:#fff; padding:4px 8px; border-radius:999px; font-size:0.85rem; font-weight:700; }

.stat-bars { display:flex; flex-direction:column; gap:10px; }
.stat-bar { display:flex; gap:10px; align-items:center; }
.bar-label { width:90px; color:#374151; font-size:0.95rem; }
.bar { background:#eaf2fb; height:14px; width:100%; border-radius:8px; overflow:hidden; }
.bar-fill { background:linear-gradient(90deg,#60a5fa,#0ea5e9); height:100%; }
.bar-meta { width:100px; text-align:right; color:#6b7280; font-size:0.9rem; }

.top-list { padding-left:18px; margin:0; }

.input-search { flex:1; padding:8px 10px; border-radius:8px; border:1px solid #e5e7ef; }

@media (max-width: 980px) {
  .admin-vertical { grid-template-columns: 1fr; }
}

/* Active/inactive visuals for Wochenverwaltung */
@keyframes pulseActive {
  0% { box-shadow: 0 0 0 rgba(37,99,235,0.06); transform: translateY(0); }
  50% { box-shadow: 0 8px 30px rgba(37,99,235,0.12); transform: translateY(-2px); }
  100% { box-shadow: 0 0 0 rgba(37,99,235,0.06); transform: translateY(0); }
}
.item.active {
  animation: pulseActive 2.5s infinite;
  border: 1px solid rgba(37,99,235,0.18);
  background: linear-gradient(90deg,#f0f9ff,#ffffff);
}
.item.inactive {
  opacity: 0.6;
  filter: grayscale(0.15);
}

/* PIN input error animation */
@keyframes shake { 0%{transform:translateX(0)}25%{transform:translateX(-6px)}50%{transform:translateX(6px)}75%{transform:translateX(-4px)}100%{transform:translateX(0)} }
.shake { animation: shake 0.5s; }

/* Avoid mobile browser zoom on focus: ensure PIN input is at least 16px */
#pinBackdrop input[type="password"],
#pinBackdrop input[type="text"],
#pinBackdrop input[type="number"] {
  font-size: 16px; /* prevents iOS from zooming on focus */
  -webkit-text-size-adjust: 100%;
}

/* If a PIN is required, ensure modal is visible and content blurred (prevent reading answers) */
html.needs-pin #pinBackdrop { display:flex !important; z-index:2000; background: #fff !important; align-items:center; justify-content:center; }
html.needs-pin #pinBackdrop .modal { box-shadow: 0 16px 50px rgba(2,6,23,0.12); border-radius: 14px; }
html.needs-pin .wrap { filter: blur(6px); pointer-events: none; user-select: none; }
html.needs-pin body { overflow: hidden; }

