/*
 * diagnostic.css
 * Scoped styles for the AI Maturity Diagnostic tool.
 * All selectors are prefixed with .diag- to avoid collision with site styles.
 *
 * Design intent: premium, restrained, institutional.
 * Appropriate for investment firm and professional services audiences.
 * No animations beyond a single subtle fade-in. No decorative colour.
 */

/* ─────────────────────────────────────────────────────────────────────────────
   Shell and container
───────────────────────────────────────────────────────────────────────────── */

.diag-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: inherit; /* use site's body font (sans-serif) */
  color: #1a1a1a;
}

@media (max-width: 600px) {
  .diag-shell {
    padding: 32px 16px 64px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Intro screen
───────────────────────────────────────────────────────────────────────────── */

.diag-intro {
  max-width: 540px;
}

.diag-intro-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.25;
  color: #1a1a1a;
  margin: 0 0 12px;
}

.diag-intro-subheadline {
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
  margin: 0 0 24px;
}

.diag-intro-body {
  font-size: 1.2rem;
  line-height: 1.75;
  color: #444;
  margin: 0 0 36px;
}

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

.diag-btn-primary,
.diag-btn-secondary {
  display: inline-block;
  font-family: inherit;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.diag-btn-primary {
  background: #1a1a1a;
  color: #ffffff;
  padding: 13px 28px;
}

.diag-btn-primary:hover:not(:disabled) {
  background: #333;
}

.diag-btn-primary:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.diag-btn-secondary {
  background: transparent;
  color: #1a1a1a;
  padding: 12px 20px;
  border: 1px solid #c8c8c8;
}

.diag-btn-secondary:hover {
  border-color: #1a1a1a;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Progress indicator
───────────────────────────────────────────────────────────────────────────── */

.diag-progress {
  margin: 0 0 32px;
}

.diag-progress-bar {
  height: 2px;
  background: #e8e8e8;
  margin-bottom: 8px;
  overflow: hidden;
}

.diag-progress-fill {
  height: 100%;
  background: var(--color-primary, #1a1a1a);
  transition: width 0.25s ease;
}

.diag-progress-label {
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Question step
───────────────────────────────────────────────────────────────────────────── */

.diag-question-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 3vw, 1.35rem);
  font-weight: 400;
  line-height: 1.45;
  color: #1a1a1a;
  margin: 0 0 28px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Answer options
───────────────────────────────────────────────────────────────────────────── */

.diag-options {
  border: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diag-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #d8d8d8;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #1a1a1a;
}

.diag-option:hover {
  border-color: #aaa;
  background: #fafafa;
}

.diag-option input[type="radio"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.diag-option--selected {
  border-color: #1a1a1a;
  background: #f9f9f9;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Navigation row
───────────────────────────────────────────────────────────────────────────── */

.diag-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Loading state
───────────────────────────────────────────────────────────────────────────── */

.diag-loading {
  padding: 64px 0;
  text-align: center;
}

.diag-spinner {
  font-size: 0.9375rem;
  color: #666;
  letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Result — stage headline
───────────────────────────────────────────────────────────────────────────── */

.diag-result-inner {
  animation: diag-fadein 0.3s ease;
}

@keyframes diag-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.diag-result-stage {
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e8e8e8;
}

.diag-result-stage-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.diag-result-stage-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 400;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Result — stage summary
───────────────────────────────────────────────────────────────────────────── */

.diag-result-summary {
  margin: 0 0 28px;
}

.diag-result-summary p {
  font-size: 1rem;
  line-height: 1.75;
  color: #333;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Teaser signal banner
───────────────────────────────────────────────────────────────────────────── */

.diag-teaser-signal {
  padding: 16px 20px;
  margin: 0 0 36px;
  background: #faf9f7;
  border-left: 3px solid #aaa;
}

.diag-teaser-signal p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #333;
}

.diag-banner--inflated {
  border-left-color: #b8860b;
}

.diag-banner--fragile {
  border-left-color: #b8860b;
}

.diag-banner--ready {
  border-left-color: #4a7c59;
}

.diag-banner--neutral {
  border-left-color: #aaa;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CTA section — email capture
───────────────────────────────────────────────────────────────────────────── */

.diag-cta {
  border-top: 1px solid #e8e8e8;
  padding-top: 32px;
  margin-top: 8px;
}

.diag-cta h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #1a1a1a;
  margin: 0 0 10px;
}

.diag-cta > p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #555;
  margin: 0 0 24px;
}

.diag-email-form {
  margin: 0 0 24px;
}

.diag-email-form-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.diag-email-form-fields input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid #d8d8d8;
  background: #fff;
  color: #1a1a1a;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.12s ease;
}

.diag-email-form-fields input:focus {
  border-color: #1a1a1a;
}

.diag-email-form-fields input::placeholder {
  color: #aaa;
}

.diag-email-form .diag-form-error {
  font-size: 0.8125rem;
  color: #b8000b;
  margin: 0 0 12px;
  display: none;
}

.diag-email-form .diag-form-error--visible {
  display: block;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Advisor CTA link
───────────────────────────────────────────────────────────────────────────── */

.diag-advisor-cta {
  margin-top: 16px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Confirmation state
───────────────────────────────────────────────────────────────────────────── */

.diag-confirmation {
  border-top: 1px solid #e8e8e8;
  padding-top: 32px;
  margin-top: 8px;
}

.diag-confirmation-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #333;
  margin: 0 0 24px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Error state
───────────────────────────────────────────────────────────────────────────── */

.diag-error {
  padding: 40px 0;
}

.diag-error-message {
  font-size: 0.9375rem;
  color: #444;
  margin: 0 0 20px;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Screen-reader utility
───────────────────────────────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Hidden utility
───────────────────────────────────────────────────────────────────────────── */

[hidden] {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Constraint hint
   Displays the primary constraint foundation name after the teaser signal.
   Shows the foundation label only (e.g. "Data Readiness") — not scores or copy.
───────────────────────────────────────────────────────────────────────────── */

.diag-constraint-hint {
  margin: 0 0 24px;
  padding: 14px 20px;
  background: #f5f4f1;
  border-left: 3px solid #c8c0b0;
}

.diag-constraint-hint p {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Email capture CTA — bullet list
   Replaces the single prose ctaBody paragraph with a structured list.
───────────────────────────────────────────────────────────────────────────── */

.diag-cta-intro {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  color: #444;
  line-height: 1.6;
}

.diag-cta-list {
  margin: 0 0 24px;
  padding-left: 20px;
  list-style: disc;
}

.diag-cta-list li {
  font-size: 0.9375rem;
  color: #333;
  line-height: 1.7;
  margin: 0 0 4px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Company type screen — Other free-text input
   Renders below the option list when "Other" is selected.
   Uses the same visual language as the email-form inputs for consistency.
───────────────────────────────────────────────────────────────────────────── */

#diag-ct-other-wrap {
  margin-bottom: 28px;
}

.diag-ct-other-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1px solid #d8d8d8;
  background: #fff;
  color: #1a1a1a;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.12s ease;
}

.diag-ct-other-input:focus {
  border-color: #1a1a1a;
}

.diag-ct-other-input::placeholder {
  color: #aaa;
}
