/* Audit panel — before/after comparison, scores, arrow */

@layer components {
  /* --- Mobile Compare: phone frame aspect ratio --- */

  .audit-compare--mobile .audit-panel__screenshot-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  .audit-panel__screenshot--mobile {
    width: 100%;
    height: auto;
    display: block;
  }

  .audit-compare--mobile .audit-panel__demo-preview {
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 9 / 16;
  }

  .compare-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-sm);
  }

  /* --- Audit Section: Before / After --- */

  .audit-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-md);
    align-items: center;
    margin-top: var(--space-xl);
  }

  .audit-panel {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .audit-panel__header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .audit-panel__badge {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25em 0.625em;
    border-radius: 2px;
  }
  .audit-panel__badge--before {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
  }
  .audit-panel__badge--after {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
  }

  .audit-panel__site-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
  }

  .audit-panel__screenshot-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0c0c1a;
  }

  .audit-panel__screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    opacity: 0.65;
    filter: saturate(0.6) contrast(1.05);
  }

  .audit-panel__screenshot--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c0c1a;
    color: rgba(255, 255, 255, 0.18);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .audit-panel__demo-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--space-md);
    background: linear-gradient(
      150deg,
      var(--color-primary) 0%,
      var(--color-primary-dark) 100%
    );
    text-align: center;
  }

  .audit-panel__demo-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: #fff;
    line-height: 1.3;
  }

  .audit-panel__demo-sub {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .audit-panel__footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .audit-score {
    display: flex;
    align-items: baseline;
    gap: 0.15em;
    line-height: 1;
  }

  .audit-score__num {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
  }
  .audit-panel--before .audit-score__num {
    color: #fca5a5;
  }
  .audit-panel--after .audit-score__num {
    color: #86efac;
  }

  .audit-score__denom {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.35);
  }

  .audit-score__label {
    margin-left: auto;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .audit-compare__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
  }

  .audit-compare__arrow svg {
    width: 1.5rem;
    height: 1.5rem;
  }
}
