/* =====================================================================
   DeepThink Compliance Scan — Main CSS
   Brand tokens from .claude/rules/brand-visual.md
   ===================================================================== */

/* ------------------------------------------------------------------
   Brand tokens
   ------------------------------------------------------------------ */
:root {
  --color-bg:       #F8F7F5;
  --color-primary:  #262626;
  --color-body:     #5C5C5C;
  --color-accent:   #DA204B;
  --color-border:   #E0E0E0;
  --color-tertiary: #7D8B94;
  --color-white:    #FFFFFF;
  --color-surface:  #FFFFFF;

  --font-display:   'Poppins', sans-serif;
  --font-body:      'Lora', Georgia, serif;
  --font-wordmark:  'Questrial', sans-serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(38, 38, 38, 0.08);
  --shadow-md: 0 4px 16px rgba(38, 38, 38, 0.10);
}

/* ------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
input, button, select, textarea { font: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* ------------------------------------------------------------------
   Base typography
   ------------------------------------------------------------------ */
body {
  background: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-primary);
  line-height: 1.25;
}
h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }

/* ------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------ */
.nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.nav-wordmark {
  font-family: var(--font-wordmark);
  font-size: 20px;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}
.nav-separator {
  width: 1px; height: 16px;
  background: var(--color-border); flex-shrink: 0;
}
.nav-product-label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 13px;
  color: var(--color-tertiary);
}
.nav-right {
  display: flex; align-items: center; gap: 16px;
}
.nav-email {
  font-size: 13px; color: var(--color-tertiary);
}
.nav-link {
  font-family: var(--font-display);
  font-weight: 600; font-size: 13px;
  color: var(--color-primary);
}

/* ------------------------------------------------------------------
   Flash messages
   ------------------------------------------------------------------ */
.flash-container { padding: 0 32px; margin-top: 16px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 8px;
}
.flash--error { background: #FEF2F2; color: #8B1A2E; border: 1px solid #FECACA; }
.flash--success { background: #F0FDF4; color: #14532D; border: 1px solid #BBF7D0; }

/* ------------------------------------------------------------------
   Main + Footer
   ------------------------------------------------------------------ */
.main { flex: 1; padding: 32px 32px 80px; }

.footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-tertiary);
}
.footer-disclaimer { margin-top: 4px; font-style: italic; font-size: 12px; }

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none; cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--color-accent); color: var(--color-white); }
.btn--secondary { background: var(--color-primary); color: var(--color-white); }
.btn--ghost {
  background: transparent; color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-primary); }
.btn--full { width: 100%; }
.btn--lg { padding: 14px 32px; font-size: 16px; }
.btn--sm { padding: 8px 16px; font-size: 13px; }

/* ------------------------------------------------------------------
   Form elements
   ------------------------------------------------------------------ */
.field-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600; font-size: 14px;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--color-primary);
  background: var(--color-white);
  transition: border-color 0.15s;
}
.field-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.field-group { margin-bottom: 24px; }

/* ------------------------------------------------------------------
   Auth screens
   ------------------------------------------------------------------ */
.auth-wrapper {
  display: flex; justify-content: center; padding-top: 48px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-sm);
}
.auth-title {
  font-size: 26px; margin-bottom: 12px;
}
.auth-body {
  color: var(--color-body); margin-bottom: 24px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-note {
  font-size: 13px; color: var(--color-tertiary); margin-top: 16px;
}

/* ------------------------------------------------------------------
   Progress bar
   ------------------------------------------------------------------ */
.progress-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 0 0;
}
.progress-label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 12px;
  color: var(--color-tertiary);
  letter-spacing: 0.05em;
  text-align: right;
  margin-bottom: 6px;
}
.progress-bar {
  width: 100%; height: 4px;
  background: var(--color-border);
  border-radius: 2px; overflow: hidden;
  margin-bottom: 24px;
}
.progress-fill {
  height: 100%; background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.4s ease;
}
.progress-fill.complete { background: var(--color-accent); }

/* ------------------------------------------------------------------
   Question/assessment screens
   ------------------------------------------------------------------ */
.question-screen { max-width: 680px; margin: 0 auto; }

.question-container {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 48px 40px;
  box-shadow: var(--shadow-sm);
}

.step-label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}
.question-text {
  font-family: var(--font-display);
  font-weight: 600; font-size: 20px;
  color: var(--color-primary);
  line-height: 1.35;
  margin-bottom: 8px;
}
.question-note {
  font-style: italic; font-size: 14px;
  color: var(--color-tertiary); margin-bottom: 28px;
}
.question-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.question-meta__framework {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  background: var(--color-primary); color: var(--color-white);
  padding: 2px 8px; border-radius: 2px;
  letter-spacing: 0.05em;
}
.question-meta__domain, .question-meta__ref {
  font-size: 12px; color: var(--color-tertiary);
}

/* ------------------------------------------------------------------
   Answer options
   ------------------------------------------------------------------ */
.answer-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }

.answer-option {
  display: flex; flex-direction: column;
  padding: 16px 20px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.answer-option:hover { border-color: var(--color-primary); }
.answer-option.selected {
  border-color: var(--color-accent);
  background: #FFF6F8;
}
.answer-option__label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 14px;
  color: var(--color-primary);
}
.answer-option__sub {
  font-size: 12px; color: var(--color-tertiary); margin-top: 4px;
}

/* ------------------------------------------------------------------
   Sector cards
   ------------------------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 8px;
}
.sector-card {
  padding: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.sector-card:hover { border-color: var(--color-primary); }
.sector-card.selected {
  border-color: var(--color-accent);
  background: #FFF6F8;
}
.sector-card__label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 13px;
  color: var(--color-primary);
}

/* ------------------------------------------------------------------
   Radio groups
   ------------------------------------------------------------------ */
.radio-group { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-group--stacked { flex-direction: column; }

.radio-option { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio-option--card {
  padding: 14px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, background 0.15s;
}
.radio-option--card:hover { border-color: var(--color-primary); }
.radio-option--card:has(input:checked) {
  border-color: var(--color-accent);
  background: #FFF6F8;
}
.radio-option__label {
  font-family: var(--font-display);
  font-weight: 600; font-size: 14px;
  color: var(--color-primary);
}

/* ------------------------------------------------------------------
   Form actions
   ------------------------------------------------------------------ */
.form-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 32px;
}

/* ------------------------------------------------------------------
   Save banner
   ------------------------------------------------------------------ */
.save-banner {
  max-width: 680px; margin: 0 auto 16px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px; color: #0369A1;
}

/* ------------------------------------------------------------------
   Scope confirmation
   ------------------------------------------------------------------ */
.scope-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.scope-badge {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  background: var(--color-primary); color: var(--color-white);
  padding: 6px 14px; border-radius: 20px;
}
.scope-time {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--color-tertiary); margin: 12px 0;
}
.scope-notes { margin: 16px 0; }
.scope-note {
  font-size: 14px; color: var(--color-body);
  padding: 12px; background: #FFFBEB;
  border-left: 3px solid #F59E0B;
  margin-bottom: 8px;
}
.scope-disclaimer {
  font-size: 13px; color: var(--color-tertiary);
  margin: 24px 0 0;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.profile-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.profile-table td { padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.profile-table__key { color: var(--color-tertiary); font-family: var(--font-display); font-size: 12px; font-weight: 600; width: 40%; }
.profile-table__val { color: var(--color-primary); font-weight: 500; }

/* ------------------------------------------------------------------
   Dashboard — assessment list
   ------------------------------------------------------------------ */
.page-wrapper { max-width: 800px; margin: 0 auto; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.page-title { font-size: 28px; }
.assessment-list { display: flex; flex-direction: column; gap: 12px; }
.assessment-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.assessment-card__header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.assessment-card__org {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--color-primary);
}
.assessment-card__date { font-size: 13px; color: var(--color-tertiary); }
.assessment-card__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px;
}
.assessment-card__actions { display: flex; gap: 8px; }

.empty-state {
  text-align: center; padding: 64px 32px;
  color: var(--color-tertiary);
}
.empty-state p { margin-bottom: 24px; }

/* ------------------------------------------------------------------
   Tags
   ------------------------------------------------------------------ */
.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
  letter-spacing: 0.03em;
}
.tag--complete { background: #D1FAE5; color: #065F46; }
.tag--in_progress { background: #FEF3C7; color: #92400E; }
.tag--aborted { background: #FEE2E2; color: #7F1D1D; }
.tag--framework { background: var(--color-bg); color: var(--color-primary); border: 1px solid var(--color-border); }

/* ------------------------------------------------------------------
   Results page
   ------------------------------------------------------------------ */
.results-header { margin-bottom: 32px; }
.results-org { color: var(--color-tertiary); font-size: 14px; margin-top: 4px; }

.results-summary-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.results-summary-card__header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.fw-badge {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  padding: 4px 12px; border-radius: 3px;
  background: var(--color-primary); color: var(--color-white);
  letter-spacing: 0.05em;
}
.maturity-band {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--color-primary);
}
.maturity-band--4 { color: #065F46; }
.maturity-band--3 { color: #1D4ED8; }
.maturity-band--2 { color: #92400E; }
.maturity-band--1 { color: #DC2626; }
.maturity-band--0 { color: #7F1D1D; }
.maturity-score {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--color-primary); margin-left: auto;
}
.results-summary-card__gaps {
  display: flex; gap: 24px; flex-wrap: wrap;
  font-size: 14px; color: var(--color-body);
  margin-bottom: 20px;
}
.accent { color: var(--color-accent); }

/* Domain bar chart */
.domain-breakdown { margin-top: 12px; }
.domain-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px; font-size: 13px;
}
.domain-row__label {
  width: 220px; flex-shrink: 0;
  color: var(--color-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.domain-row__bar-wrap {
  flex: 1; height: 8px; background: var(--color-border);
  border-radius: 4px; overflow: hidden;
}
.domain-row__bar {
  height: 100%; background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.domain-row__score {
  width: 40px; text-align: right;
  font-family: var(--font-display); font-weight: 600;
  font-size: 12px; color: var(--color-tertiary);
}
.visibility-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: #FEF3C7; color: #92400E;
  border-radius: 50%; font-size: 11px; font-weight: 700;
  flex-shrink: 0; cursor: help;
}

/* Visibility gap banners */
.finding-banner {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 12px;
}
.finding-banner--visibility {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  color: #78350F;
}

/* Gap table */
.results-section { margin: 32px 0; }
.section-title { font-size: 20px; margin-bottom: 16px; }
.gap-table-wrapper { overflow-x: auto; }
.gap-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.gap-table th {
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--color-tertiary);
  padding: 8px 12px; border-bottom: 2px solid var(--color-border);
  text-align: left;
}
.gap-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.gap-qid { font-family: monospace; font-size: 12px; color: var(--color-tertiary); }
.gap-row--p1 { background: #FFF5F5; }
.gap-row--p2 { background: #FFFBF0; }

.priority-badge {
  display: inline-block;
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  padding: 2px 8px; border-radius: 3px;
}
.priority-badge--p1 { background: #FEE2E2; color: #7F1D1D; }
.priority-badge--p2 { background: #FEF3C7; color: #78350F; }
.priority-badge--p3 { background: #DBEAFE; color: #1E3A8A; }
.priority-badge--p4 { background: var(--color-bg); color: var(--color-tertiary); border: 1px solid var(--color-border); }

/* Output placeholder */
.output-placeholder {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  font-size: 14px; color: var(--color-tertiary);
}
.output-placeholder__sub { margin-top: 8px; font-size: 13px; font-style: italic; }
.results-clean { color: var(--color-tertiary); font-style: italic; }
.results-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.results-section--outputs { margin-top: 40px; }

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .main { padding: 16px 16px 60px; }
  .nav { padding: 0 16px; }
  .question-container { padding: 28px 20px; }
  .auth-card { padding: 32px 24px; }
  .domain-row__label { width: 120px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
