/* ============================================================
   WISP Generator — Boston Managed IT
   Brand: Navy #1a2332 | White #ffffff | Blue #2563eb
   ============================================================ */

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

:root {
  --navy: #1a2332;
  --navy-light: #243447;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --green: #16a34a;
  --green-light: #dcfce7;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--navy);
  color: var(--white);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #93c5fd;
  font-weight: 400;
}

/* ── App container ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#wizard-container {
  max-width: 780px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

/* ── Progress bar ── */
.progress-bar {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.progress-step.completed:not(:last-child)::after {
  background: var(--blue);
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-400);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.progress-step.active .step-circle {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.progress-step.completed .step-circle {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.step-label {
  font-size: 0.7rem;
  margin-top: 0.4rem;
  color: var(--gray-400);
  text-align: center;
  white-space: nowrap;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
  color: var(--blue);
  font-weight: 500;
}

/* ── Wizard step panels ── */
.wizard-step {
  display: none;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

.wizard-step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.step-description {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

/* ── Form elements ── */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.3rem;
}

/* ── Checkbox grid ── */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.checkbox-item:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-item.checked {
  border-color: var(--blue);
  background: var(--blue-light);
}

.checkbox-item label {
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  color: var(--gray-800);
}

/* ── Gap note (inline warning) ── */
.gap-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: var(--amber-light);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  font-size: 0.825rem;
  color: #92400e;
  margin-top: 0.75rem;
}

.gap-note-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

/* ── Gap summary / scorecard ── */
.gap-summary {
  padding: 0;
}

.gap-summary-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}

.score-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.score-item {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.score-item.in-place {
  background: var(--green-light);
  border: 1px solid #86efac;
}

.score-item.needs-attention {
  background: var(--amber-light);
  border: 1px solid #fcd34d;
}

.score-item.missing {
  background: var(--red-light);
  border: 1px solid #fca5a5;
}

.score-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.score-item.in-place .score-number { color: var(--green); }
.score-item.needs-attention .score-number { color: var(--amber); }
.score-item.missing .score-number { color: var(--red); }

.score-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
}

.gap-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.gap-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.gap-list li:last-child { border-bottom: none; }

.gap-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gap-badge.missing { background: var(--red-light); color: var(--red); }
.gap-badge.partial { background: var(--amber-light); color: var(--amber); }
.gap-badge.ok { background: var(--green-light); color: var(--green); }

/* ── Download / lead capture ── */
.download-form {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.download-form-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.download-form-sub {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
}

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

/* ── Buttons ── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

.btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-800);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

/* ── Divider ── */
.section-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 1.5rem 0;
}

/* ── Header branding ── */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

.header-brand {
  background: var(--blue);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ── Radio group ── */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  user-select: none;
}

.radio-item:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.radio-item input[type="radio"] {
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.radio-item input[type="radio"]:checked + span {
  color: var(--blue);
  font-weight: 600;
}

/* ── Validation ── */
.input-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.validation-error {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* ── Gap cards in results ── */
.gap-card {
  border-left: 4px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

.gap-card--critical {
  border-left-color: var(--red);
}

.gap-card--important {
  border-left-color: #ea580c;
}

.gap-card--needs_attention {
  border-left-color: var(--amber);
}

.gap-card--recommended {
  border-left-color: var(--blue);
}

.gap-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.gap-card-title {
  font-size: 0.95rem;
  color: var(--navy);
}

.gap-card-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.gap-card-meta {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 0.4rem;
}

.gap-regulation {
  font-family: monospace;
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.gap-card-recommendation {
  font-size: 0.85rem;
  color: var(--gray-800);
  line-height: 1.55;
}

/* ── Severity badges ── */
.gap-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-critical {
  background: var(--red-light);
  color: var(--red);
}

.badge-important {
  background: #ffedd5;
  color: #ea580c;
}

.badge-needs-attention {
  background: var(--amber-light);
  color: var(--amber);
}

.badge-recommended {
  background: var(--blue-light);
  color: var(--blue);
}

/* ── Gap summary wrapper ── */
.gap-summary-wrapper {
  padding: 2rem;
}

/* ── CTA link ── */
.gap-cta {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--blue-light);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
}

.gap-cta a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.gap-cta a:hover { text-decoration: underline; }

/* ── Download button ── */
.btn-download {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ── Spinner ── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

/* ── Download error message ── */
.download-error {
  background: var(--red-light);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  color: var(--red);
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.85rem;
}

/* ── No gaps message ── */
.no-gaps-msg {
  color: var(--green);
  font-weight: 600;
  text-align: center;
  padding: 1.5rem;
}

/* ── Site footer ── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.site-footer a {
  color: var(--gray-400);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--blue);
}

/* ── Results button ── */
.btn-results {
  background: var(--green);
}

.btn-results:hover {
  background: #15803d;
}

/* ── Template Section ── */
.template-section {
  max-width: 780px;
  width: 100%;
  margin: 2rem auto 0;
  padding: 2rem 1rem;
}

.template-card {
  background: #f8f9fa;
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.template-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.template-card > p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.template-form {
  margin-bottom: 1rem;
}

.template-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.template-form-row .form-input {
  flex: 1;
  margin-bottom: 0;
}

.template-form-row .btn-secondary {
  flex-shrink: 0;
  white-space: nowrap;
}

.template-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  header { padding: 1.25rem 1rem; }
  header h1 { font-size: 1.35rem; }

  .header-inner { flex-direction: column; gap: 0.6rem; text-align: center; }

  #wizard-container { margin: 1rem auto; padding: 0 0.75rem 2rem; }

  .wizard-step { padding: 1.25rem; }

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

  .score-card { grid-template-columns: 1fr; }

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

  .step-label { display: none; }

  .progress-bar { gap: 0; }

  .radio-group { flex-direction: column; }

  .template-card { padding: 1.5rem; }

  .template-form-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .template-form-row .form-input,
  .template-form-row .btn-secondary {
    width: 100%;
  }
}
