/* Nanoco Shareholder Perception Study
   Design tokens
   ink:    #16232D  (primary text / headings)
   paper:  #FFFFFF  (card surfaces)
   canvas: #EEF1F3  (page background)
   accent: #8A6D3B  (muted brass — governance / proxy-document register)
   line:   #D8DEE3  (borders, rules)
   good:   #2F6F4E  (completed status)
   warn:   #B98900  (in-progress status)
   idle:   #6B7680  (not-started status)
*/

:root {
  --ink: #16232d;
  --paper: #ffffff;
  --canvas: #eef1f3;
  --accent: #8a6d3b;
  --accent-ink: #6e5629;
  --line: #d8dee3;
  --good: #2f6f4e;
  --warn: #b98900;
  --idle: #6b7680;
  --danger: #a5372e;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent-ink); }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--ink);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-header img.logo {
  height: 36px;
  display: block;
}

.site-header .brand-fallback {
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.site-header .study-name {
  color: #c9d3d9;
  font-size: 13px;
  border-left: 1px solid #3a4a56;
  padding-left: 14px;
  margin-left: 2px;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 48px 20px 80px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 1px 3px rgba(22, 35, 45, 0.06);
}

.card.wide { max-width: 760px; }

h1.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 6px;
}

p.lede {
  color: #45525c;
  margin: 0 0 28px;
  font-size: 15px;
}

label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  color: #2a3947;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 90px; }

.field { margin-bottom: 22px; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: #263948; }
.btn:disabled { background: #9aa5ac; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.secondary:hover { background: var(--canvas); }

.error-banner {
  background: #fbeceb;
  border: 1px solid #eec5c1;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 20px;
}

.info-banner {
  background: #eef4f0;
  border: 1px solid #cfe3d5;
  color: var(--good);
  padding: 12px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 20px;
}

.site-footer {
  text-align: center;
  font-size: 12.5px;
  color: #5b6870;
  padding: 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

/* --- Survey form --- */

.section-block {
  margin-bottom: 40px;
  padding-bottom: 8px;
}
.section-block + .section-block {
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 4px;
}

.section-block h2 {
  font-family: var(--font-display);
  font-size: 21px;
  margin: 0 0 22px;
}

.question-block { margin-bottom: 26px; }

.question-label {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.question-instruction {
  font-size: 12.5px;
  color: #6b7680;
  margin-bottom: 10px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14.5px;
}
.option-row input { width: 16px; height: 16px; flex-shrink: 0; }

.other-textbox { margin-top: 8px; margin-left: 26px; max-width: 380px; }

.progress-rail {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
}
.progress-rail .dot {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
}
.progress-rail .dot.active { background: var(--accent); }

.consent-block {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 20px;
  margin-top: 10px;
  font-size: 13.5px;
  color: #384750;
  line-height: 1.6;
}
.consent-block h3 {
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.consent-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: 14px;
}
.consent-checkbox-row input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }

/* --- Admin dashboard --- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
}
.stat-tile .num {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}
.stat-tile .lbl {
  font-size: 12.5px;
  color: #6b7680;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-tile.completed .num { color: var(--good); }
.stat-tile.started .num { color: var(--warn); }
.stat-tile.not_started .num { color: var(--idle); }

.dash-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
}
.dash-panel h2 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 18px;
}

table.codes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.codes-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7680;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}
table.codes-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f3;
}
.status-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
}
.status-pill.completed { background: #e4f1e9; color: var(--good); }
.status-pill.started { background: #fdf1d8; color: var(--warn); }
.status-pill.not_started { background: #e9ecee; color: var(--idle); }

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .card { padding: 26px; }
}
