/* ==========================================================
   MAHA Messeumfrage – Style (CI-konform)
   ========================================================== */

:root {
  --maha-red:        #E3000F;
  --maha-blue:       #0055A4;
  --maha-blue-alt:   #2457A0;
  --maha-orange:     #F26B43;
  --text-dark:       #3B3B3B;
  --text-mid:        #727576;
  --bg-grey:         #F5F5F5;
  --border:          #D9D9D9;
  --white:           #FFFFFF;
  --black:           #000000;
  --shadow:          0 4px 24px rgba(0,0,0,0.08);
  --radius:          12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--bg-grey);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ── */
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-weight: 900;
  font-size: 22px;
  color: var(--maha-red);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 8px; height: 28px;
  background: var(--maha-red);
  border-radius: 2px;
}
.lang-switch {
  display: flex;
  background: var(--bg-grey);
  border-radius: 999px;
  padding: 3px;
}
.lang-switch button {
  border: 0; background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  letter-spacing: 0.5px;
}
.lang-switch button.active {
  background: var(--maha-blue);
  color: var(--white);
}

/* ── Layout ── */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ── Welcome screen ── */
.welcome {
  text-align: center;
  padding: 60px 20px 40px;
}
.welcome h1 {
  font-size: 34px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 8px;
  color: var(--text-dark);
}
.welcome h1 strong {
  display: block;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  font-size: 38px;
  margin-top: 6px;
}
.welcome p {
  font-size: 17px;
  color: var(--text-mid);
  margin: 0 0 32px;
}

/* ── Form mode ── */
.form-mode .question {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* ── Kiosk mode ── */
.kiosk-mode .question {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
}
.kiosk-mode .progress-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}
.kiosk-mode .progress-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
}
.kiosk-mode .progress-dots span.active { background: var(--maha-red); width: 24px; border-radius: 4px; }
.kiosk-mode .progress-dots span.done { background: var(--maha-blue); }

/* ── Question content ── */
.q-num {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--maha-red);
  margin-bottom: 8px;
}
.q-text {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 6px;
  line-height: 1.35;
}
.q-hint {
  font-size: 13px;
  color: var(--text-mid);
  margin: 0 0 16px;
  font-style: italic;
}

/* ── Option buttons (single/multi) ── */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 56px;
  font-family: inherit;
  color: var(--text-dark);
  width: 100%;
}
.opt:hover { border-color: var(--maha-blue); }
.opt:active { transform: scale(0.99); }
.opt.selected {
  border-color: var(--maha-red);
  background: rgba(227, 0, 15, 0.06);
}
.opt .marker {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
}
.opt[data-type="multi"] .marker { border-radius: 5px; }
.opt.selected .marker {
  border-color: var(--maha-red);
  background: var(--maha-red);
}
.opt.selected .marker::after {
  content: "";
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* ── Contact question ── */
.contact-yes-no { display: flex; gap: 10px; margin-bottom: 10px; }
.contact-yes-no .opt { flex: 1; justify-content: center; }
.contact-fields {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.contact-fields.show { display: flex; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: -4px; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--maha-blue);
}
textarea { min-height: 90px; resize: vertical; }

/* ── Action buttons ── */
.actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}
.kiosk-mode .actions { padding-top: 24px; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  min-height: 54px;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--maha-red);
  color: var(--white);
  flex: 1;
}
.btn-primary:hover { background: #c20012; }
.btn-primary:disabled {
  background: var(--border);
  color: var(--text-mid);
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--white);
  color: var(--text-dark);
  border: 2px solid var(--border);
}
.btn-secondary:hover { border-color: var(--maha-blue); color: var(--maha-blue); }
.btn-link {
  background: transparent;
  color: var(--text-mid);
  font-weight: 500;
  text-decoration: underline;
  padding: 12px;
}

/* ── Submit area (form mode) ── */
.submit-area {
  text-align: center;
  margin-top: 24px;
}
.submit-area .btn-primary { padding: 18px 60px; font-size: 17px; }

/* ── Thanks screen ── */
.thanks {
  text-align: center;
  padding: 80px 20px;
}
.thanks .check-icon {
  width: 80px; height: 80px;
  background: var(--maha-blue);
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thanks .check-icon::after {
  content: "";
  width: 22px; height: 38px;
  border: solid white;
  border-width: 0 5px 5px 0;
  transform: rotate(45deg);
  margin-top: -6px;
}
.thanks h2 {
  font-size: 32px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 12px;
}
.thanks p { color: var(--text-mid); font-size: 17px; max-width: 460px; margin: 0 auto 32px; }

/* ── Error message ── */
.error-msg {
  color: var(--maha-red);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  min-height: 18px;
}

/* ── Footer ── */
.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-mid);
  border-top: 1px solid var(--border);
  background: var(--white);
}
.app-footer span { color: var(--maha-red); font-weight: 700; }

/* ── Tablet / Desktop ── */
@media (min-width: 768px) {
  .app-main { padding: 36px 24px 60px; }
  .welcome h1 { font-size: 42px; }
  .welcome h1 strong { font-size: 48px; }
  .opt { padding: 16px 20px; font-size: 17px; }
}

/* ── Loader ── */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-mid);
}

/* ── Admin-Seite ── */
.admin-wrap { max-width: 800px; margin: 0 auto; padding: 24px 20px; }
.admin-wrap h1 { font-weight: 300; text-transform: uppercase; letter-spacing: 1.5px; }
.admin-wrap h1 strong { font-weight: 800; text-transform: none; letter-spacing: 0; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.stat-card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mid);
  margin-bottom: 6px;
}
.stat-card .value {
  font-size: 36px;
  font-weight: 800;
  color: var(--maha-blue);
  line-height: 1;
}
.stat-card.live .value { color: var(--maha-red); }
.admin-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.admin-section h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}
.mode-toggle { display: flex; gap: 10px; }
.mode-toggle button {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--border);
  background: var(--white);
  border-radius: 10px;
  font-weight: 600;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-dark);
}
.mode-toggle button.active {
  border-color: var(--maha-red);
  background: rgba(227, 0, 15, 0.06);
  color: var(--maha-red);
}
.recent-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.recent-table th, .recent-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.recent-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mid);
}
