/*
 * roiAI Constrained Governance Profiler — Shared Stylesheet
 * Applies to: all profiler pages (intro, question flow, contact, results)
 * Indicator color values: Doc 5 §3 (Output Page Specification)
 */

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

:root {
  /* Brand */
  --color-navy:          #1a2744;
  --color-navy-mid:      #243360;
  --color-blue:          #1e40af;
  --color-blue-hover:    #1d3a9a;

  /* Text */
  --color-text:          #111827;
  --color-text-secondary:#4b5563;
  --color-text-muted:    #9ca3af;

  /* Surfaces */
  --color-bg:            #ffffff;
  --color-bg-light:      #f9fafb;
  --color-border:        #e5e7eb;
  --color-border-light:  #f3f4f6;

  /* Dimension risk indicators — Doc 5 §3 */
  --color-low:           #2E7D32;
  --color-moderate:      #F9A825;
  --color-high:          #E65100;
  --color-critical:      #C62828;

  /* Layout */
  --max-width:           700px;
  --max-width-wide:      900px;

  /* Typography */
  --font-stack:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                         Oxygen, Ubuntu, Cantarell, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Brand bar
   ========================================================================== */

.brand-bar {
  background: var(--color-navy);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
}

.brand-name {
  color: #ffffff;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  margin-left: 0.875rem;
  padding-left: 0.875rem;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0;
}

/* ==========================================================================
   Page shell
   ========================================================================== */

.page-wrapper {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* ==========================================================================
   Container
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue);
  color: #ffffff;
  font-family: var(--font-stack);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
  min-height: 44px;       /* Doc 5 §8 Mobile: minimum 44px tap target */
  white-space: nowrap;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-blue-hover);
  outline: none;
}

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

/* ==========================================================================
   Disclosure / disclaimer
   Persistent on all output-facing pages — Doc 5 §3 Section 5, §6
   ========================================================================== */

.disclosure {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Introduction page — Doc 5 §9
   ========================================================================== */

.intro-page {
  padding: 4rem 0 3rem;
}

.intro-content {
  /* Intentionally narrow — executive scan document, not a dashboard */
}

.intro-headline {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.intro-subhead {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.intro-body {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 2.25rem;
  line-height: 1.7;
}

.intro-cta-wrap {
  margin-bottom: 1.25rem;
}

.intro-disclosure {
  margin-top: 0.25rem;
}

/* ==========================================================================
   Progress indicator — Doc 5 §8 Question Flow Mechanics
   "Question X of 10" — persistent throughout
   ========================================================================== */

.progress-bar-wrap {
  background: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
  padding: 0.875rem 1.5rem;
}

.progress-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-blue);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ==========================================================================
   Question flow — Doc 5 §8
   ========================================================================== */

.question-page {
  padding: 2.5rem 0 3rem;
}

.question-block {
  margin-bottom: 1.5rem;
  display: none;           /* Progressive reveal — shown via JS */
}

.question-block.active {
  display: block;
}

.question-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.option-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  min-height: 44px;        /* Doc 5 §8 Mobile: minimum 44px tap target */
  line-height: 1.5;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.option-label:hover {
  border-color: var(--color-blue);
  background: #eff6ff;
}

.option-label input[type="radio"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--color-blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.option-label input[type="radio"]:checked ~ span,
.option-label.selected {
  color: var(--color-navy);
  font-weight: 500;
}

.option-label:has(input[type="radio"]:checked) {
  border-color: var(--color-blue);
  background: #eff6ff;
}

/* Transition message — "Your profile is ready." */
.profile-ready-msg {
  text-align: center;
  padding: 2rem 0;
  display: none;
}

.profile-ready-msg h2 {
  font-size: 1.5rem;
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}

.profile-ready-msg p {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Contact capture form — Doc 5 §5
   ========================================================================== */

.contact-page {
  padding: 2.5rem 0 3rem;
}

.contact-intro {
  margin-bottom: 2rem;
}

.contact-intro p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.form-label .optional {
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 0.25rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-family: var(--font-stack);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  transition: border-color 0.12s ease;
  min-height: 44px;
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-input.error {
  border-color: var(--color-critical);
}

.field-error {
  font-size: 0.8125rem;
  color: var(--color-critical);
  margin-top: 0.375rem;
  display: none;
}

.field-error.visible {
  display: block;
}

.form-submit-wrap {
  margin-top: 1.75rem;
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

/* ==========================================================================
   Results page — Doc 5 §3
   ========================================================================== */

.results-page {
  padding: 2.5rem 0 3rem;
}

/* Directional statement — above the fold */
.directional-statement {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-navy);
  line-height: 1.55;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-light);
  border-left: 4px solid var(--color-navy);
  border-radius: 0 6px 6px 0;
  margin-bottom: 2rem;
}

/* Section headers */
.results-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Dimension indicator cards — Doc 5 §3 Section 2 */
.indicator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.indicator-card {
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  padding: 1.125rem 1.25rem;
}

.indicator-card__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.indicator-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.indicator-dot--low      { background: var(--color-low); }
.indicator-dot--moderate { background: var(--color-moderate); }
.indicator-dot--high     { background: var(--color-high); }
.indicator-dot--critical { background: var(--color-critical); }
.indicator-dot--aligned  { background: var(--color-low); }
.indicator-dot--not-aligned { background: var(--color-critical); }

.indicator-card__label {
  font-size: 0.875rem;
  font-weight: 600;
}

.indicator-label--low      { color: var(--color-low); }
.indicator-label--moderate { color: var(--color-moderate); }
.indicator-label--high     { color: var(--color-high); }
.indicator-label--critical { color: var(--color-critical); }
.indicator-label--aligned  { color: var(--color-low); }
.indicator-label--not-aligned { color: var(--color-critical); }

.indicator-card__desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* Route narrative — Doc 5 §3 Section 3 */
.route-narrative {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* CTA block — Doc 5 §3 Section 4 */
.cta-block {
  background: var(--color-navy);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 2rem;
  color: #ffffff;
}

.cta-block__heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.cta-block__subtext {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--color-navy);
  font-family: var(--font-stack);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.875rem 1.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 44px;
}

.btn-cta:hover {
  background: #f0f4ff;
}

/* PDF download — Doc 5 §3 Section 5 */
.pdf-section {
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pdf-section p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  flex: 1;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--color-bg-light);
  color: var(--color-navy);
  font-family: var(--font-stack);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  border: 1.5px solid var(--color-border);
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
  min-height: 44px;
  white-space: nowrap;
}

.btn-pdf:hover {
  border-color: var(--color-navy);
  background: var(--color-bg);
}

/* Results page disclaimer — Doc 5 §3 Section 5 */
.results-disclaimer {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-light);
}

/* ==========================================================================
   Inline form errors
   ========================================================================== */

.form-error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  color: var(--color-critical);
  display: none;
}

.form-error-banner.visible {
  display: block;
}

/* ==========================================================================
   Mobile — Doc 5 §8 Mobile Specification
   ========================================================================== */

@media (max-width: 767px) {

  .intro-page {
    padding: 2.5rem 0 2.5rem;
  }

  .indicator-grid {
    /* Doc 5 §8: single-column stack on screens below 768px */
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .btn-primary,
  .btn-cta {
    /* Doc 5 §8: CTA button full-width on mobile */
    width: 100%;
  }

  .cta-block {
    padding: 1.5rem 1.25rem;
  }

  .pdf-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-pdf {
    /* Doc 5 §8: PDF download button minimum 44px height — enforced via min-height above */
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Site footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  margin-top: auto;
}
