/* css/lite-form.css - Brief Lite 2-step request form (standalone page) */

.lite-page {
  margin: 0;
  background: var(--color-background-subtle);
  color: var(--color-text);
  /* flex column so the form fills the space between the site header and footer
     instead of forcing a full-viewport main that pushes the footer off-screen */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.lite-main {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-md);
  box-sizing: border-box;
}

/* Column wrapper holding the "All tools" link above the card, both capped to
   the card width so the link aligns with the card's left edge. */
.lite-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 34rem;
}

.lite-all-tools {
  align-self: flex-start;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: var(--space-xs) 0;
  transition: color 0.15s ease;
}

.lite-all-tools:hover {
  color: var(--color-text);
}

.lite-card {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-large);
  padding: var(--space-xl);
  box-sizing: border-box;
}

/* ---- shared step typography ---- */
.lite-headline {
  font-family: var(--font-family-headers);
  font-weight: var(--font-weight-black);
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-md);
}

.lite-sub {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  margin: 0 0 var(--space-xl);
}

/* ---- fields ---- */
.lite-field {
  margin-bottom: var(--space-lg);
}

.lite-field label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
}

.lite-field input,
.lite-field select {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  /* Shared min-height so the native <select> matches the text inputs; browsers
     apply vertical padding to <select> inconsistently, leaving it visually tight. */
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lite-field select {
  /* Native select keeps its own control affordance; ensure text aligns like inputs */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357534E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
}

.lite-field input::placeholder {
  color: var(--color-text-muted);
}

.lite-field input:focus-visible,
.lite-field select:focus-visible {
  outline: none;
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus-ring) 18%, transparent);
}

.lite-field input[aria-invalid="true"],
.lite-field select[aria-invalid="true"] {
  border-color: var(--color-amber);
}

.lite-field-error {
  margin: var(--space-sm) 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-amber-dark);
}

/* ---- submit + actions ---- */
.lite-submit {
  width: 100%;
  margin-top: var(--space-sm);
}

.lite-submit[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.lite-back {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 var(--space-md);
  cursor: pointer;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.lite-back:hover {
  color: var(--color-text);
}

.lite-back:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- preview (state 2) ---- */
.lite-preview-list {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  display: grid;
  gap: var(--space-md);
}

.lite-preview-list li {
  position: relative;
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

.lite-preview-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
}

.lite-preview-list strong {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.lite-preview-note {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xl);
}

.lite-microcopy {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: calc(-1 * var(--space-sm)) 0 var(--space-md);
}

/* ---- turnstile (hidden unless an interactive challenge is on-screen) ---- */
#turnstile-container {
  display: none;
  margin-bottom: var(--space-md);
}

/* Revealed ONLY between before-interactive-callback and after-interactive-callback. */
#turnstile-container.is-interactive {
  display: block;
}

#turnstile-container:empty {
  margin-bottom: 0;
}

/* ---- form-level error ---- */
.lite-form-error {
  margin: var(--space-md) 0 0;
  padding: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-amber-dark);
  background: color-mix(in srgb, var(--color-amber) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-amber) 25%, transparent);
  border-radius: 10px;
}

/* ---- confirmation (state 3) ---- */
.lite-done-mark {
  width: 56px;
  height: 56px;
  margin: 0 0 var(--space-lg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #ffffff;
}

.lite-done-mark svg {
  width: 28px;
  height: 28px;
}

/* ---- discovery loading (state 2) ---- */
/* The wait IS the demo: an animated orb + staged status copy + progressively
   revealed names, not a bare spinner. */
.lite-loading-orb {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 var(--space-lg);
}

.lite-loading-orb span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: lite-orb-pulse 1.2s ease-in-out infinite;
}

.lite-loading-orb span:nth-child(2) { animation-delay: 0.18s; }
.lite-loading-orb span:nth-child(3) { animation-delay: 0.36s; }

@keyframes lite-orb-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.lite-loading-status {
  margin-bottom: var(--space-md);
  min-height: 1.5em; /* avoid layout jump as the staged copy swaps */
}

.lite-discovery-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.lite-discovery-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  animation: lite-name-in 0.32s ease both;
}

@keyframes lite-name-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- curation (state 3) ---- */
.lite-manual-note {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  margin: 0 0 var(--space-lg);
}

/* Demo-data marker (stub mode only) — visible enough that QA doesn't read the
   fixed sample as real results. */
.lite-stub-note {
  font-size: var(--font-size-sm);
  color: var(--color-amber-dark);
  line-height: var(--line-height-normal);
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: color-mix(in srgb, var(--color-amber) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-amber) 25%, transparent);
  border-radius: 10px;
}

.lite-competitor-list {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.lite-competitor-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: border-color 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

/* Deselected cards stay visible (so the user can re-add) but read as "off". */
.lite-competitor-card[data-selected="false"] {
  opacity: 0.55;
  background: var(--color-background-subtle);
}

.lite-competitor-card[data-selected="true"] {
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
}

/* The checkbox-style toggle. */
.lite-competitor-toggle {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lite-competitor-toggle[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.lite-competitor-toggle[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lite-competitor-toggle:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.lite-competitor-body {
  flex: 1 1 auto;
  cursor: pointer;
  min-width: 0;
}

.lite-competitor-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lite-competitor-title strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.lite-competitor-domain {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.lite-competitor-oneliner {
  margin: var(--space-xs, 0.25rem) 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

.lite-competitor-remove {
  flex: 0 0 auto;
  appearance: none;
  background: none;
  border: none;
  padding: 0 0.25rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.lite-competitor-remove:hover {
  color: var(--color-amber-dark);
}

.lite-competitor-remove:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Add-your-own row (load-bearing: the only way to inject a missed competitor). */
.lite-add-row {
  display: flex;
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
}

.lite-add-row input {
  flex: 1 1 auto;
  box-sizing: border-box;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lite-add-row input::placeholder {
  color: var(--color-text-muted);
}

.lite-add-row input:focus-visible {
  outline: none;
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus-ring) 18%, transparent);
}

.lite-add-btn {
  flex: 0 0 auto;
}

/* ---- responsive ---- */
@media (max-width: 768px) {
  .lite-card {
    padding: var(--space-lg);
    border-radius: 14px;
  }

  .lite-headline {
    font-size: var(--font-size-2xl);
  }

  .lite-sub {
    font-size: var(--font-size-base);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lite-field input,
  .lite-field select,
  .btn {
    transition: none;
  }

  .lite-loading-orb span,
  .lite-discovery-name {
    animation: none;
  }

  /* Keep the orb readable without pulsing. */
  .lite-loading-orb span {
    opacity: 0.7;
  }
}
