/* ============================================================
   BioDiGame — styles.css
   Mobile-first, nature/biodiversity theme
   Changing this comment so vercel accepts my mail 
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Rubik+Dirt&display=swap');

/* 1. CUSTOM PROPERTIES
   ============================================================ */
:root {
  --color-primary: #2d6a4f;
  --color-primary-hover: #1b4332;
  --color-primary-light: #52b788;
  --color-primary-lighter: #48ad7e;
  --color-accent: #ebf8ba;
  --color-bg: #2f8e55;
  --color-surface: #c2f6da;
  --color-surface-tint-1: #caf5d8;
  --color-surface-tint-2: #8de8a5;
  --color-surface-overlay-1: rgba(227, 242, 232, .72);
  --color-surface-overlay-2: rgba(210, 232, 216, .90);
  --color-footer: #387359;
  --color-border: #c8d9cf;
  --color-text: #1a2e25;
  --color-text-secondary: #4a5e55;
  --color-text-muted: #33453c;
  --color-link: #0f4c36;
  --color-link-hover: #083726;
  --color-heading: #10261d;
  --color-danger: #c0392b;
  --color-danger-bg: #fde8e8;
  --color-success-text: #155724;
  --color-success-bg: #d4edda;
  --color-warning-text: #856404;
  --color-warning-bg: #fff3cd;
  --color-draft-text: #383d41;
  --color-draft-bg: #e2e3e5;
  --color-locked-text: #6c757d;
  --color-locked-bg: #e9ecef;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .10);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .13);
  --touch-target: 44px;
  --bg-image: url("https://media.miasto-przyroda.pl/backgrounds/background-moss.png")
}

/* 2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--bg-image);
  background-repeat: repeat;
  opacity: 0.3;
  z-index: -2;
}

/* body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.16);
  z-index: -1;
  pointer-events: none;
} */

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  padding-left: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* 3. TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--color-heading);
  font-weight: 700;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.1rem;
}

h4 {
  font-size: 1rem;
}

p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.08em;
  font-weight: 600;
}

a:hover {
  color: var(--color-link-hover);
}

/* 4. LAYOUT
   ============================================================ */
.page-main {
  flex: 1;
  padding: 16px 12px;
  width: 100%;
}

/* 5. HEADER
   ============================================================ */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background-color: var(--color-primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 100vw;
}

.game-logo {
  max-width: 128px;
  min-width: 32px;
  max-height: 132px;
  min-height: 33px;
  width: 5vw;
  height: 5vw;
  margin: 1vh;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}

.site-title {
  color: white;
  text-decoration: none;
  font-weight: 400;
  font-size: 1.3rem;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-family: 'Rubik Dirt';
}

.site-title:hover {
  color: rgba(255, 255, 255, .85);
}

.site-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Game timer — rendered by timer.html */
#game-timer-wrapper {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, .9);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Account area — right side of header row */
.account {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  width: 100%;
  justify-content: space-evenly;
  padding: 0 12px 6px;
}

/* All buttons inside the header get a ghost style */
header button,
.header-inner a>button {
  background: rgba(255, 255, 255, .15);
  color: white;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  min-height: 34px;
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background .15s;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

header button:hover,
.header-inner a>button:hover {
  background: rgba(255, 255, 255, .28);
  border-color: rgba(255, 255, 255, .5);
}

/* Admin button — accent yellow */
#admin-button button {
  background: var(--color-accent);
  color: var(--color-text);
  border-color: transparent;
  font-weight: 600;
}

#admin-button button:hover {
  background: #f0b429;
}

/* Navigation tabs — second row, scrollable */
.nav-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px 10px;
  scrollbar-width: none;
  width: 100%;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs button {
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .95);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  min-height: 32px;
  font-size: 0.875rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background .15s;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, .25);
}

/* 6. FOOTER
   ============================================================ */
footer {
  background: var(--color-footer);
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  color: white;
  width: 100%;
  max-width: 100vw;
}

footer button {
  font-size: 0.82rem;
  padding: 5px 10px;
  min-height: 34px;
  color: rgba(255, 255, 255, .9);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

footer button:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* 7. BUTTONS
   ============================================================ */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--touch-target);
  padding: 10px 18px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}

button:hover {
  background: var(--color-primary-lighter);
  border-color: var(--color-primary-light);
  color: var(--color-primary-hover);
}

button:active {
  transform: scale(0.98);
}

/* Form submit buttons — primary green */
form button[type="submit"] {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

form button[type="submit"]:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: white;
}

/* Danger button */
.btn-danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-surface);
}

.btn-danger:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Button group — flex row of multiple buttons */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Small back button */
.back-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.back-bar button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* 8. FORMS
   ============================================================ */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--color-text);
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  display: block;
  width: 100%;
  font-size: 1rem;
  /* 16px prevents iOS zoom on focus */
  font-family: inherit;
  padding: 10px 12px;
  min-height: var(--touch-target);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, .18);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type="radio"],
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  margin: 0;
}

/* Checkbox/radio inline labels */
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  min-height: var(--touch-target);
  padding: 4px 0;
  cursor: pointer;
}

/* Fieldset (demographic form) */
fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 20px;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  min-height: var(--touch-target);
  padding: 2px 0;
}

legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* 9. BADGES & TAGS
   ============================================================ */
.answer-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  letter-spacing: .01em;
}

.answer-badge--correct {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.answer-badge--wrong {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.answer-badge--pending {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.answer-badge--draft {
  background: var(--color-draft-bg);
  color: var(--color-draft-text);
}

.answer-badge--locked {
  background: var(--color-locked-bg);
  color: var(--color-locked-text);
}

/* Inline badges used in answer-section h3 */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
}

.badge-correct {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.badge-wrong {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge-pending {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.badge-draft {
  background: var(--color-draft-bg);
  color: var(--color-draft-text);
}

/* Category tags */
.question-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

/* 10. ADMIN BADGES
   ============================================================ */
.admin-lock-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
}

.admin-lock-badge--locked {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.admin-lock-badge--unlocked {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.admin-lock-badge--unpublished {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

/* 11. QUESTION LIST
   ============================================================ */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-bar select {
  max-width: 100%;
  min-height: 42px;
}

.filter-bar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  min-height: var(--touch-target);
  padding: 4px 0;
  margin-bottom: 0;
}

#question-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#question-list li {
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm);
}

#question-list li::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1) 0%,
      var(--color-surface-overlay-2) 100%);
  pointer-events: none;
  z-index: 0;
}

#question-list li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

#question-list li>* {
  position: relative;
  z-index: 1;
}

#question-list li[style*="cursor: pointer"]:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

#question-list li h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-heading);
}

.question-points {
  font-size: 0.8em;
  font-weight: 400;
  color: var(--color-text-muted);
}

.answer-status {
  margin-top: 6px;
}

.lock-hint,
.unlocks-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.lock-hint-link {
  color: var(--color-link);
  cursor: pointer;
  text-decoration: underline;
}

.lock-hint-link:hover {
  color: var(--color-link-hover);
}

.unlocks-hint-title {
  font-style: italic;
  color: var(--color-text-secondary);
}

.admin-lock-hint,
.admin-unlocks-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.admin-lock-hint-link {
  color: var(--color-link);
  cursor: pointer;
  text-decoration: underline;
}

/* 12. QUESTION DETAIL
   ============================================================ */
.question-content {
  margin: 12px 0;
  padding: 16px;
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: break-word;
}

.question-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1) 0%,
      var(--color-surface-overlay-2) 100%);
  pointer-events: none;
  z-index: 0;
}

.question-content::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

.question-content > * {
  position: relative;
  z-index: 1;
}

.question-content img,
.question-content video {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.question-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.question-media img,
.question-media video {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Unlock info box */
.unlock-info {
  margin: 12px 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm);
}

.unlock-info::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1),
      var(--color-surface-overlay-2));
  pointer-events: none;
  z-index: 0;
}

.unlock-info::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

.unlock-info>* {
  position: relative;
  z-index: 1;
}

.unlock-info ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.unlock-info li {
  margin-bottom: 4px;
}

/* 13. ANSWER SECTION
   ============================================================ */
.answer-section {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm);
}

.answer-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1) 0%,
      var(--color-surface-overlay-2) 100%);
  pointer-events: none;
  z-index: 0;
}

.answer-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

.answer-section>* {
  position: relative;
  z-index: 1;
}

.answer-section h3 {
  margin-bottom: 12px;
  color: var(--color-heading);
}

.answer-content {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ABCD radio options — card-style */
.abcd-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.abcd-options label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  min-height: auto;
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-weight: 400;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 0;
  line-height: 1.5;
}

.abcd-options label:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-lighter);
}

.abcd-options input[type="radio"] {
  margin-top: 2px;
}

.answer-section .form-group {
  margin-bottom: 14px;
}

/* 14. LEADERBOARD
   ============================================================ */
#leaderboard h2 {
  margin-bottom: 4px;
  color: var(--color-heading);
}

#leaderboard>p {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#leaderboard table {
  border-collapse: collapse;
  width: 100%;
  min-width: 280px;
  font-size: 0.95rem;
}

#leaderboard th,
#leaderboard td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

#leaderboard thead th {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--color-bg);
}

#leaderboard tr.current-user td {
  font-weight: 700;
  background: var(--color-primary-lighter);
  color: var(--color-primary-hover);
}

#leaderboard tr.leaderboard-gap td {
  text-align: center;
  color: var(--color-text-muted);
  border-bottom: none;
  padding: 4px;
}

#leaderboard details {
  margin-top: 20px;
}

#leaderboard summary {
  cursor: pointer;
  color: var(--color-link);
  font-weight: 600;
  padding: 8px 0;
  user-select: none;
}

#leaderboard details table {
  margin-top: 10px;
}

/* 15. ACCOUNT PAGE
   ============================================================ */
#account {
  max-width: 480px;
}

#account h2 {
  margin-bottom: 4px;
  color: var(--color-heading);
}

#account h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

#account p {
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

#account label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  min-height: var(--touch-target);
  padding: 4px 0;
  margin-bottom: 0;
}

#account button {
  margin-top: 8px;
  width: 100%;
}

#logout-button {
  margin-top: 16px;
}

#change-password-form {
  margin-top: 8px;
}

#change-password-form button {
  width: auto;
}

/* 16. AUTH PAGES
   ============================================================ */
body.auth-page {
  background: var(--color-bg);
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  gap: 16px;
}

.auth-card {
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1) 0%,
      var(--color-surface-overlay-2) 100%);
  pointer-events: none;
  z-index: 0;
}

.auth-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

.auth-card>* {
  position: relative;
  z-index: 1;
}

.auth-card h2 {
  margin-bottom: 20px;
  color: var(--color-heading);
}

.auth-card .form-group {
  margin-bottom: 14px;
}

/* Checkbox labels in auth card */
.auth-card .check-label {
  font-size: 0.9rem;
}

.auth-card .check-label button[type="button"] {
  min-height: auto;
  padding: 2px 6px;
  font-size: 0.9rem;
  border-color: transparent;
  background: none;
  color: var(--color-link);
  text-decoration: underline;
  display: inline;
}

.auth-card .check-label button[type="button"]:hover {
  background: none;
  color: var(--color-link-hover);
}

.auth-alt-action {
  margin-top: 16px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.auth-alt-action button,
.auth-alt-action a>button {
  width: 100%;
}

.policy-viewer {
  max-width: 860px;
  width: 100%;
  padding: 0;
}

/* 17. ADMIN PANEL
   ============================================================ */
.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-nav button {
  white-space: nowrap;
  font-size: 0.9rem;
  padding: 8px 14px;
  min-height: 38px;
}

.admin-layout>#content {
  flex: 1;
  min-width: 0;
}

/* Admin item lists (users, categories, answers) */
.admin-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
}

.admin-item-list li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: background .15s;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm);
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
}

.admin-item-list li::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1) 0%,
      var(--color-surface-overlay-2) 100%);
  pointer-events: none;
  z-index: 0;
}

.admin-item-list li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

.admin-item-list li>* {
  position: relative;
  z-index: 1;
}

.admin-item-list li:last-child {
  border-bottom: none;
}

.admin-item-list li[style*="cursor: pointer"]:hover {
  background: var(--color-primary-lighter);
}

/* Admin section headings */
body.admin-page h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

/* 18. DEMOGRAPHIC FORM
   ============================================================ */
.likert-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px -4px 0;
}

.likert-wrapper table {
  min-width: 340px;
  width: 100%;
  border-collapse: collapse;
}

.likert-wrapper th,
.likert-wrapper td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.likert-wrapper th:first-child {
  text-align: left;
  font-weight: 500;
  min-width: 130px;
  padding-right: 10px;
}

.likert-wrapper thead th {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

/* 19. CONTENT BLOCKS
   ============================================================ */
article {
  padding: 16px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--color-surface-tint-1) 0%, var(--color-surface-tint-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

article::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      var(--color-surface-overlay-1) 0%,
      var(--color-surface-overlay-2) 100%);
  pointer-events: none;
  z-index: 0;
}

article::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  pointer-events: none;
  z-index: 0;
}

article>* {
  position: relative;
  z-index: 1;
}

article:last-child {
  margin-bottom: 0;
}

article h2 {
  color: var(--color-heading);
  margin-bottom: 10px;
}

.trix-content {
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--color-text);
}

.trix-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.trix-content a {
  color: var(--color-link);
}

/* 20. MEDIA COMPONENTS
   ============================================================ */
.media-preview {
  position: relative;
  display: inline-block;
}

.media-preview img,
.media-preview video {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* Upload status text */
span[id$="-status"] {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: inline-block;
  margin-left: 8px;
}

/* 21. UTILITIES
   ============================================================ */
.text-error {
  color: var(--color-danger);
  font-size: 0.9rem;
  margin-top: 8px;
  margin-bottom: 0;
}

.text-success {
  color: var(--color-success-text);
  font-size: 0.9rem;
  margin-top: 8px;
  margin-bottom: 0;
}

.text-muted {
  color: var(--color-text-muted);
}

/* 22. DESKTOP ENHANCEMENTS
   ============================================================ */
@media (min-width: 640px) {
  .page-main {
    padding: 28px 24px;
    max-width: 860px;
    margin: 0 auto;
  }

  .header-inner {
    padding: 12px 24px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .nav-tabs {
    padding: 0 24px 12px;
    max-width: 1100px;
    margin: 0 auto;
  }

  footer {
    padding: 14px 24px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .auth-main {
    justify-content: center;
    padding: 40px 24px;
  }

  .auth-card {
    padding: 36px 40px;
  }

  .filter-bar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .filter-bar select {
    max-width: 220px;
  }

  .question-media img,
  .question-media video {
    max-height: 400px;
  }
}

@media (min-width: 800px) {
  .admin-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
  }

  .admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    min-width: 160px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-border);
    padding-right: 20px;
  }

  .admin-nav button {
    width: 100%;
    justify-content: flex-start;
  }
}