/* ===== GOOGLE FONTS are loaded in index.html ===== */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #F8F7F4;
  color: #1B2D4F;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HEADER ===== */
.site-header {
  background: #F8F7F4;
  padding: 56px 24px 8px;
  text-align: center;
}

.site-header .badge {
  display: inline-block;
  background: transparent;
  color: #C8840E;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0;
  margin-bottom: 14px;
  border: none;
  border-radius: 0;
}

.site-header h1 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 2.35rem;
  font-weight: 900;
  margin-bottom: 14px;
  line-height: 1.2;
  color: #1B2D4F;
  letter-spacing: -0.01em;
}

.site-header .tagline {
  font-size: 1rem;
  color: #5C6E84;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ===== FORM SECTION ===== */
#form-section {
  padding: 32px 0 64px;
}

.form-card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 36px 40px;
  box-shadow: 0 2px 16px rgba(27, 45, 79, 0.07), 0 1px 3px rgba(27, 45, 79, 0.04);
  border: 1px solid #E2DDD6;
}

.form-card h2 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 28px;
  color: #1B2D4F;
}

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1B2D4F;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-group .hint {
  font-size: 0.8rem;
  color: #8A96A3;
  font-weight: 400;
  margin-left: 4px;
}

input[type="text"],
select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #E2DDD6;
  border-radius: 7px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9375rem;
  color: #1B2D4F;
  background: #FFFFFF;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]::placeholder {
  color: #B0B8C2;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #C8840E;
  box-shadow: 0 0 0 3px rgba(200, 132, 14, 0.12);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #8A96A3;
  pointer-events: none;
}

/* ===== CHECKBOX GRID ===== */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 9px 14px;
  border: 1px solid #E2DDD6;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  text-align: center;
}

.checkbox-item:hover {
  border-color: #C8840E;
  background: #FDF5E8;
}

.checkbox-item input[type="checkbox"] {
  display: none;
}

.checkbox-item input[type="checkbox"]:disabled + span {
  opacity: 0.5;
}

.checkbox-item.checked {
  border-color: #C8840E;
  background: #C8840E;
}

.checkbox-item.checked span {
  color: #FFFFFF;
}

.checkbox-item span {
  font-size: 0.8375rem;
  color: #1B2D4F;
  font-weight: 500;
  line-height: 1.3;
}

/* ===== FIELD ERROR ===== */
.field-error {
  color: #DC2626;
  font-size: 0.8rem;
  margin-top: 6px;
  display: none;
  font-weight: 500;
}

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

/* ===== SUBMIT BUTTON ===== */
.submit-btn {
  width: 100%;
  padding: 16px 32px;
  background: #1B2D4F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  margin-top: 10px;
  letter-spacing: 0.01em;
}

.submit-btn:hover {
  background: #253F6B;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 45, 79, 0.2);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ===== LOADING STATE ===== */
#loading-state {
  display: none;
  text-align: center;
  padding: 100px 20px;
}

#loading-state.visible {
  display: block;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #E2DDD6;
  border-top-color: #C8840E;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-status {
  font-size: 1rem;
  color: #1B2D4F;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ===== ERROR CARD ===== */
#error-card {
  display: none;
  background: #FFFFFF;
  border: 1px solid #FCA5A5;
  border-left: 4px solid #DC2626;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  margin: 40px 0;
}

#error-card.visible {
  display: block;
}

#error-message {
  color: #DC2626;
  font-size: 0.9375rem;
  margin-bottom: 20px;
  font-weight: 500;
}

#retry-btn {
  padding: 10px 28px;
  background: #1B2D4F;
  color: #FFFFFF;
  border: none;
  border-radius: 7px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

#retry-btn:hover {
  background: #253F6B;
  transform: translateY(-1px);
}

/* ===== RESULTS SECTION ===== */
#results-section {
  display: none;
  padding: 48px 0 72px;
}

#results-section.visible {
  display: block;
}

.results-header {
  text-align: center;
  margin-bottom: 36px;
}

.results-header h2 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.875rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: #1B2D4F;
  letter-spacing: -0.01em;
}

.results-header p {
  color: #5C6E84;
  font-size: 0.9375rem;
}

/* ===== HEADLINE STATS ===== */
#headline-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: #1B2D4F;
  color: #FFFFFF;
  border-radius: 10px;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid #1B2D4F;
}

.stat-card .stat-value {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 4rem;
  font-weight: 800;
  color: #C8840E;
  line-height: 1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #8AA3C2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: #1B2D4F;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.section-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red { background: #DC2626; }
.dot-blue { background: #2563eb; }
.dot-green { background: #16A34A; }
.dot-purple { background: #7c3aed; }

/* ===== TWO COLUMN ===== */
#two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ===== COLUMN PANELS ===== */
.col-panel {
  background: #F8F7F4;
  border-radius: 10px;
  padding: 22px 20px;
  border: 1px solid #E2DDD6;
}

/* ===== ITEM CARDS ===== */
.item-card {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 16px 16px 16px 19px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(27, 45, 79, 0.06);
  border: 1px solid #EDE8E2;
  border-left: 3px solid transparent;
}

.item-card:last-child {
  margin-bottom: 0;
}

.item-card.severity-high { border-left-color: #DC2626; }
.item-card.severity-medium { border-left-color: #C8840E; }
.item-card.severity-low { border-left-color: #16A34A; }

.item-card .card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1B2D4F;
  margin-bottom: 5px;
  line-height: 1.35;
}

.item-card .card-desc {
  font-size: 0.8125rem;
  color: #5C6E84;
  line-height: 1.55;
  margin-bottom: 10px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-red    { background: #FEF2F2; color: #DC2626; }
.badge-amber  { background: #FEF3C7; color: #B45309; }
.badge-green  { background: #F0FDF4; color: #16A34A; }
.badge-blue   { background: #EFF6FF; color: #1D4ED8; }
.badge-gray   { background: #F3F4F6; color: #374151; }

.hours-tag {
  font-size: 0.775rem;
  color: #8A96A3;
  font-weight: 600;
}

/* ===== TOOL PILLS ===== */
.tool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tool-pill {
  background: #F0F2F5;
  color: #1B2D4F;
  border: 1px solid #DDE1E8;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ===== QUICK WIN CARD ===== */
#quick-win-card {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 4px solid #16A34A;
  border-radius: 10px;
  padding: 26px 28px;
  margin-bottom: 20px;
}

#quick-win-card .qw-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

#quick-win-card .qw-icon {
  font-size: 1.35rem;
  line-height: 1;
}

#quick-win-card .qw-title {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  color: #14532D;
}

#quick-win-card .qw-subtitle {
  font-size: 0.7rem;
  color: #C8840E;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

#quick-win-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 8px;
  line-height: 1.3;
}

#quick-win-desc {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.65;
  margin-bottom: 14px;
}

.qw-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.qw-meta-item {
  font-size: 0.8rem;
  color: #16A34A;
  font-weight: 600;
}

.qw-meta-item span {
  color: #374151;
  font-weight: 400;
}

/* ===== ROI NARRATIVE ===== */
#roi-narrative {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(27, 45, 79, 0.06);
  border: 1px solid #E2DDD6;
}

#roi-narrative .roi-stats {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 1px solid #E2DDD6;
  padding-bottom: 18px;
}

.roi-stat {
  flex: 1;
  text-align: center;
  padding: 0 8px;
}

.roi-stat + .roi-stat {
  border-left: 1px solid #E2DDD6;
}

.roi-stat .roi-value {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: #C8840E;
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.roi-stat .roi-label {
  font-size: 0.7rem;
  color: #8A96A3;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

#roi-text {
  font-size: 0.9rem;
  color: #3D4F63;
  line-height: 1.75;
}

/* ===== CTA SECTION ===== */
#cta-section {
  background: #1B2D4F;
  color: #FFFFFF;
  border-radius: 12px;
  padding: 48px 40px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid #1B2D4F;
}

#cta-section h2 {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: #FFFFFF;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

#cta-section p {
  color: #8AA3C2;
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

#cta-btn {
  display: inline-block;
  padding: 16px 36px;
  background: #C8840E;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 8px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  letter-spacing: 0.01em;
}

#cta-btn:hover {
  background: #A86D0A;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 132, 14, 0.35);
}

#cta-btn:active {
  transform: translateY(0);
}

/* ===== NEW AUDIT BUTTON ===== */
#new-audit-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid #E2DDD6;
  border-radius: 8px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #8A96A3;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

#new-audit-btn:hover {
  border-color: #B0A898;
  color: #3D4F63;
}

/* ===== CHECKLIST ===== */
.checklist-help {
  font-size: 0.825rem;
  color: #8A96A3;
  margin-bottom: 14px;
  line-height: 1.5;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist-row {
  background: #F8F7F4;
  border: 1px solid #E2DDD6;
  border-radius: 8px;
  padding: 14px 16px;
}

.checklist-cat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1B2D4F;
  margin-bottom: 10px;
}

.cat-desc {
  font-weight: 400;
  color: #8A96A3;
  font-size: 0.825rem;
}

.checklist-radios {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid #E2DDD6;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1B2D4F;
  background: #FFFFFF;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

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

.radio-pill:hover {
  border-color: #C8840E;
  background: #FDF5E8;
}

.radio-pill.selected {
  border-color: #C8840E;
  background: #C8840E;
  color: #FFFFFF;
}

.checklist-notes {
  width: 100%;
  margin-top: 2px;
  font-size: 0.85rem !important;
  padding: 8px 12px !important;
}

/* ===== RANK BADGE ===== */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #C8840E;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
}

/* ===== HOW I'D BUILD IT ===== */
.how-id-build-it {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 0.8rem;
  color: #1E3A5F;
  line-height: 1.6;
}

.how-id-build-it-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #2563EB;
  margin-bottom: 4px;
}

/* ===== BLOCKING QUESTION ===== */
.blocking-question {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #7C2D12;
  line-height: 1.6;
}

.blocking-question-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.67rem;
  letter-spacing: 0.07em;
  color: #9A3412;
  margin-right: 4px;
}

/* ===== CONDITIONAL NOTE ===== */
.conditional-note {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #14532D;
  line-height: 1.6;
}

.conditional-note-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.67rem;
  letter-spacing: 0.07em;
  color: #16A34A;
  margin-right: 4px;
}

/* ===== FORCING QUESTIONS ===== */
.forcing-questions {
  background: #FAF5FF;
  border: 1px solid #E9D5FF;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
}

.forcing-questions-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7C3AED;
  margin-bottom: 6px;
}

.forcing-questions ol {
  padding-left: 18px;
  margin: 0;
}

.forcing-questions li {
  font-size: 0.8rem;
  color: #3D4F63;
  line-height: 1.65;
  margin-bottom: 5px;
}

.forcing-questions li:last-child {
  margin-bottom: 0;
}

/* ===== DISCOVERY SECTION (always visible) ===== */
.discovery-section {
  margin-top: 8px;
  padding: 12px 14px;
  background: #FAFAF9;
  border: 1px solid #E2DDD6;
  border-radius: 6px;
}

.discovery-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #C8840E;
  margin-bottom: 6px;
}

.discovery-section ol {
  padding-left: 18px;
  margin: 0;
}

.discovery-section li {
  font-size: 0.8rem;
  color: #3D4F63;
  line-height: 1.65;
  margin-bottom: 5px;
}

.discovery-section li:last-child {
  margin-bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .site-header {
    padding: 40px 20px 8px;
  }

  .site-header h1 {
    font-size: 1.75rem;
  }

  .form-card {
    padding: 26px 22px;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  #headline-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card .stat-value {
    font-size: 3rem;
  }

  #two-col {
    grid-template-columns: 1fr;
  }

  .col-panel {
    padding: 18px 16px;
  }

  #cta-section {
    padding: 36px 24px;
  }

  #cta-section h2 {
    font-size: 1.4rem;
  }

  #roi-narrative {
    padding: 22px 20px;
  }

  #roi-narrative .roi-stats {
    gap: 0;
  }

  .roi-stat .roi-value {
    font-size: 1.4rem;
  }

  #quick-win-card {
    padding: 22px 20px;
  }

  .container {
    padding: 0 18px;
  }
}
