:root {
  --bg: #0f1220;
  --card: #1a1e33;
  --text: #f4f4f8;
  --muted: #9a9fc0;
  --accent: #f1c40f;
  --accent-text: #14172a;
  --danger: #e03131;
  --ok: #2f9e44;
  --border: #2c2f4a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Subtle, muted Hawaii-themed texture (palm fronds + hibiscus + a wave line) -
   drawn as an inline SVG tile rather than a photo so it stays lightweight,
   works offline, and is easy to keep low-opacity/non-distracting. Colors are
   close in value to --bg/--border/--accent on purpose, so it reads as a
   faint texture rather than a loud pattern. */
html, body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cg fill='%23232a4d' fill-opacity='0.55'%3E%3Cellipse cx='20' cy='30' rx='46' ry='11' transform='rotate(-35 20 30)'/%3E%3Cellipse cx='20' cy='30' rx='46' ry='11' transform='rotate(-10 20 30)'/%3E%3Cellipse cx='20' cy='30' rx='46' ry='11' transform='rotate(15 20 30)'/%3E%3Cellipse cx='20' cy='30' rx='46' ry='11' transform='rotate(40 20 30)'/%3E%3C/g%3E%3Cg fill='%23f1c40f' fill-opacity='0.08' transform='translate(190 90)'%3E%3Cellipse cx='0' cy='-20' rx='10' ry='18'/%3E%3Cellipse cx='19' cy='-6' rx='10' ry='18' transform='rotate(72 19 -6)'/%3E%3Cellipse cx='12' cy='18' rx='10' ry='18' transform='rotate(144 12 18)'/%3E%3Cellipse cx='-12' cy='18' rx='10' ry='18' transform='rotate(216 -12 18)'/%3E%3Cellipse cx='-19' cy='-6' rx='10' ry='18' transform='rotate(288 -19 -6)'/%3E%3Ccircle r='6' fill='%23f1c40f' fill-opacity='0.12'/%3E%3C/g%3E%3Cpath d='M0 210 Q 30 195 60 210 T 120 210 T 180 210 T 240 210' stroke='%232c2f4a' stroke-opacity='0.5' stroke-width='5' fill='none'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 240px 240px;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
}

.page.admin {
  max-width: 900px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

h1.brand {
  text-align: center;
}

p.subtitle {
  color: var(--muted);
  text-align: center;
  margin-top: 0;
  margin-bottom: 24px;
}

.progress {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.prompt {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 20px;
}

.question-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 42vh;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto 20px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button.option {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 1.05rem;
  text-align: left;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

button.option:active { transform: scale(0.98); }

button.option.selected {
  border-color: var(--accent);
  background: rgba(241, 196, 15, 0.12);
}

button.option:disabled {
  opacity: 0.55;
  cursor: default;
}
button.option:disabled:active { transform: none; }

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}

.nav-row-end {
  justify-content: flex-end;
}

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary[disabled], a.btn-secondary.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.btn-block { display: block; width: 100%; }

form.stack { display: flex; flex-direction: column; gap: 16px; }

label { font-weight: 600; display: block; margin-bottom: 6px; }

input[type="text"], input[type="password"], input[type="number"], input[type="file"], select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

table.admin-table select {
  width: auto;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 0.9rem;
}

.lei-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lei-swatch {
  border-radius: 12px;
  border: 2px solid var(--border);
  padding: 18px 10px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  color: #14172a;
}

.lei-swatch input { display: none; }
.lei-swatch.selected { outline: 3px solid var(--text); }

.error {
  background: rgba(224, 49, 49, 0.15);
  border: 1px solid var(--danger);
  color: #ffb3b3;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.banner-dev {
  background: var(--danger);
  color: white;
  padding: 8px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.center { text-align: center; }
.muted { color: var(--muted); }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.admin-nav a {
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-not_started { background: var(--border); color: var(--muted); }
.status-open { background: var(--ok); color: white; }
.status-closed { background: var(--danger); color: white; }
