/* ============================================================
   Polaris Crescent — Polaris AI Assessment Assessment Stylesheet
   ============================================================ */

:root {
  --navy: #1e3a5f;
  --navy-dark: #152d4a;
  --navy-light: #2a4f7c;
  --gold: #c9a227;
  --gold-light: #e0b93a;
  --gold-dark: #a88520;
  --bg: #f8f9fa;
  --bg-alt: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --error: #ef4444;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Open Sans', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.13);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--navy); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   HEADER
   ============================================================ */
.assess-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.assess-home-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}
.assess-home-link:hover { color: var(--gold-light); }
.assess-logo {
  /* Width-first: explicit width, height scales — never overflows header */
  width: 150px;
  height: auto;
  max-width: 150px;
  display: block;
  object-fit: contain;
}

@media (max-width: 640px) {
  .assess-logo { width: 120px; max-width: 120px; height: auto; }
  .assess-header { padding: 12px 16px; }
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 50px;
  transition: width 0.5s ease;
  width: 0%;
}
.progress-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 36px;
  text-align: right;
}

/* ============================================================
   MAIN / SCREENS
   ============================================================ */
.assess-main {
  flex: 1;
  padding: 40px 16px 60px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.screen { display: none; width: 100%; max-width: 820px; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* Card */
.screen-card {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 52px 56px;
  width: 100%;
}

@media (max-width: 700px) {
  .screen-card { padding: 32px 20px; }
  .assess-main { padding: 24px 12px 48px; }
}

/* ============================================================
   WELCOME SCREEN
   ============================================================ */
.welcome-card { text-align: center; }

.welcome-star {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.welcome-star svg { width: 64px; height: 64px; }

.welcome-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 16px;
}
.welcome-title span { color: var(--gold-dark); }

.welcome-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.welcome-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.75;
}

.welcome-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  max-width: 400px;
  margin: 0 auto 36px;
}
.welcome-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}
.welcome-features i { color: var(--gold); font-size: 1rem; }

.assess-save-note {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.assess-save-note i { color: var(--navy); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-assess {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-assess-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 4px 14px rgba(30,58,95,0.25);
}
.btn-assess-primary:hover {
  background: var(--navy-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,58,95,0.35);
}
.btn-assess-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-assess-outline:hover {
  border-color: var(--navy);
  color: var(--navy);
  transform: translateY(-1px);
}
.btn-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 40px;
  flex-wrap: wrap;
}
.btn-row .btn-assess-primary { margin-left: auto; }

/* ============================================================
   CLIENT FORM
   ============================================================ */
.dim-header { margin-bottom: 36px; }
.dim-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 10px;
}
.dim-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.dim-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.client-form { display: flex; flex-direction: column; gap: 20px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}
.field-group .req { color: var(--error); }
.field-group .opt { color: var(--text-muted); font-weight: 400; }

.field-group input,
.field-group select {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}
.field-group input:focus,
.field-group select:focus {
  border-color: var(--navy);
  background: #fff;
}
.field-group input.error,
.field-group select.error { border-color: var(--error); }

/* ============================================================
   DIMENSION QUESTIONS
   ============================================================ */
.questions-list { display: flex; flex-direction: column; gap: 32px; }

.question-block { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }

.question-text {
  background: linear-gradient(135deg, rgba(30,58,95,0.03), rgba(30,58,95,0.01));
  padding: 20px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
.question-num {
  display: inline-block;
  width: 26px; height: 26px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
  margin-right: 10px;
  flex-shrink: 0;
  vertical-align: middle;
}

.answer-options { padding: 8px 0; }

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.answer-option:hover { background: rgba(30,58,95,0.03); }
.answer-option.selected {
  background: rgba(201,162,39,0.08);
  border-left-color: var(--gold);
}

.answer-option input[type="radio"] { display: none; }

.radio-custom {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.answer-option.selected .radio-custom {
  border-color: var(--gold);
  background: var(--gold);
}
.answer-option.selected .radio-custom::after {
  content: '';
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
}

.option-score {
  min-width: 24px;
  height: 24px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: var(--transition);
}
.answer-option.selected .option-score {
  background: var(--gold);
  color: #fff;
}

.option-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  transition: color 0.15s;
}
.answer-option.selected .option-label { color: var(--text); }

/* Unanswered highlight */
.question-block.unanswered { border-color: var(--error); }
.question-block.unanswered .question-text { border-bottom-color: rgba(239,68,68,0.2); }

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.results-card { padding: 48px; }
@media (max-width: 700px) { .results-card { padding: 28px 16px; } }

.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 80px 40px;
  color: var(--text-muted);
  font-size: 1rem;
}
.loading-spinner {
  width: 52px; height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.results-logo {
  /* Width-first: explicit width, height scales proportionally */
  width: 180px;
  height: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
  /* Results page has white background — full color logo */
}
.results-client-name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}
.results-date { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }

/* Overall score */
.overall-score-wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.overall-score-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 4px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-inner { text-align: center; line-height: 1; }
.score-number {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--gold-light);
}
.score-denom { font-size: 0.875rem; color: rgba(255,255,255,0.6); display: block; }

.maturity-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}
.badge-initial    { background: rgba(239,68,68,0.2);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.badge-emerging   { background: rgba(249,115,22,0.2);  color: #fdba74; border: 1px solid rgba(249,115,22,0.4); }
.badge-developing { background: rgba(234,179,8,0.2);   color: #fde047; border: 1px solid rgba(234,179,8,0.4); }
.badge-established{ background: rgba(34,197,94,0.2);   color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
.badge-leading    { background: rgba(201,162,39,0.25); color: #e0b93a; border: 1px solid rgba(201,162,39,0.5); }

.overall-label { color: rgba(255,255,255,0.7); font-size: 0.875rem; }

/* Radar */
.results-radar-wrap {
  max-width: 440px;
  margin: 0 auto 40px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
}

/* Dimension score bars */
.results-section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.dimension-scores { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }

.dim-score-row {
  display: grid;
  grid-template-columns: 160px 1fr 70px;
  align-items: center;
  gap: 16px;
}
@media (max-width: 600px) {
  .dim-score-row { grid-template-columns: 110px 1fr 55px; gap: 10px; }
}
.dim-score-name { font-size: 0.875rem; font-weight: 600; color: var(--navy); }
.dim-score-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.dim-score-bar-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  transition: width 1s ease;
}
.dim-score-value { font-size: 0.875rem; font-weight: 700; color: var(--text-muted); text-align: right; }
.dim-score-weight { font-size: 0.75rem; color: var(--text-muted); }

/* Priorities */
.priorities-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.priority-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
}
.priority-rank {
  width: 36px; height: 36px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.priority-name { font-weight: 600; color: var(--navy); font-size: 0.9375rem; flex: 1; }
.priority-score { font-size: 0.875rem; color: var(--error); font-weight: 700; }

/* Next steps */
.next-steps-box {
  background: linear-gradient(135deg, rgba(30,58,95,0.04), rgba(201,162,39,0.06));
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 36px;
}
.next-steps-box h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.next-steps-box h3 i { color: var(--gold); }
.next-steps-box p { color: var(--text-muted); line-height: 1.7; }

.results-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.results-footer {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 2;
}
.results-footer a { color: var(--navy); font-weight: 600; }

/* ============================================================
   FOOTER
   ============================================================ */
.assess-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.8125rem;
}
.assess-footer a { color: rgba(255,255,255,0.7); }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .assess-header, .assess-footer, .progress-bar-wrap,
  .btn-row, .results-ctas { display: none !important; }
  .screen-card { box-shadow: none; padding: 0; }
  body { background: #fff; }
}
