/* =========================================
   Legal pages - privacy policy, terms of service
   Ported from src/pages/Privacy.tsx in the client's Lovable project, which
   Terms shares the layout of.

   Shared rather than per-page because both pages render the same template
   from LegalPage; scoped to body.doc-page, which that class adds.
   ========================================= */

body.doc-page .app-page-content {
  padding: 0 !important;
}

/* usesWebFont() loads Montserrat and adds .modern-type, but moved.css pins the
   system stack on `body, button, input, select, textarea`; the family still has
   to be declared. Same pattern as body.auth-page and body.lovable-page. */
body.doc-page,
body.doc-page button,
body.doc-page input,
body.doc-page select,
body.doc-page textarea {
  font-family: "Montserrat", sans-serif;
}

body.doc-page .doc-page-wrap {
  color: #25153c;
}

body.doc-page .doc-gradient-text {
  background-image: linear-gradient(to right, #9333ea, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Hero ------------------------------------------------------------- */

body.doc-page .doc-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 24px 64px; /* pt-12 px-6 pb-16 */
  background-image: linear-gradient(
    to bottom right,
    #faf5ff,
    #ffffff,
    rgba(255, 247, 237, 0.3)
  );
}

body.doc-page .doc-hero-inner {
  max-width: 1152px; /* max-w-6xl */
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

/* text-5xl and text-6xl each carry their own line-height of 1, which beats the
   inherited leading; tracking-tight is -0.025em. */
body.doc-page .doc-hero h1 {
  margin: 0 0 20px; /* mb-5 */
  font-size: 48px; /* text-5xl */
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #25153c;
}

body.doc-page .doc-lead {
  margin: 0;
  max-width: 448px; /* max-w-md */
  font-size: 18px;
  line-height: 1.625;
  color: #6c5393;
}

/* The "last updated" pill. */
body.doc-page .doc-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  padding: 8px 16px;
  border: 1px solid #e6dbf0;
  border-radius: 9999px;
  background: #ffffff;
  font-size: 14px;
  color: #6c5393;
}

body.doc-page .doc-stamp svg {
  width: 16px;
  height: 16px;
  color: #9333ea;
}

body.doc-page .doc-hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.doc-page .doc-hero-glow {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-image: linear-gradient(
    to bottom right,
    rgba(192, 132, 252, 0.2),
    rgba(251, 146, 60, 0.2)
  );
  filter: blur(64px);
}

body.doc-page .doc-hero-art img {
  position: relative;
  width: 320px; /* w-80 */
  height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
}

/* Pages without an illustration put a lucide icon on a gradient tile in the
   same 320px slot. */
body.doc-page .doc-hero-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px; /* w-80 */
  height: 320px;
  border: 1px solid #e6dbf0;
  border-radius: 24px; /* rounded-3xl */
  background-image: linear-gradient(
    to bottom right,
    #f3e8ff,
    #ffffff,
    #ffedd5
  );
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-2xl */
}

body.doc-page .doc-hero-tile svg {
  width: 128px; /* w-32 */
  height: 128px;
  color: rgba(147, 51, 234, 0.7);
  stroke-width: 1.2;
}

/* --- Layout ----------------------------------------------------------- */

body.doc-page .doc-content {
  padding: 48px 24px; /* py-12 px-6 */
}

body.doc-page .doc-content-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

/* --- Table of contents ------------------------------------------------ */

body.doc-page .doc-toc-card {
  display: block;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
}

body.doc-page .doc-toc-card h4,
body.doc-page .doc-help h4 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6c5393;
  padding: 0 8px;
}

body.doc-page .doc-toc-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: #6c5393;
  text-decoration: none;
  transition: background-image 0.2s ease, color 0.2s ease;
}

body.doc-page .doc-toc-link + .doc-toc-link {
  margin-top: 4px;
}

body.doc-page .doc-toc-link:hover {
  background-image: linear-gradient(
    to right,
    rgba(147, 51, 234, 0.1),
    rgba(249, 115, 22, 0.1)
  );
  color: #7e22ce;
}

/* Current section: the gradient fills the row rather than the text. */
body.doc-page .doc-toc-link.is-active {
  background-image: linear-gradient(to right, #9333ea, #f97316);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

body.doc-page .doc-help {
  margin-top: 16px;
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  padding: 20px;
  background-image: linear-gradient(to bottom right, #faf5ff, #fff7ed);
}

body.doc-page .doc-help h4 {
  padding: 0;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: #25153c;
}

body.doc-page .doc-help-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 12px;
  background-image: linear-gradient(to bottom right, #9333ea, #f97316);
  color: #ffffff;
}

body.doc-page .doc-help-icon svg {
  width: 20px;
  height: 20px;
}

body.doc-page .doc-help p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #6c5393;
}

body.doc-page .doc-help a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

/* --- Policy body ------------------------------------------------------ */

body.doc-page .doc-body {
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background: #ffffff;
  padding: 32px; /* p-8 */
}

/* react.css sets `p { margin-bottom: 0 !important }` globally, so every
   paragraph rule on this page has to answer in kind. */
body.doc-page .doc-effective {
  margin: 0 0 32px !important;
  font-size: 14px;
  line-height: 20px;
  font-style: italic;
  color: #6c5393;
}

body.doc-page .doc-effective strong {
  color: #25153c;
  font-style: normal;
}

body.doc-page .doc-section + .doc-section {
  margin-top: 40px; /* space-y-10 */
  padding-top: 24px; /* pt-6 */
  border-top: 1px solid #e6dbf0;
}

/* scroll-mt so anchor jumps clear the sticky top bar */
body.doc-page .doc-section {
  scroll-margin-top: 96px;
}

body.doc-page .doc-section h2 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: #25153c;
}

body.doc-page .doc-section h3 {
  margin: 24px 0 12px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: #25153c;
}

body.doc-page .doc-section p,
body.doc-page .doc-intro p {
  margin: 0 0 16px !important;
  font-size: 16px;
  line-height: 26px;
  color: #6c5393;
}

body.doc-page .doc-list {
  margin: 0 0 16px;
  padding-left: 24px;
  list-style: disc;
  color: #6c5393;
}

body.doc-page .doc-list li {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
}

/* space-y-1 in the design: the gap sits between items, not around them. */
body.doc-page .doc-list li + li {
  margin-top: 4px;
}

/* Brief tint after jumping to a section, so the eye lands in the right place. */
body.doc-page .doc-section.is-flash {
  animation: doc-flash 1.8s ease-out;
}

@keyframes doc-flash {
  0% {
    background: rgba(245, 240, 250, 0.9);
    box-shadow: 0 0 0 12px rgba(245, 240, 250, 0.9);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 12px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.doc-page .doc-section.is-flash {
    animation: none;
  }
}

/* --- Wider screens ---------------------------------------------------- */

@media (min-width: 768px) {
  body.doc-page .doc-hero,
  body.doc-page .doc-content {
    padding-left: 48px; /* md:px-12 */
    padding-right: 48px;
  }

  body.doc-page .doc-hero-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.doc-page .doc-hero h1 {
    font-size: 60px; /* md:text-6xl */
  }

  body.doc-page .doc-content-inner {
    grid-template-columns: 260px 1fr;
  }

  body.doc-page .doc-toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: auto;
  }

  body.doc-page .doc-body {
    padding: 40px; /* md:p-10 */
  }
}

/* --- Right column ----------------------------------------------------- */

/* space-y-6 between the optional panel and the body card. Pages without a
   panel are unaffected - a single child lays out the same either way. */
body.doc-page .doc-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* --- Cookie preferences panel ----------------------------------------- */

body.doc-page .doc-prefs {
  border: 1px solid #e6dbf0;
  border-radius: 16px;
  background: #ffffff;
  padding: 24px;
}

body.doc-page .doc-prefs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

body.doc-page .doc-prefs-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-image: linear-gradient(to bottom right, #9333ea, #f97316);
  color: #ffffff;
}

body.doc-page .doc-prefs-icon svg {
  width: 20px;
  height: 20px;
}

body.doc-page .doc-prefs h2 {
  margin: 0;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: #25153c;
}

body.doc-page .doc-prefs-head p {
  margin: 0 !important;
  font-size: 14px;
  line-height: 20px;
  color: #6c5393;
}

body.doc-page .doc-prefs-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

body.doc-page .doc-prefs-row + .doc-prefs-row {
  border-top: 1px solid #e6dbf0;
}

body.doc-page .doc-prefs-copy {
  min-width: 0;
}

body.doc-page .doc-prefs-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.doc-page .doc-prefs h3 {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: #25153c;
}

body.doc-page .doc-prefs-badge {
  padding: 2px 6px;
  border-radius: 9999px;
  background: #f3e8ff;
  color: #7e22ce;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

body.doc-page .doc-prefs-row p {
  margin: 4px 0 0 !important;
  font-size: 14px;
  line-height: 20px;
  color: #6c5393;
}

/* Presentational switch: a span, not a control, because nothing is wired to
   it yet. Sized from the design's shadcn Switch. */
body.doc-page .doc-switch {
  position: relative;
  flex: none;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  background: #e6dbf0;
}

body.doc-page .doc-switch.is-on {
  background: #7e60f6;
}

body.doc-page .doc-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

body.doc-page .doc-switch.is-on .doc-switch-thumb {
  left: auto;
  right: 2px;
}

body.doc-page .doc-prefs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

body.doc-page .doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid #e6dbf0;
  border-radius: 12px;
  background: #ffffff;
  color: #25153c;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

body.doc-page .doc-btn:hover {
  background: #f5f0fa;
}

body.doc-page .doc-btn--primary {
  border-color: transparent;
  background-image: linear-gradient(to right, #9333ea, #f97316);
  color: #ffffff;
}

body.doc-page .doc-btn--primary:hover {
  background: transparent;
  opacity: 0.9;
}

body.doc-page .doc-btn svg {
  width: 16px;
  height: 16px;
}

/* --- Shared section components ---------------------------------------- */

/* Blocks that more than one SectionedPage needs. Anything used by a single
   page stays in that page's own stylesheet. */

/* Opt-in, for pages whose every section is one paragraph then a block of cards
   - see SectionedPage::usesSpacedProse(). */
body.doc-page.doc-spaced .doc-section > p {
  margin-bottom: 24px !important;
}

/* Numbered card grid - "how we work" on /press and /careers. */
body.doc-page .doc-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px; /* gap-4 */
}

body.doc-page .doc-card {
  padding: 20px; /* p-5 */
  border: 1px solid #e6dbf0;
  border-radius: 12px; /* rounded-xl */
  transition: border-color 0.15s ease;
}

body.doc-page .doc-card:hover {
  border-color: #d8b4fe; /* purple-300 */
}

body.doc-page .doc-card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

body.doc-page .doc-card-number {
  font-size: 20px; /* text-xl */
  line-height: 28px;
  font-weight: 800;
}

body.doc-page .doc-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: #25153c;
}

body.doc-page .doc-card p {
  margin: 0 !important;
  font-size: 14px;
  line-height: 22.75px; /* leading-relaxed */
  color: #6c5393;
}

/* Row list - press coverage, open roles. */
body.doc-page .doc-rows {
  border: 1px solid #e6dbf0;
  border-radius: 12px;
  overflow: hidden;
}

body.doc-page .doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

body.doc-page .doc-row + .doc-row {
  border-top: 1px solid #e6dbf0;
}

body.doc-page .doc-row:hover {
  background-image: linear-gradient(
    to right,
    rgba(250, 245, 255, 0.5),
    rgba(255, 247, 237, 0.5)
  );
}

body.doc-page .doc-row-copy {
  display: block;
  min-width: 0;
  flex: 1;
}

body.doc-page .doc-row-title {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: #25153c;
  transition: color 0.15s ease;
}

body.doc-page .doc-row:hover .doc-row-title {
  color: #7e22ce; /* purple-700 */
}

body.doc-page .doc-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 6px; /* mt-1.5 */
}

body.doc-page .doc-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 16px;
  color: #6c5393;
}

body.doc-page .doc-row-meta svg {
  width: 12px;
  height: 12px;
}

body.doc-page .doc-row-chevron {
  flex-shrink: 0;
  color: #6c5393;
  transition: color 0.15s ease, transform 0.15s ease;
}

body.doc-page .doc-row-chevron svg {
  width: 20px;
  height: 20px;
}

body.doc-page .doc-row:hover .doc-row-chevron {
  color: #f97316;
  transform: translateX(4px);
}

/* Stands in for a list that has nothing in it yet. Not in the design - the
   design fills those lists with invented entries we are not shipping. */
body.doc-page .doc-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px dashed #e6dbf0;
  border-radius: 12px;
  background: #faf5ff;
}

body.doc-page .doc-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-image: linear-gradient(to bottom right, #9333ea, #f97316);
}

body.doc-page .doc-empty-icon svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

body.doc-page .doc-empty p {
  margin: 0 !important;
  font-size: 14px;
  line-height: 22.75px;
  color: #6c5393;
}

/* Buttons. The design uses one gradient pill everywhere, with an outlined pill
   beside it for secondary actions. */
body.doc-page .doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

body.doc-page .doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px; /* px-6 */
  border: 1px solid transparent;
  border-radius: 9999px;
  background-image: linear-gradient(to right, #9333ea, #f97316);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

body.doc-page .doc-btn:hover {
  opacity: 0.9;
  color: #ffffff;
}

body.doc-page .doc-btn svg {
  width: 16px;
  height: 16px;
}

body.doc-page .doc-btn--lg {
  height: 44px;
  padding: 0 28px; /* px-7 */
}

body.doc-page .doc-btn--outline {
  background-image: none;
  background-color: transparent;
  border-color: #e9d5ff; /* purple-200 */
  color: #25153c;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.doc-page .doc-btn--outline:hover {
  opacity: 1;
  border-color: #c084fc; /* purple-400 */
  background-color: rgba(250, 245, 255, 0.5);
  color: #25153c;
}

@media (min-width: 640px) {
  body.doc-page .doc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Section heading with an icon tile beside a small caps eyebrow - the support
   channels and the guide stages both use it. */
body.doc-page .doc-block-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

body.doc-page .doc-block-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px; /* w-11 */
  height: 44px;
  border-radius: 12px;
  background-image: linear-gradient(to bottom right, #f3e8ff, #ffedd5);
}

body.doc-page .doc-block-icon svg {
  width: 20px;
  height: 20px;
  color: #7e22ce; /* purple-700 */
}

/* Beats body.doc-page .doc-section p, which is one element more specific than
   a bare .doc-eyebrow and would otherwise reset the size back to 16px. */
body.doc-page .doc-section .doc-eyebrow {
  margin: 0 !important;
  font-size: 11px;
  line-height: 16.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #9333ea;
}

body.doc-page .doc-section .doc-block-head h2 {
  margin: 4px 0 0; /* mt-1 */
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #25153c;
}

