/* ============================================================
   Online Optimism — Agency Prep Checklist
   Brand colors:
     Deep Green:   #006037
     Bright Green: #00bf6f
     Grello:       #f3fae0
     Black:        #000000
     White:        #ffffff
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */

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

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

body {
  background-color: #f3fae0;
  color: #000;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography helpers ───────────────────────────────────── */

.mono-heading {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.accent-text {
  font-family: 'Playwrite GB S', cursive;
}

/* ── Layout ───────────────────────────────────────────────── */

.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

/* ── Site Header (screen only) ────────────────────────────── */

.site-header {
  background-color: #006037;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-wordmark {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
  color: #f3fae0;
  text-decoration: none;
}

.site-wordmark:hover {
  color: #fff;
}

.site-tagline {
  font-family: 'Playwrite GB S', cursive;
  font-size: 0.8rem;
  color: rgba(243, 250, 224, 0.75);
  border-left: 1px solid rgba(243, 250, 224, 0.3);
  padding-left: 1rem;
  display: none; /* shown at wider breakpoints */
}

@media (min-width: 480px) {
  .site-tagline {
    display: block;
  }
}

/* ── Print Header (print only) ────────────────────────────── */

.print-header {
  display: none;
}

/* ── Print Footer (print only) ────────────────────────────── */

.print-footer {
  display: none;
}

/* ── Phase System ─────────────────────────────────────────── */

.phase {
  opacity: 1;
  transition: opacity 0.28s ease;
}

.phase.hidden {
  display: none;
}

.phase.fading-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Card / Box Style (shared) ────────────────────────────── */

.card {
  background: #fff;
  border: 4px solid #000;
  border-radius: 6px;
  box-shadow: -8px 8px 0 #000;
}

/* ── Phase 1: Intro ───────────────────────────────────────── */

.intro-content {
  margin-bottom: 2.5rem;
}

.intro-heading {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 4vw, 1.75rem);
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #006037;
  margin-bottom: 1rem;
}

.intro-accent {
  font-family: 'Playwrite GB S', cursive;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  line-height: 1.65;
  color: #333;
  max-width: 520px;
}

/* Track selection */

.track-label {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: #000;
  margin-bottom: 1rem;
}

.track-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.track-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 4px solid #000;
  border-radius: 6px;
  box-shadow: -8px 8px 0 #000;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  font-family: 'Roboto', sans-serif;
  color: #000;
  position: relative;
}

.track-card:hover {
  transform: translateY(-2px);
  box-shadow: -8px 10px 0 #000;
}

.track-card:active {
  transform: translateY(1px);
  box-shadow: -8px 7px 0 #000;
}

.track-card:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
}

.track-card.selected,
.track-card:active {
  background-color: #006037;
  color: #fff;
}

.track-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.track-name {
  font-weight: 500;
  font-size: 1rem;
  display: block;
  line-height: 1.3;
}

.track-desc {
  font-size: 0.85rem;
  color: #555;
  display: block;
  margin-top: 0.1rem;
}

.track-card.selected .track-desc,
.track-card:active .track-desc {
  color: rgba(243, 250, 224, 0.8);
}

/* Skip-quiz hint (intro screen) */

.skip-quiz-hint {
  margin-top: 1.5rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  line-height: 1.6;
}

.skip-quiz-hint .text-btn {
  display: inline;
  font-size: 0.85rem;
  color: #006037;
  padding: 0;
  font-weight: 500;
}

.skip-quiz-hint .text-btn:hover {
  color: #000;
}

/* ── Phase 2: Quiz ────────────────────────────────────────── */

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.progress-indicator {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: #006037;
  background: rgba(0, 96, 55, 0.08);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
}

.back-btn {
  font-size: 0.85rem;
  color: #555;
}

.back-btn:hover {
  color: #006037;
}

/* Question card */

.question-card {
  animation: slideUpFadeIn 0.25s ease both;
}

.question-card.is-exiting {
  animation: slideUpFadeOut 0.22s ease both;
}

.question-text {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1rem, 3vw, 1.2rem);
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #000;
  margin-bottom: 1.25rem;
}

/* Multi-select hint */

.question-hint {
  font-family: 'Roboto', sans-serif;
  font-size: 0.8rem;
  color: #666;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

/* Next button (multi-select questions) */

.next-btn {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem 1.5rem;
  background: #006037;
  color: #f3fae0;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: -4px 4px 0 #000;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.next-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: -4px 6px 0 #000;
}

.next-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: -4px 3px 0 #000;
}

.next-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: -4px 4px 0 #000;
}

.next-btn:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
}

/* Answer option grid */

.answer-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .answer-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.answer-card {
  padding: 0.9rem 1rem;
  background: #fff;
  border: 4px solid #000;
  border-radius: 6px;
  box-shadow: -8px 8px 0 #000;
  cursor: pointer;
  text-align: left;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #000;
  line-height: 1.35;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.answer-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: -8px 10px 0 #000;
}

.answer-card:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: -8px 7px 0 #000;
}

.answer-card:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
}

.answer-card.selected {
  background-color: #006037;
  color: #f3fae0;
}

.answer-card:disabled {
  cursor: default;
}

/* ── Quiz Animations ──────────────────────────────────────── */

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

@keyframes slideUpFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

/* ── Phase 3: Checklist ───────────────────────────────────── */

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

.checklist-heading {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 4vw, 1.75rem);
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #006037;
  margin-bottom: 0.6rem;
}

.checklist-subtext {
  font-family: 'Playwrite GB S', cursive;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
}

/* Answer summary tags (shown at top of personalized checklist) */

.answer-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}

.answer-tag {
  display: inline-block;
  border: 1px solid #006037;
  color: #006037;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  line-height: 1.6;
}

/* Checklist sections */

.checklist-section {
  background: #fff;
  border: 4px solid #000;
  border-radius: 6px;
  box-shadow: -8px 8px 0 #000;
  padding: 1.25rem 1.25rem 0.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #006037;
  margin-bottom: 0.75rem;
}

/* Checklist list */

.checklist-list {
  list-style: none;
}

.checklist-item {
  border-top: 1px solid #e8e8e8;
  animation: checklistItemIn 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

.checklist-item:first-child {
  border-top: none;
}

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

/* Checkbox label layout */

.item-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  width: 100%;
}

/* Visually-hidden real checkbox (still keyboard accessible) */

.item-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom checkbox visual */

.checkbox-visual {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 3px solid #000;
  border-radius: 4px;
  background: #fff;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  position: relative;
}

/* Checkmark shape */

.checkbox-visual::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 9px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) scale(0) translate(-1px, -1px);
  transition: transform 0.15s ease;
}

/* Checked state */

.item-checkbox:checked + .checkbox-visual {
  background-color: #006037;
  border-color: #006037;
  animation: checkBounce 0.3s ease;
}

.item-checkbox:checked + .checkbox-visual::after {
  transform: rotate(45deg) scale(1) translate(-1px, -1px);
}

/* Keyboard focus on checkbox */

.item-checkbox:focus-visible + .checkbox-visual {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
}

/* Checked item text */

.item-checkbox:checked ~ .item-content .item-text {
  color: #555;
}

@keyframes checkBounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.25); }
  65%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}

/* Item content */

.item-content {
  flex: 1;
  min-width: 0;
}

.item-text {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #000;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.item-why {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.5;
  margin-top: 0.25rem;
}

/* Flagged items (⚡ Worth setting up) */

.item-flagged {
  padding: 0.75rem 0.25rem;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f3fae0;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #000;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.item-flagged .item-text {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  line-height: 1.45;
}

.item-flagged .item-why {
  display: block;
  font-size: 0.82rem;
  color: #666;
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* ── CTA Section ──────────────────────────────────────────── */

.cta-section {
  margin: 2rem 0;
}

.cta-card {
  background: #006037;
  border: 4px solid #000;
  border-radius: 6px;
  box-shadow: -8px 8px 0 #000;
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.cta-headline {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.03em;
  color: #f3fae0;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.cta-body {
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  color: rgba(243, 250, 224, 0.9);
  max-width: 440px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.cta-btn {
  display: inline-block;
  background: #f3fae0;
  color: #006037;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.8rem 1.75rem;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: -4px 4px 0 #000;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: -4px 6px 0 #000;
}

.cta-btn:active {
  transform: translateY(1px);
  box-shadow: -4px 3px 0 #000;
}

.cta-btn:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 3px;
}

.cta-phone {
  font-family: 'Roboto', sans-serif;
  font-size: 0.875rem;
  color: rgba(243, 250, 224, 0.75);
  margin-top: 1rem;
}

.cta-phone a {
  color: #f3fae0;
  font-weight: 500;
  text-decoration: none;
}

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

/* ── Checklist Actions (print + restart) ──────────────────── */

.checklist-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 3rem;
}

.print-btn {
  background: #fff;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: -4px 4px 0 #000;
  padding: 0.65rem 1.1rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #000;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.print-btn:hover {
  transform: translateY(-2px);
  box-shadow: -4px 6px 0 #000;
}

.print-btn:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
}

/* Shared text button style */

.text-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: 0.875rem;
  color: #555;
  padding: 0.4rem 0.2rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.text-btn:hover {
  color: #000;
}

.text-btn:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
  border-radius: 3px;
}

.restart-btn {
  margin-left: auto;
}

/* ── Sticky Footer ────────────────────────────────────────── */

/* Push content above the footer height so nothing is obscured */
#main-content {
  padding-bottom: 58px;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #006037;
  border-top: 3px solid #000;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  line-height: 1;
}

.footer-logo {
  height: 26px;
  width: auto;
  display: block;
}

.footer-phone {
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #f3fae0;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.footer-phone:hover {
  color: #fff;
}

.footer-phone:focus-visible {
  outline: 3px solid #00bf6f;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Utilities ────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Print Stylesheet ─────────────────────────────────────── */

@media print {
  /* Reset page */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff;
    color: #000;
  }

  /* Remove footer padding so checklist fills the page */
  #main-content {
    padding-bottom: 0;
  }

  /* Hide screen-only elements */
  .site-header,
  .sticky-footer,
  #phase-intro,
  #phase-quiz,
  .cta-section,
  .checklist-actions,
  .checklist-intro,
  .back-btn {
    display: none !important;
  }

  /* Show print header */
  .print-header {
    display: block;
    text-align: center;
    padding: 0 0 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #000;
  }

  .print-wordmark {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.4rem;
    letter-spacing: 0.06em;
    color: #006037;
    margin-bottom: 0.15rem;
  }

  .print-tagline {
    font-family: 'Playwrite GB S', cursive;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.75rem;
  }

  .print-rule {
    border-top: 1px solid #ccc;
    margin: 0.75rem auto;
    width: 60%;
  }

  .print-doc-title {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: #000;
    margin-bottom: 0.2rem;
  }

  .print-meta {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Roboto', sans-serif;
  }

  /* Show print footer */
  .print-footer {
    display: block;
    text-align: center;
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ccc;
    font-size: 0.8rem;
    color: #666;
    font-family: 'Roboto', sans-serif;
  }

  /* Ensure checklist phase shows even if hidden on screen */
  #phase-checklist {
    display: block !important;
    opacity: 1 !important;
  }

  /* Checklist sections — print-friendly */
  .checklist-section {
    background: #fff;
    box-shadow: none;
    border: 2px solid #000;
    padding: 0.75rem 0.75rem 0.25rem;
    margin-bottom: 1rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .section-title {
    font-size: 0.75rem;
    color: #006037;
    margin-bottom: 0.5rem;
  }

  /* Remove stagger animations */
  .checklist-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Checkbox visual for print */
  .checkbox-visual {
    border: 2px solid #000;
    print-color-adjust: exact;
  }

  .item-checkbox:checked + .checkbox-visual {
    background-color: #006037 !important;
    border-color: #006037 !important;
    print-color-adjust: exact;
  }

  .item-checkbox:checked + .checkbox-visual::after {
    transform: rotate(45deg) scale(1) translate(-1px, -1px);
  }

  .item-check-label {
    padding: 0.5rem 0.1rem;
  }

  .item-text {
    font-size: 0.88rem;
  }

  .item-why {
    font-size: 0.75rem;
  }

  /* Flagged items in print */
  .flag-badge {
    background: #f3fae0 !important;
    print-color-adjust: exact;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }

  .item-flagged {
    padding: 0.5rem 0.1rem;
  }

  .item-flagged .item-text {
    font-size: 0.88rem;
  }

  .item-flagged .item-why {
    font-size: 0.75rem;
  }

  /* Container in print */
  .container {
    padding: 0;
    max-width: 100%;
  }

  /* Page setup */
  @page {
    margin: 1.5cm 1.75cm;
  }
}
