/* ==========================================================================
   Edinburgh Worldwide Investment Trust — Shareholder Perception Study
   Design tokens:
   Colors:
     --ink:        #10233F  (deep navy — headings, primary text)
     --ink-soft:   #3C5578  (secondary text, muted labels)
     --paper:      #F6F4EF  (warm off-white page background)
     --panel:      #FFFFFF  (card/panel surfaces)
     --line:       #D9D3C4  (hairline borders/dividers)
     --gold:       #A6813C  (accent — the ONE warm note: progress, focus, CTAs)
     --gold-soft:  #EFE6D3  (gold tint for active/selected states)
   Type:
     Display  — 'Fraunces' (serif, used sparingly for headings: gravitas + a touch of warmth)
     Body     — 'Inter' (clean, legible, does the heavy lifting)
   Layout: single centred column, generous whitespace, a slow-arcing
   "meridian" line as the signature motif — a nod to "Worldwide" — used as
   the progress indicator and as a quiet divider, never decorative filler.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #10233f;
  --ink-soft: #3c5578;
  --paper: #f6f4ef;
  --panel: #ffffff;
  --line: #d9d3c4;
  --gold: #a6813c;
  --gold-soft: #efe6d3;
  --error: #a3342c;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 64px;
}

.masthead {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.masthead-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.masthead-text {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead-text strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-family: 'Fraunces', serif;
}

.panel {
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin-bottom: 1.4em;
}

label {
  display: block;
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
}

input[type="text"]:focus,
input[type="password"]:focus,
button:focus-visible,
.choice-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

button.primary {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 13px 26px;
  font-size: 0.98rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

button.primary:hover { background: #0a1830; }
button.primary:disabled { background: var(--ink-soft); cursor: not-allowed; opacity: 0.6; }

button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
}

.error-message {
  color: var(--error);
  font-size: 0.92rem;
  margin-top: 12px;
  min-height: 1.2em;
}

.footer-note {
  margin-top: 32px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 500px;
}

/* Meridian progress — the signature motif: an arcing line, like a
   longitude meridian, sweeping left to right as the respondent progresses. */
.meridian-progress {
  width: 100%;
  max-width: 640px;
  margin-bottom: 28px;
}

.meridian-track {
  position: relative;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.meridian-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.meridian-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}

.question-text {
  font-size: 1.15rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.scale-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.choice-btn {
  flex: 1;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-btn:hover { border-color: var(--gold); }
.choice-btn.selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  font-weight: 500;
}

.choice-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.choice-list .choice-btn { text-align: left; padding: 14px 16px; }

.scale-caption {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.consent-row input { margin-top: 3px; }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

table.admin-table th {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
}
.status-pill.not_started { background: #eee; color: var(--ink-soft); }
.status-pill.started { background: var(--gold-soft); color: var(--gold); }
.status-pill.completed { background: #dbe9dd; color: #2c6b3f; }
.status-pill.screened_out { background: #f0dede; color: #a3342c; }

@media (max-width: 480px) {
  .panel { padding: 28px 20px; }
  .scale-row { flex-wrap: wrap; }
}
