:root {
  --accent: #2f6f4f;
  --accent-dark: #204d37;
  --bg: #faf9f6;
  --card: #ffffff;
  --border: #e4e0d8;
  --text: #24211c;
  --muted: #6b6459;
  --danger: #b3402a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.site-header .site-logo {
  height: 72px;
  width: auto;
  flex-shrink: 0;
}
.site-header .site-title {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--text);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 120px;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

label.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
}
label.field-label:first-child { margin-top: 0; }

input[type="text"], input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

label.consent {
  display: block;
  margin-top: 18px;
  cursor: pointer;
}
label.consent input[type="checkbox"] {
  float: left;
  margin-right: 10px;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
label.consent span {
  display: block;
  margin-left: 26px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
label.consent span a {
  color: var(--accent);
}

button.primary {
  margin-top: 24px;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: var(--accent-dark); }
button.primary:disabled { opacity: 0.5; cursor: default; }

.error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
}

.timerbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.timer.low { color: var(--danger); }

.progress {
  font-size: 13px;
  color: var(--muted);
}

.question {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.question .q-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.option:hover { background: #f2f0ea; }
.option input { margin-top: 3px; outline: none; }
.option input:focus, .option input:focus-visible { outline: none; box-shadow: none; }
.option span { font-size: 14px; }

.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: center;
}
.footer-bar button {
  max-width: 680px;
  width: 100%;
}

.result-score {
  font-size: 18px;
  font-weight: 600;
  margin: 14px 0 20px;
}

a.download {
  display: inline-block;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
a.download:hover { background: var(--accent-dark); }

.hidden { display: none !important; }

/* --- admin --- */
.admin-wrap { max-width: 960px; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}
.tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.q-admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.q-admin-card .row { display: flex; gap: 10px; margin-bottom: 8px; }
.q-admin-card .row > div { flex: 1; }
.q-admin-card textarea, .q-admin-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.q-admin-card textarea { min-height: 40px; resize: vertical; }
.q-admin-card .meta-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.q-admin-card .meta-row .pos { font-weight: 700; color: var(--muted); }
.q-admin-card select { padding: 6px; border-radius: 6px; border: 1px solid var(--border); }

.btn-small {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.btn-small.save { border-color: var(--accent); color: var(--accent); }
.btn-small.delete { border-color: var(--danger); color: var(--danger); }

.add-bar { text-align: center; margin: 20px 0 60px; }

