/* =========================================================================
   style.css — AI Capability Assessment
   Design: clean, professional, GOV.UK-inspired colour palette
   No external fonts or frameworks required.
   ========================================================================= */

/* ── Reset & base ────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: #0b0c0c;
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

main.container {
  flex: 1;
  padding-top: 40px;
  padding-bottom: 64px;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.site-header {
  background-color: #1d3557;
  border-bottom: 4px solid #457b9d;
  padding: 14px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header-partners {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.03em;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer {
  background-color: #1d3557;
  padding: 20px 0;
}

.site-footer p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

/* ── Typography ──────────────────────────────────────────────────────── */

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1d3557;
  margin-bottom: 16px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1d3557;
  margin-bottom: 12px;
  margin-top: 24px;
}

h2:first-child {
  margin-top: 0;
}

p {
  margin-bottom: 14px;
  color: #0b0c0c;
}

p:last-child {
  margin-bottom: 0;
}

p.lead {
  font-size: 1.1rem;
  color: #3a3a3a;
  margin-bottom: 24px;
}

/* ── Progress bar ────────────────────────────────────────────────────── */

.progress-section {
  margin-bottom: 28px;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: #505a5f;
  margin-bottom: 8px;
}

.progress-bar-outer {
  background-color: #d9d9d9;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-inner {
  background-color: #1d3557;
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 4px; /* always visible even at 0 */
}

/* ── Collapsible scenario reminder ──────────────────────────────────── */

.scenario-page-title {
  font-size: 1.4rem;
  margin-top: 24px;
  margin-bottom: 20px;
}

.scenario-reminder-hint {
  font-size: 0.85rem;
  color: #505a5f;
  margin-bottom: 6px;
}

.scenario-reminder {
  border: 1px solid #ccd1d9;
  border-left: 5px solid #1d3557;
  border-radius: 0 6px 6px 0;
  margin-bottom: 24px;
  background: #ffffff;
}

.scenario-reminder summary {
  padding: 12px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #457b9d;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scenario-reminder summary::-webkit-details-marker { display: none; }

.scenario-reminder summary::before {
  content: "▶";
  font-size: 0.65rem;
  transition: transform 0.2s;
}

.scenario-reminder[open] summary::before {
  transform: rotate(90deg);
}

.scenario-reminder .scenario-text {
  padding: 0 18px 16px;
  font-size: 0.95rem;
  color: #505a5f;
  line-height: 1.75;
  margin-bottom: 0;
}

/* ── Scenario card ───────────────────────────────────────────────────── */

.scenario-card {
  background: #ffffff;
  border: 1px solid #ccd1d9;
  border-left: 5px solid #1d3557;
  border-radius: 0 6px 6px 0;
  padding: 24px 28px;
  margin-bottom: 32px;
}

.scenario-card--compact {
  padding: 16px 20px;
  margin-bottom: 20px;
}

.scenario-card--compact .scenario-text {
  font-size: 0.9rem;
  color: #505a5f;
}

.scenario-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #457b9d;
  margin-bottom: 10px;
}

.scenario-card h2 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 14px;
}

.scenario-text {
  font-size: 1rem;
  line-height: 1.75;
  color: #0b0c0c;
  margin-bottom: 0;
}

/* ── Primary question card ───────────────────────────────────────────── */

.question-card {
  background: #eef4fb;
  border: 1px solid #b0cce4;
  border-left: 5px solid #457b9d;
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.question-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #457b9d;
  margin-bottom: 10px;
}

.question-card p {
  font-size: 1.05rem;
  font-weight: 500;
  color: #1d3557;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── Follow-up card ──────────────────────────────────────────────────── */

.followup-card {
  background: #eef4fb;
  border: 1px solid #b0cce4;
  border-left: 5px solid #457b9d;
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.followup-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #457b9d;
  margin-bottom: 10px;
}

.followup-card p {
  font-size: 1.05rem;
  font-weight: 500;
  color: #1d3557;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── Info / intro card ───────────────────────────────────────────────── */

.page-intro {
  margin-bottom: 28px;
}

.info-card {
  background: #ffffff;
  border: 1px solid #ccd1d9;
  border-radius: 6px;
  padding: 28px 32px;
  margin-bottom: 36px;
}

.info-card h2 {
  font-size: 1.05rem;
}

.info-card ul {
  padding-left: 22px;
  margin-bottom: 8px;
}

.info-card li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #3a3a3a;
}

/* ── Forms ───────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 28px;
}

label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #0b0c0c;
  margin-bottom: 6px;
}

.hint {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: #505a5f;
  margin-top: 4px;
  margin-bottom: 8px;
}

input[type="text"] {
  display: block;
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: #0b0c0c;
  border: 2px solid #505a5f;
  border-radius: 4px;
  background: #ffffff;
  transition: border-color 0.15s;
}

input[type="text"]:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  border-color: #0b0c0c;
}

textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.65;
  color: #0b0c0c;
  border: 2px solid #505a5f;
  border-radius: 4px;
  background: #ffffff;
  resize: vertical;
  min-height: 200px;
  transition: border-color 0.15s;
}

textarea:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  border-color: #0b0c0c;
}

.char-counter {
  font-size: 0.8rem;
  color: #505a5f;
  margin-top: 6px;
  text-align: right;
  min-height: 1.2em;
}

.char-counter.warn {
  color: #d4351c;
  font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 13px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: #1d3557;
  color: #ffffff;
  border-color: #1d3557;
}

.btn-primary:hover {
  background-color: #16293f;
  border-color: #16293f;
}

.btn-primary:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 2px;
}

/* ── Voice input ─────────────────────────────────────────────────────── */

.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.btn-mic {
  background-color: #ffffff;
  color: #1d3557;
  border-color: #1d3557;
  font-size: 0.9rem;
  padding: 9px 18px;
}

.btn-mic:hover {
  background-color: #eef4fb;
}

.btn-mic:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 2px;
}

.btn-mic.recording {
  background-color: #d4351c;
  color: #ffffff;
  border-color: #d4351c;
  animation: pulse 1.2s infinite;
}

.btn-mic.recording:hover {
  background-color: #b52d17;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

.voice-status {
  font-size: 0.85rem;
  color: #505a5f;
}

.voice-status.error {
  color: #d4351c;
}

/* ── Error banner ────────────────────────────────────────────────────── */

.error-banner {
  background-color: #fff3f2;
  border: 1px solid #d4351c;
  border-left: 5px solid #d4351c;
  border-radius: 0 4px 4px 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.error-banner p {
  color: #d4351c;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

/* ── Complete page ───────────────────────────────────────────────────── */

.complete-box {
  background: #ffffff;
  border: 1px solid #ccd1d9;
  border-top: 5px solid #00703c;
  border-radius: 0 0 6px 6px;
  padding: 48px 40px;
  text-align: center;
  margin-top: 20px;
}

.complete-tick {
  font-size: 3.5rem;
  color: #00703c;
  margin-bottom: 20px;
}

.complete-box h1 {
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.complete-box .lead {
  font-size: 1.1rem;
  color: #3a3a3a;
  margin-bottom: 16px;
}

.participant-ref {
  margin-top: 28px;
  font-size: 0.9rem;
  color: #505a5f;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .info-card {
    padding: 20px 18px;
  }

  .complete-box {
    padding: 32px 20px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}
