/* styles/sections/lite-form.css
 * The Lite request form shell (competitive teardown, accelerator coaches): a centered card on
 * the white page field with a step headline, deck, fields, a full-width submit, and the teardown's
 * loading, curation and confirmation steps. Fields, buttons and messages are the shared
 * .field/.input/.select, .btn and .form-message from forms.css and actions.css; this file
 * holds only the card, the step type and the steps JS builds (.lite-competitor-*).
 * Replaces css/lite-form.css. */
@layer sections {
  .lite-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--white);
    color: var(--ink);
    font-family: var(--font-body);
  }

  .lite-main {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    padding: var(--space-48) var(--space-24);
  }

  .lite-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    width: 100%;
    max-width: 544px;
  }

  .lite-all-tools {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 44px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--dur-fast);
  }

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

  .lite-card {
    width: 100%;
    padding: var(--space-24);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--elevation-floating);
  }

  /* Step type: the h3 role on the card scale, the body role for the deck. */
  .lite-headline {
    margin: 0 0 var(--space-16);
    font-family: var(--font-display);
    font-size: var(--t-h3-size);
    font-weight: 600;
    line-height: var(--t-h3-lh);
    letter-spacing: var(--t-h3-ls);
  }

  .lite-headline:focus {
    outline: none;
  }

  .lite-sub {
    margin: 0 0 var(--space-32);
    color: var(--ink-2);
    font-size: var(--t-body-size);
    line-height: var(--t-body-lh);
  }

  .lite-card .field {
    margin-bottom: var(--space-20);
  }

  /* JS shows and clears messages with [hidden]; forms.css gives them display. */
  .lite-card .field__error[hidden],
  .lite-card .form-message[hidden] {
    display: none;
  }

  .lite-microcopy {
    margin: calc(-1 * var(--space-8)) 0 var(--space-16);
    color: var(--ink-55);
    font-size: 14px;
    line-height: 1.4;
  }

  .lite-submit {
    width: 100%;
    margin-top: var(--space-8);
  }

  /* The frozen JS sets disabled with aria-busy; busy keeps full opacity (btewR), 0.42 is disabled only. */
  .lite-submit[aria-busy="true"] {
    opacity: 1;
    cursor: progress;
  }

  .lite-form-error {
    margin: var(--space-16) 0 0;
  }

  .lite-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0 0 var(--space-8);
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-2);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
  }

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

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

  .lite-preview-list li {
    position: relative;
    padding-left: var(--space-24);
    color: var(--ink-2);
    line-height: 1.5;
  }

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

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

  .lite-preview-note {
    margin: 0 0 var(--space-32);
    color: var(--ink-55);
    font-size: 14px;
  }

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

  #turnstile-container.is-interactive {
    display: block;
  }

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

  /* Confirmation */
  .lite-done-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 0 var(--space-24);
    border-radius: 50%;
    background: var(--fern);
    color: var(--white);
  }

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

  /* Discovery wait: the orb, staged status and the names as they arrive */
  .lite-loading-orb {
    display: flex;
    gap: var(--space-8);
    margin: 0 0 var(--space-24);
  }

  .lite-loading-orb span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--fern);
    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 {
    min-height: 1.5em; /* the staged copy swaps without a jump */
    margin-bottom: var(--space-16);
  }

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

  .lite-discovery-name {
    color: var(--ink);
    font-size: var(--t-body-lg-size);
    font-weight: 600;
    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 */
  .lite-manual-note {
    margin: 0 0 var(--space-24);
    color: var(--ink-2);
    line-height: 1.5;
  }

  .lite-stub-note {
    margin: 0 0 var(--space-16);
    padding: var(--space-8) var(--space-16);
    border: 1px solid var(--rule-edge);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.5;
  }

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

  .lite-competitor-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-12);
    padding: var(--space-16);
    border: 1px solid var(--rule-edge);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: border-color var(--dur-fast), opacity var(--dur-fast), background-color var(--dur-fast);
  }

  /* Deselected cards stay visible so they can be added back, and read as off. */
  .lite-competitor-card[data-selected="false"] {
    background: var(--paper);
  }

  .lite-competitor-card[data-selected="false"] .lite-competitor-body {
    color: var(--ink-55);
  }

  .lite-competitor-card[data-selected="true"] {
    border-color: var(--fern);
  }

  .lite-competitor-toggle {
    position: relative;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    padding: 0;
    border: 2px solid var(--field-edge);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    transition: border-color var(--dur-fast), background-color var(--dur-fast);
  }

  /* 44px hit area around the 22px box */
  .lite-competitor-toggle::before {
    content: "";
    position: absolute;
    inset: -11px;
  }

  .lite-competitor-toggle:hover {
    border-color: var(--ink);
  }

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

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

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

  .lite-competitor-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-8);
  }

  .lite-competitor-title strong {
    font-weight: 600;
  }

  .lite-competitor-domain {
    color: var(--ink-55);
    font-size: 14px;
  }

  .lite-competitor-oneliner {
    margin: var(--space-4) 0 0;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.5;
  }

  .lite-competitor-remove {
    flex: none;
    min-width: 44px;
    min-height: 44px;
    margin: calc(-1 * var(--space-12)) calc(-1 * var(--space-12)) 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-55);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color var(--dur-fast);
  }

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

  .lite-add-row {
    display: flex;
    gap: var(--space-8);
    margin: 0 0 var(--space-16);
  }

  .lite-add-row .input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .lite-add-btn {
    flex: none;
  }

  @media (width >= 900px) {
    .lite-main {
      padding-block: var(--space-64);
    }

    .lite-card {
      padding: var(--space-32);
      border-radius: var(--radius-xl);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .lite-loading-orb span,
    .lite-discovery-name {
      animation: none;
    }

    .lite-loading-orb span {
      opacity: 0.7;
    }
  }

  @media (forced-colors: active) {
    .lite-card,
    .lite-competitor-card {
      border-color: CanvasText;
    }

    .lite-competitor-toggle[aria-pressed="true"] {
      background: Highlight;
    }
  }
}
