/* AIPEX brand base: motion tokens (emil-design-eng) and global press feedback.
   Fonts load with the theme: themes/aipex/aipex.fonts.css.
   Linked from index.html. Colors live in the Astryx theme, not here. See BRAND.md. */

:root {
  /* Brand constants for places theme tokens don't cover (orange signal surface). */
  --brand-negro: #010102;
  --brand-violeta: #7022fc;
  --brand-naranja: #fd8f32;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-press: 140ms;
  --duration-fast: 180ms;
  --duration-base: 240ms;
  --duration-enter: 280ms;
  --motion-y: 6px;
}

/* Brand headings: Archivo at a slightly wide stretch (manual: 104-112%). */
h1, h2, h3, h4, h5, h6 {
  font-stretch: 108%;
}

html {
  /* App mode is mirrored into color-scheme by App.tsx, so the page edge matches the theme. */
  background-color: light-dark(#ffffff, #010102);
}

body {
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

/* Press feedback for Astryx pressables the theme editor can't reach (Button gets it from the theme).
   Uses the individual `scale` property so it never fights a component's own transform. */
:where(.astryx-segmented-control-item, .astryx-icon-button, .astryx-clickable-card, .astryx-token, .astryx-dropdown-menu-item) {
  transition-property: color, background-color, box-shadow, border-color, scale;
  transition-duration: var(--duration-press);
  transition-timing-function: var(--ease-out);
}
:where(.astryx-segmented-control-item, .astryx-icon-button, .astryx-token):not(:disabled, [aria-disabled='true']):active {
  scale: 0.96;
}
:where(.astryx-clickable-card):not([aria-disabled='true']):active {
  scale: 0.98;
}

/* Reduced motion = fewer, gentler animations, not zero: entrances become pure fades
   (no rise), long decorative motion stops. Press feedback and color changes stay. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-y: 0px;
  }
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}

/* Template editor page (src/components/admin/DocEditor.tsx). TipTap renders its own DOM, so its
   page styles live here. It mirrors the PDF (src/crm/richPdf.ts): white letter sheet, 2.2 cm
   margins, faint logo top-right, Archivo titles, Inter body. Same look in light and dark mode. */
.aipex-doc-page {
  position: relative;
  box-sizing: border-box;
  max-width: 816px;
  min-height: 560px;
  margin: 24px auto;
  padding: 120px 83px 83px;
  background: #ffffff;
  color: #010102;
  font-family: 'Inter Variable', Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 24px rgb(0 0 0 / 0.12);
  outline: none;
  caret-color: #7022fc;
}
.aipex-doc-page::before {
  content: '';
  position: absolute;
  top: 83px;
  right: 83px;
  width: 140px;
  height: 26px;
  background: url('/brand/logos/aipex-horizontal-negro.svg') no-repeat right top / contain;
  opacity: 0.15;
  pointer-events: none;
}
/* The app sets text color on elements; on the sheet everything is ink. */
.aipex-doc-page p, .aipex-doc-page h1, .aipex-doc-page h2, .aipex-doc-page li, .aipex-doc-page strong, .aipex-doc-page em, .aipex-doc-page u { color: #010102; }
.aipex-doc-page h1 { font-family: 'Archivo', sans-serif; font-weight: 700; font-stretch: 108%; font-size: 24px; line-height: 1.3; margin: 0 0 18px; }
.aipex-doc-page h2 { font-family: 'Archivo', sans-serif; font-weight: 700; font-stretch: 108%; font-size: 16px; line-height: 1.4; margin: 14px 0 8px; }
.aipex-doc-page p { margin: 0 0 9px; }
.aipex-doc-page ul, .aipex-doc-page ol { margin: 0 0 9px; padding-left: 22px; }
.aipex-doc-page li p { margin: 0 0 4px; }
.aipex-doc-page strong { font-weight: 600; }
.aipex-doc-page span[data-variable] {
  font-size: 0;
  white-space: nowrap;
}
.aipex-doc-page span[data-variable]::before {
  content: attr(data-label);
  font-size: 13px;
  font-weight: 500;
  font-style: normal;
  text-decoration: none;
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  background: #efe7ff;
  color: #5b16d9;
  line-height: 1.6;
}
.aipex-doc-page span[data-variable].ProseMirror-selectednode::before {
  outline: 2px solid #7022fc;
  outline-offset: 1px;
}
@media (max-width: 640px) {
  .aipex-doc-page { margin: 0; padding: 72px 20px 32px; border-radius: 0; font-size: 15px; }
  .aipex-doc-page::before { top: 24px; right: 20px; width: 110px; }
}
