/* ===================================================================
   Legal & Support Pages — PixRemix v2.1
   Terms, Privacy, Contact, and Error (404/500) pages.
   Uses design tokens from variables.css.
   =================================================================== */

@layer pages {

  /* ---------------------------------------------------------------
     Contact Page
     --------------------------------------------------------------- */
  .contact-page {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-6) 0;
  }

  .contact-page h1 {
    margin-bottom: var(--space-3);
  }

  .contact-page > p {
    font-size: var(--text-base);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
  }

  .contact-channels {
    display: grid;
    gap: var(--space-5);
    margin-bottom: var(--space-8);
  }

  .contact-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6);
    background: var(--surface-white);
    border: 1px solid var(--neutral-100);
    border-radius: var(--radius-lg);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
  }

  .contact-channel:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }

  .contact-channel-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-warm);
    border-radius: var(--radius-full);
  }

  .contact-channel-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .contact-channel h3 {
    font-size: var(--text-lg);
    margin: 0;
  }

  .contact-channel p {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    margin: 0;
  }

  .contact-channel a {
    color: var(--accent);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .contact-channel a:hover {
    color: var(--accent-hover);
  }

  /* Social row */
  .contact-social-row {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
  }

  .contact-social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-50);
    border-radius: var(--radius-full);
    color: var(--neutral-600);
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out);
  }

  .contact-social-link:hover {
    background: var(--accent);
    color: var(--surface-white);
    transform: scale(1.08);
  }

  .contact-social-link svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }

  /* ---------------------------------------------------------------
     Legal Pages (Terms + Privacy shared styles)
     --------------------------------------------------------------- */
  .legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-4) 0;
  }

  .legal-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--accent);
    text-decoration: none;
    margin-bottom: var(--space-6);
    transition: color var(--duration-fast) var(--ease-out);
  }

  .legal-back:hover {
    color: var(--accent-hover);
  }

  .legal-back svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .legal-page h1 {
    margin-bottom: var(--space-2);
  }

  .legal-updated {
    font-size: var(--text-sm);
    color: var(--neutral-400);
    margin-bottom: var(--space-8);
  }

  .legal-intro {
    font-size: var(--text-base);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
  }

  .legal-section {
    margin-bottom: var(--space-8);
  }

  .legal-section h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--neutral-100);
  }

  .legal-section p {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-3);
  }

  .legal-section ul {
    margin-bottom: var(--space-3);
    padding-left: var(--space-5);
  }

  .legal-section li {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-2);
    list-style-type: disc;
    padding-left: var(--space-1);
  }

  .legal-section li::marker {
    color: var(--neutral-200);
  }

  .legal-section a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .legal-section a:hover {
    color: var(--accent-hover);
  }

  .legal-section strong {
    color: var(--neutral-900);
  }

  /* ---------------------------------------------------------------
     Error Pages (404 / 500) — standalone, embedded CSS
     These classes are used inside standalone templates.
     --------------------------------------------------------------- */
  .error-page {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-6);
  }

  .error-illustration {
    width: 160px;
    height: 160px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .error-illustration svg {
    width: 100%;
    height: 100%;
  }

  .error-code {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    color: var(--accent);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
  }

  .error-page h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-3);
    color: var(--neutral-900);
  }

  .error-page p {
    font-size: var(--text-base);
    color: var(--neutral-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-2);
  }

  .error-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-6);
  }

  /* --- Mobile --- */
  @media (max-width: 768px) {
    .contact-channels {
      gap: var(--space-3);
    }

    .contact-channel {
      padding: var(--space-4);
    }

    .legal-section h2 {
      font-size: var(--text-lg);
    }

    .error-illustration {
      width: 120px;
      height: 120px;
    }

    .error-code {
      font-size: var(--text-3xl);
    }

    .error-page h1 {
      font-size: var(--text-xl);
    }
  }
}
