/*
 * JPG & Photos to PDF: Pagefit — privacy, terms and support pages.
 * Colors are the app's asset-catalog palette (specs/005-photostopdf-legal-pages/contracts/palette.md).
 * Components use only these tokens.
 */
:root {
  --app-background: #FBFAF8;
  --canvas: #E9E6E0;
  --surface: #FFFFFF;
  --surface-border: rgb(0 0 0 / 0.12);
  --ink: #1A1917;
  --ink-secondary: #6B6760;
  --accent: #2E4A7A;
  --pro-accent: #F5A524;
  --success: #1E7F55;
  --danger: #C8322F;
  color-scheme: light dark;
}

/* Later layers win: light, dark, more contrast, dark with more contrast, then print. */
@media (prefers-color-scheme: dark) {
  :root {
    --app-background: #0E0D0C;
    --canvas: #262422;
    --surface: #1C1B1A;
    --surface-border: rgb(255 255 255 / 0.14);
    --ink: #F2F0EC;
    --ink-secondary: #A19C94;
    --accent: #A8BCE4;
    --pro-accent: #FFB84D;
    --success: #3CCB8B;
    --danger: #FF6B73;
  }
}

@media (prefers-contrast: more) {
  :root {
    --app-background: #FFFFFF;
    --canvas: #DAD6CE;
    --surface: #FFFFFF;
    --surface-border: rgb(0 0 0 / 0.30);
    --ink: #000000;
    --ink-secondary: #4A4741;
    --accent: #1F3D6B;
    --pro-accent: #F5A524;
    --success: #15603F;
    --danger: #A3221F;
  }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root {
    --app-background: #000000;
    --canvas: #2E2C29;
    --surface: #1C1B1A;
    --surface-border: rgb(255 255 255 / 0.35);
    --ink: #FFFFFF;
    --ink-secondary: #C4BFB7;
    --accent: #B3C5E8;
    --pro-accent: #FFB84D;
    --success: #5ED8A0;
    --danger: #FF8A90;
  }
}

/* Print always uses the light palette, whatever the screen appearance. */
@media print {
  :root {
    --app-background: #FBFAF8;
    --canvas: #E9E6E0;
    --surface: #FFFFFF;
    --surface-border: rgb(0 0 0 / 0.12);
    --ink: #1A1917;
    --ink-secondary: #6B6760;
    --accent: #2E4A7A;
    --pro-accent: #F5A524;
    --success: #1E7F55;
    --danger: #C8322F;
    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--app-background);
  color: var(--ink);
  line-height: 1.7;
}

.container {
  width: min(56rem, 100%);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--surface-border);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.125rem, 6vw, 3.5rem);
  line-height: 1.1;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  color: var(--ink);
}

h3 {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
  color: var(--ink);
}

.subtitle {
  max-width: 42.5rem;
  margin: 1.125rem auto 0;
  color: var(--ink-secondary);
  font-size: 1.125rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.75rem;
}

.meta-item {
  padding: 1rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.meta-label {
  display: block;
  color: var(--ink-secondary);
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}

.meta-value {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--surface-border);
}

section:first-of-type {
  border-top: none;
}

p {
  margin: 0 0 0.875rem;
  color: var(--ink-secondary);
}

ul {
  margin: 0.75rem 0 0;
  padding-left: 1.375rem;
  color: var(--ink-secondary);
}

li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--ink);
}

a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Canvas carries ink only: ink secondary on canvas is too close to 4.5:1. */
.notice {
  margin: 1.5rem 0;
  padding: 1.125rem;
  border-radius: 16px;
  background: var(--canvas);
  color: var(--ink);
}

.notice p {
  margin: 0;
  color: var(--ink);
}

/* The app's primary button: a solid ink capsule with an app-background label. */
.button {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--app-background);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: none;
}

.contact {
  text-align: center;
}

.contact-address {
  margin-top: 1rem;
  color: var(--ink-secondary);
}

.contact-address strong {
  user-select: all;
  overflow-wrap: anywhere;
}

.hint {
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.faq section {
  padding: 1.125rem 0;
}

/* Matches the app's Pro badge: black text on the Pro accent. Never use the Pro accent as a text color. */
.pro-pill {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--pro-accent);
  color: #000000;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer {
  text-align: center;
  color: var(--ink-secondary);
  font-size: 0.875rem;
  margin-top: 1.75rem;
}

.footer-links {
  margin-bottom: 0.5rem;
}

/* In em so that enlarged text also switches to the narrow layout. */
@media (max-width: 37.5em) {
  .container {
    padding: 2rem 1rem;
  }

  .card {
    padding: 1.375rem;
  }

  .meta {
    grid-template-columns: 1fr;
  }

  section {
    padding: 1.25rem 0;
  }
}

/* After the components, so these win in print: no fills, and the button stays readable. */
@media print {
  .card,
  .meta-item,
  .notice,
  .badge {
    background: none;
  }

  .button {
    background: none;
    color: var(--ink);
    border: 1px solid var(--ink);
  }

  .container {
    padding: 0;
  }
}
