/**
 * Website Go Live — tool styles
 *
 * Cards, buttons, badges, inputs, selects, alerts, chips, accordions, steps,
 * meters and the progress ring are all frikwork's; nothing here restyles one.
 * What is left is the dashboard grid, the checklist row layout and the small
 * amount of chrome frikwork has no component for.
 *
 * Every colour is a --fw-* token or a color-mix over one, so both themes work.
 * v1 hardcoded rgba(255,255,255,…) for every border and background, #e0a13c for
 * the blocked state and rgba(23,23,23,0.92) for the section rail — all of which
 * only ever looked right on the dark theme.
 */

/* ---------------------------------------------------------------------------
 * Page-head actor field
 * ------------------------------------------------------------------------ */

.golive-actor {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 15rem;
}

.golive-actor__label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fw-text-muted);
}

.golive-actor__input { min-width: 0; }

/* ---------------------------------------------------------------------------
 * Dashboard — connect form
 * ------------------------------------------------------------------------ */

.golive-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--fw-space-sm);
}

.golive-connect__field {
  flex: 1 1 22rem;
  min-width: 0;
  margin: 0;
}

.golive-connect__go { flex: 0 0 auto; }

/* ---------------------------------------------------------------------------
 * Dashboard — list panel head
 * ------------------------------------------------------------------------ */

.golive-count { align-self: center; }

.golive-archived {
  align-self: center;
  margin: 0;
  white-space: nowrap;
  color: var(--fw-text-2);
}

.golive-loading {
  display: flex;
  flex-direction: column;
  gap: var(--fw-space-sm);
  padding: var(--fw-space-md) 0;
}

/* ---------------------------------------------------------------------------
 * Dashboard — project cards
 * ------------------------------------------------------------------------ */

.golive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--fw-space-md);
}

.golive-project {
  display: flex;
  flex-direction: column;
  gap: var(--fw-space-sm);
  padding: var(--fw-space-lg);
  cursor: pointer;
}
.golive-project:focus-visible {
  outline: 2px solid var(--fw-brand);
  outline-offset: 2px;
}

.golive-project__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--fw-space-sm);
}

.golive-project__name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.golive-project__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem var(--fw-space-sm);
  color: var(--fw-text-muted);
  overflow-wrap: anywhere;
}

/* Which task system a go-live is wired to. Worth a glance-level distinction
   while both are live: an Asana chip on a new go-live means someone pasted the
   wrong link. Colour is not the only signal — the label is spelled out. */
.golive-provider {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.05rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: var(--fw-radius-pill, 999px);
  font-weight: 600;
  white-space: nowrap;
}

.golive-provider--clicktrack { color: var(--fw-primary); }
.golive-provider--asana      { color: var(--fw-text-muted); }

/* The Font Awesome kit is Pro and swaps each <i> for an <svg> at runtime, so an
   `i`-only selector never matches on a rendered page. Always name both. */
.golive-provider i,
.golive-provider svg { font-size: 0.85em; }

.golive-project__meter { margin-top: auto; }

.golive-project__foot {
  display: flex;
  justify-content: space-between;
  color: var(--fw-text-muted);
}

/* ---------------------------------------------------------------------------
 * Checklist — header
 * ------------------------------------------------------------------------ */

.golive-back { margin-bottom: var(--fw-space-md); }

.golive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--fw-space-lg);
}

.golive-head__text { min-width: 0; }

.golive-head__title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.golive-head__meta {
  margin: var(--fw-space-xs) 0 0;
  color: var(--fw-text-muted);
  overflow-wrap: anywhere;
}

.golive-ring { flex-shrink: 0; }

.golive-metafields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--fw-space-md);
  margin-top: var(--fw-space-md);
}
.golive-metafields .fw-field { margin: 0; }

.golive-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fw-space-sm);
  margin-top: var(--fw-space-md);
}

.golive-danger-btn:hover {
  color: var(--fw-danger);
  border-color: color-mix(in srgb, var(--fw-danger) 45%, transparent);
}

.golive-autosync-note {
  margin: var(--fw-space-sm) 0 0;
  color: var(--fw-text-muted);
}

/* Status line under the header. Written with textContent, never markup. */
.golive-feedback {
  margin-top: var(--fw-space-sm);
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--fw-text-muted);
}
.golive-feedback.is-ok    { color: var(--fw-success); }
.golive-feedback.is-error { color: var(--fw-danger); }
.golive-feedback.is-info  { color: var(--fw-text-2); }

/* ---------------------------------------------------------------------------
 * Checklist — section quick-nav
 *
 * v1's equivalent was position:fixed beside the content and display:none below
 * 1300px, so it was invisible on a laptop. This scrolls horizontally when it has
 * to and stacks under 640px, where frikwork turns .fw-steps into a column.
 * ------------------------------------------------------------------------ */

.golive-nav {
  margin: 0 0 var(--fw-space-lg);
  padding: var(--fw-space-md) var(--fw-space-sm);
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
  background: var(--fw-bg-2);
  overflow-x: auto;
}

.golive-steps { min-width: 40rem; }

.golive-step__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.15rem 0.35rem;
  border: 0;
  border-radius: var(--fw-radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
  transition: background var(--fw-dur-fast, 0.15s) ease;
}
.golive-step__btn:hover { background: var(--fw-bg-hover); }

.golive-step__label { overflow-wrap: anywhere; }

.golive-step__count {
  font-size: 0.7rem;
  color: var(--fw-text-muted);
}
.golive-step.is-done .golive-step__count { color: var(--fw-brand-text); }

/* ---------------------------------------------------------------------------
 * Checklist — phases
 *
 * <details class="fw-accordion">, so a long section can be folded away. All
 * open by default, which is how v1 rendered them.
 * ------------------------------------------------------------------------ */

.golive-phase { margin-bottom: var(--fw-space-md); }
.golive-phase + .golive-phase { margin-top: 0; }

.golive-phase__head { flex-wrap: wrap; }

.golive-phase__icon { color: var(--fw-brand-text); }

.golive-phase__title {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.golive-phase__count {
  color: var(--fw-text-muted);
  white-space: nowrap;
}

.golive-phase__meter {
  flex: 0 0 5rem;
  width: 5rem;
}

.golive-phase__na { flex: 0 0 auto; }
.golive-phase__na:hover { color: var(--fw-warning); }

/* ---------------------------------------------------------------------------
 * Checklist — items
 * ------------------------------------------------------------------------ */

.golive-item {
  display: flex;
  align-items: flex-start;
  gap: var(--fw-space-sm);
  padding: var(--fw-space-sm) 0;
  border-top: 1px solid var(--fw-border);
}
.golive-item:first-child { border-top: 0; }

/* --- the four-state status control --------------------------------------- */

.golive-item__status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.1rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fw-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--fw-dur-fast, 0.15s) ease,
              background var(--fw-dur-fast, 0.15s) ease,
              color var(--fw-dur-fast, 0.15s) ease;
}
.golive-item__status:hover { transform: scale(1.15); }

.golive-item.is-done .golive-item__status {
  background: var(--fw-brand);
  color: var(--fw-on-primary);
  font-size: 0.8rem;
}
.golive-item.is-blocked .golive-item__status { color: var(--fw-warning); }
.golive-item.is-na      .golive-item__status { color: var(--fw-text-muted); }

/* --- body ----------------------------------------------------------------- */

.golive-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.golive-item__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.golive-item.is-done .golive-item__text {
  color: var(--fw-text-muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--fw-brand) 55%, transparent);
}
.golive-item.is-na .golive-item__text {
  color: var(--fw-text-muted);
  opacity: 0.75;
}

.golive-item__link {
  font-size: 0.8rem;
  white-space: nowrap;
}

.golive-item__actor {
  font-size: 0.7rem;
  padding: 0.05rem 0.45rem;
}

.golive-item__help {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--fw-text-muted);
  line-height: 1.45;
}

.golive-item__tools {
  display: flex;
  align-items: center;
  gap: var(--fw-space-sm);
  margin-top: var(--fw-space-sm);
}

.golive-item__select {
  flex: 0 0 8rem;
  width: 8rem;
}

.golive-item__notes {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------------------------------------------------------------------------
 * Licence key reveal
 *
 * The value arrives from an authenticated fetch and is written with
 * textContent. It is never in the page source and is cleared again on hide.
 * ------------------------------------------------------------------------ */

.golive-secret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fw-space-xs);
  margin-top: var(--fw-space-xs);
}

.golive-secret__value {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-sm);
  background: var(--fw-bg-2);
  color: var(--fw-brand-text);
  font-family: var(--fw-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
}

.golive-secret__copy.is-copied { color: var(--fw-success); }

/* ---------------------------------------------------------------------------
 * Delete dialog
 * ------------------------------------------------------------------------ */

.golive-delete-target {
  padding: var(--fw-space-sm) var(--fw-space-md);
  border-left: 3px solid var(--fw-danger);
  border-radius: var(--fw-radius-sm);
  background: var(--fw-bg-2);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------ */

@media (max-width: 760px) {
  .golive-actor { min-width: 100%; }

  .golive-connect__go { width: 100%; }

  .golive-head {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .golive-item__tools { flex-wrap: wrap; }
  .golive-item__select,
  .golive-item__notes { flex: 1 1 100%; width: 100%; }
}

@media (max-width: 640px) {
  /* frikwork stacks .fw-steps below 640px — let it, and drop the scroller. */
  .golive-nav { overflow-x: visible; }
  .golive-steps { min-width: 0; }

  .golive-step__btn {
    flex-direction: row;
    justify-content: space-between;
    gap: var(--fw-space-sm);
    width: 100%;
  }
}
