/* =========================================
   Launch planner
   Ported from src/pages/LaunchPlanner.tsx in the client's Lovable project.

   Loaded automatically for every page (see Page::getCSS, which walks all pages
   because of partial navigation), so everything is scoped to body.LaunchPlanner
   - the class getBodyClass() emits from simpleName().
   ========================================= */

body.LaunchPlanner,
body.LaunchPlanner header,
body.LaunchPlanner button,
body.LaunchPlanner input,
body.LaunchPlanner select,
body.LaunchPlanner textarea {
  font-family: "Montserrat", sans-serif;
}

body.LaunchPlanner .lp-page {
  max-width: 1024px;
  margin: 0 auto;
  padding: 8px 0 48px;
  color: #25153c;
}

/* --- Shared -------------------------------------------------------------- */

body.LaunchPlanner .lp-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background-image: linear-gradient(to bottom right, #9333ea, #f97316);
}

body.LaunchPlanner .lp-tile svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

body.LaunchPlanner .lp-tile--lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

body.LaunchPlanner .lp-tile--lg svg {
  width: 28px;
  height: 28px;
}

body.LaunchPlanner .lp-tile--sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

body.LaunchPlanner .lp-tile--sm svg {
  width: 18px;
  height: 18px;
}

/* --- Header and progress -------------------------------------------------- */

body.LaunchPlanner .lp-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background-image: linear-gradient(
    to bottom right,
    rgba(250, 245, 255, 0.6),
    #ffffff,
    rgba(255, 247, 237, 0.4)
  );
}

body.LaunchPlanner .lp-head-copy {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

body.LaunchPlanner .lp-head h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.LaunchPlanner .lp-head-copy p {
  margin: 0;
  max-width: 46ch;
  font-size: 15px;
  line-height: 22px;
  color: #6c5393;
}

/* react.css carries a bare `p { margin-bottom: 0 !important }`, which wins over
   any margin here, so the gap above the bar is padding. */
body.LaunchPlanner .lp-progress-count {
  margin: 0;
  padding-bottom: 8px;
  font-size: 13px;
  color: #6c5393;
}

body.LaunchPlanner .lp-progress-count strong {
  font-size: 16px;
  color: #25153c;
}

body.LaunchPlanner .lp-bar {
  height: 8px;
  border-radius: 9999px;
  background: #f0e9f8;
  overflow: hidden;
}

body.LaunchPlanner .lp-bar span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background-image: linear-gradient(to right, #9333ea, #f97316);
  transition: width 0.3s ease;
}

/* --- Budget --------------------------------------------------------------- */

body.LaunchPlanner .lp-budget {
  position: relative;
  margin-bottom: 32px;
  padding: 20px;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background: #ffffff;
}

body.LaunchPlanner .lp-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #25153c;
}

body.LaunchPlanner .lp-budget input {
  display: block;
  width: 100%;
  max-width: 240px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e6dbf0;
  border-radius: 12px;
  background: #ffffff;
  color: #25153c;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.LaunchPlanner .lp-budget input:focus {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

body.LaunchPlanner .lp-budget-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 19px;
  color: #9a86b8;
}

body.LaunchPlanner .lp-saved {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
}

/* --- Phases --------------------------------------------------------------- */

body.LaunchPlanner .lp-phase {
  margin-bottom: 24px;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

body.LaunchPlanner .lp-phase-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e6dbf0;
  background: rgba(250, 245, 255, 0.5);
}

body.LaunchPlanner .lp-phase-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  border: 1px solid #e6dbf0;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  color: #7e22ce;
}

body.LaunchPlanner .lp-phase-copy {
  flex: 1;
  min-width: 0;
}

body.LaunchPlanner .lp-phase-copy h2 {
  margin: 0;
  font-size: 17px;
  line-height: 24px;
  font-weight: 700;
}

body.LaunchPlanner .lp-phase-copy p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9a86b8;
}

body.LaunchPlanner .lp-phase-count {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #6c5393;
  font-variant-numeric: tabular-nums;
}

/* --- Tasks ---------------------------------------------------------------- */

body.LaunchPlanner .lp-tasks {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.LaunchPlanner .lp-task {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(230, 219, 240, 0.6);
  transition: background 0.15s ease;
}

body.LaunchPlanner .lp-task:last-child {
  border-bottom: 0;
}

body.LaunchPlanner .lp-task.is-done {
  background: rgba(245, 240, 250, 0.35);
}

body.LaunchPlanner .lp-task-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

/* The real checkbox stays in the accessibility tree and keeps the keyboard
   behaviour; .lp-task-box is what is actually seen. */
body.LaunchPlanner .lp-task-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.LaunchPlanner .lp-task-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1px solid #d6c7e8;
  border-radius: 7px;
  background: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

body.LaunchPlanner .lp-task-box svg {
  width: 14px;
  height: 14px;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

body.LaunchPlanner .lp-task-check input:checked + .lp-task-box {
  border-color: transparent;
  background-image: linear-gradient(to bottom right, #9333ea, #f97316);
}

body.LaunchPlanner .lp-task-check input:checked + .lp-task-box svg {
  opacity: 1;
}

body.LaunchPlanner .lp-task-check input:focus-visible + .lp-task-box {
  outline: 2px solid #9333ea;
  outline-offset: 2px;
}

body.LaunchPlanner .lp-task-copy {
  display: block;
  min-width: 0;
}

body.LaunchPlanner .lp-task-title {
  display: block;
  font-size: 15px;
  line-height: 22px;
  font-weight: 650;
  color: #25153c;
}

body.LaunchPlanner .lp-task.is-done .lp-task-title {
  color: #9a86b8;
  text-decoration: line-through;
}

body.LaunchPlanner .lp-task-text {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 20px;
  color: #6c5393;
}

body.LaunchPlanner .lp-task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 10px 0 0 34px;
}

body.LaunchPlanner .lp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #9a86b8;
}

body.LaunchPlanner .lp-meta-item svg {
  width: 13px;
  height: 13px;
}

body.LaunchPlanner .lp-chip {
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 650;
}

body.LaunchPlanner .lp-chip--critical { color: #a8324a; background: rgba(168, 50, 74, 0.1); }
body.LaunchPlanner .lp-chip--high     { color: #b45309; background: rgba(180, 83, 9, 0.1); }
body.LaunchPlanner .lp-chip--medium   { color: #6c5393; background: rgba(108, 83, 147, 0.1); }
body.LaunchPlanner .lp-chip--low      { color: #6c5393; background: rgba(108, 83, 147, 0.08); }

body.LaunchPlanner .lp-task-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0 0 34px;
  font-size: 12.5px;
  line-height: 19px;
  color: #9a86b8;
}

body.LaunchPlanner .lp-task-note svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  margin-top: 3px;
}

/* --- Footer --------------------------------------------------------------- */

body.LaunchPlanner .lp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-top: 8px;
}

body.LaunchPlanner .lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid #e6dbf0;
  border-radius: 12px;
  background: #ffffff;
  color: #25153c;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

body.LaunchPlanner .lp-btn:hover {
  border-color: #c084fc;
  background: rgba(250, 245, 255, 0.6);
}

body.LaunchPlanner .lp-btn:focus-visible {
  outline: 2px solid #9333ea;
  outline-offset: 2px;
}

body.LaunchPlanner .lp-btn svg {
  width: 15px;
  height: 15px;
}

body.LaunchPlanner .lp-foot p {
  margin: 0;
  font-size: 12.5px;
  color: #9a86b8;
}

@media (min-width: 768px) {
  body.LaunchPlanner .lp-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 28px;
  }

  body.LaunchPlanner .lp-progress {
    flex-shrink: 0;
    width: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.LaunchPlanner .lp-bar span,
  body.LaunchPlanner .lp-task,
  body.LaunchPlanner .lp-task-box,
  body.LaunchPlanner .lp-task-box svg,
  body.LaunchPlanner .lp-btn,
  body.LaunchPlanner .lp-budget input {
    transition: none;
  }
}

/* --- Step rail ------------------------------------------------------------
   The design's four stops with connector lines, sitting between the plan header
   and the phases. A step is done when every task in its phase is ticked; the
   first one that is not is the current step. */

body.LaunchPlanner .lp-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background: #ffffff;
  list-style: none;
}

body.LaunchPlanner .lp-rail-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

body.LaunchPlanner .lp-rail-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1px solid #e6dbf0;
  border-radius: 9999px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  color: #9a86b8;
}

body.LaunchPlanner .lp-rail-dot svg {
  display: none;
  width: 14px;
  height: 14px;
  color: #ffffff;
}

body.LaunchPlanner .lp-rail-step.is-current .lp-rail-dot {
  border-color: #9333ea;
  color: #7e22ce;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

body.LaunchPlanner .lp-rail-step.is-done .lp-rail-dot {
  border-color: transparent;
  background-image: linear-gradient(to bottom right, #9333ea, #f97316);
}

body.LaunchPlanner .lp-rail-step.is-done .lp-rail-dot svg { display: block; }
body.LaunchPlanner .lp-rail-step.is-done .lp-rail-num { display: none; }

body.LaunchPlanner .lp-rail-copy {
  display: block;
  min-width: 0;
}

body.LaunchPlanner .lp-rail-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a86b8;
}

body.LaunchPlanner .lp-rail-name {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: #25153c;
  white-space: nowrap;
}

body.LaunchPlanner .lp-rail-step.is-current .lp-rail-name { color: #7e22ce; }

/* --- Task rows: collapsed by default -------------------------------------- */

body.LaunchPlanner .lp-task-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

body.LaunchPlanner .lp-task-main .lp-task-check {
  flex: 1;
  min-width: 0;
}

body.LaunchPlanner .lp-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* The design uses a circle here rather than a square. */
body.LaunchPlanner .lp-task-box {
  border-radius: 9999px;
}

body.LaunchPlanner .lp-task-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #9a86b8;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

body.LaunchPlanner .lp-task-toggle:hover {
  background: rgba(250, 245, 255, 0.9);
  color: #7e22ce;
}

body.LaunchPlanner .lp-task-toggle:focus-visible {
  outline: 2px solid #9333ea;
  outline-offset: 2px;
}

body.LaunchPlanner .lp-task-toggle svg {
  width: 16px;
  height: 16px;
}

body.LaunchPlanner .lp-task-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

body.LaunchPlanner .lp-task-more {
  margin-top: 10px;
}

/* Visible to a screen reader, not on screen. */
body.LaunchPlanner .lp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 700px) {
  body.LaunchPlanner .lp-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }

  /* The connector runs from just past the dot to the edge of the cell, so the
     last step has none. */
  body.LaunchPlanner .lp-rail-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 36px;
    right: 4px;
    height: 1px;
    background: #e6dbf0;
    z-index: 0;
  }

  body.LaunchPlanner .lp-rail-step.is-done:not(:last-child)::after {
    background: #d8b4fe;
  }

  body.LaunchPlanner .lp-rail-step {
    padding-right: 12px;
  }

  body.LaunchPlanner .lp-rail-dot,
  body.LaunchPlanner .lp-rail-copy {
    position: relative;
    z-index: 1;
  }
}

/* --- Next step ------------------------------------------------------------
   The design's handoff card. It is shown all the time rather than only when the
   list is finished - the tools are useful before then too - but it changes state
   once every task is ticked. */

body.LaunchPlanner .lp-next {
  margin: 8px 0 24px;
  padding: 24px;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background-image: linear-gradient(
    to bottom right,
    rgba(250, 245, 255, 0.7),
    #ffffff,
    rgba(255, 247, 237, 0.5)
  );
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

body.LaunchPlanner .lp-next.is-ready {
  border-color: #c4b5fd;
  box-shadow: 0 20px 25px -5px rgba(126, 96, 246, 0.12);
}

body.LaunchPlanner .lp-next-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

body.LaunchPlanner .lp-next-copy {
  min-width: 0;
}

body.LaunchPlanner .lp-next h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
  color: #25153c;
}

body.LaunchPlanner .lp-next-badge {
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(108, 83, 147, 0.1);
  color: #6c5393;
  font-size: 11px;
  font-weight: 650;
}

body.LaunchPlanner .lp-next.is-ready .lp-next-badge {
  background: #f0fdf4;
  color: #166534;
}

body.LaunchPlanner .lp-next-copy p {
  margin: 0;
  max-width: 60ch;
  font-size: 14px;
  line-height: 22px;
  color: #6c5393;
}

body.LaunchPlanner .lp-next-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

body.LaunchPlanner .lp-next-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e6dbf0;
  border-radius: 12px;
  background: #ffffff;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.LaunchPlanner .lp-next-card:hover {
  border-color: #c084fc;
  box-shadow: 0 4px 6px -1px rgba(126, 96, 246, 0.1);
}

body.LaunchPlanner .lp-next-card:focus-visible {
  outline: 2px solid #9333ea;
  outline-offset: 3px;
}

body.LaunchPlanner .lp-next-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-image: linear-gradient(to bottom right, #f3e8ff, #ffedd5);
}

body.LaunchPlanner .lp-next-icon svg {
  width: 18px;
  height: 18px;
  color: #7e22ce;
}

body.LaunchPlanner .lp-next-card-copy { display: block; min-width: 0; }

body.LaunchPlanner .lp-next-title {
  display: block;
  margin-bottom: 2px;
  font-size: 14.5px;
  font-weight: 650;
  color: #25153c;
}

body.LaunchPlanner .lp-next-text {
  display: block;
  font-size: 12.5px;
  line-height: 19px;
  color: #6c5393;
}

@media (min-width: 700px) {
  body.LaunchPlanner .lp-next-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  body.LaunchPlanner .lp-next,
  body.LaunchPlanner .lp-next-card {
    transition: none;
  }
}
