/* ============================================================
   LEGAL PAGES — Terms of Service & Privacy Policy.
   Editorial, readable document layout with a sticky in-page
   table of contents. Matches the site palette (warm #f8f6f2
   background, #ff385d accent) and the app's heading/body fonts.
   Used by pages/terms.blade.php and pages/privacy.blade.php.
   ============================================================ */

.legal {
  background: #f8f6f2;
  --legal-ink: #1a1a1a;
  --legal-body: #44413a;
  --legal-muted: #6b6760;
  --legal-line: #ece8e1;
  --legal-accent: #ff385d;
  --legal-max: 1120px;
}

/* ---------- Hero / page header ---------- */
.legal__hero {
  position: relative;
  padding: 80px 24px 56px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 56, 93, 0.07) 0%, rgba(255, 56, 93, 0) 55%),
    #fbfaf7;
  border-bottom: 1px solid var(--legal-line);
  overflow: hidden;
}

.legal__hero-wrap {
  max-width: var(--legal-max);
  margin: 0 auto;
}

.legal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--legal-accent);
  margin-bottom: 16px;
}

.legal__eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--legal-accent);
}

.legal__title {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--legal-ink);
  margin-bottom: 16px;
}

.legal__updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--legal-muted);
}

.legal__updated::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fbf6f;
  box-shadow: 0 0 0 3px rgba(63, 191, 111, 0.18);
}

/* ---------- Two-column layout (TOC + document) ---------- */
.legal__layout {
  max-width: var(--legal-max);
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

/* ---------- Sticky table of contents ---------- */
.legal__toc {
  position: sticky;
  top: 96px;
  align-self: start;
}

.legal__toc-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--legal-muted);
  margin-bottom: 14px;
}

.legal__toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--legal-line);
}

.legal__toc li {
  margin: 0;
}

.legal__toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--legal-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal__toc a:hover,
.legal__toc a.is-active {
  color: var(--legal-ink);
  border-left-color: var(--legal-accent);
}

/* ---------- Document body ---------- */
.legal__body {
  max-width: 720px;
}

.legal__intro {
  font-size: 1.12rem;
  line-height: 1.78;
  color: #2f2c25;
  padding-bottom: 32px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--legal-line);
}

.legal__section {
  padding-top: 40px;
  scroll-margin-top: 96px;
}

.legal__section h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--legal-ink);
  margin-bottom: 16px;
}

.legal__num {
  flex: 0 0 auto;
  font-family: var(--font-body) !important;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--legal-accent);
  background: rgba(255, 56, 93, 0.08);
  padding: 4px 9px;
  border-radius: 8px;
  line-height: 1;
  transform: translateY(-2px);
}

.legal__section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--legal-ink);
  margin: 24px 0 10px;
}

.legal__section p {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--legal-body);
  margin-bottom: 14px;
}

.legal__section ul {
  margin: 4px 0 16px 0;
  padding: 0;
  list-style: none;
}

.legal__section li {
  position: relative;
  padding-left: 26px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--legal-body);
  margin-bottom: 10px;
}

.legal__section li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--legal-accent);
}

.legal__section a {
  color: var(--legal-accent);
  text-decoration: none;
  font-weight: 600;
}

.legal__section a:hover {
  text-decoration: underline;
}

/* ---------- Contact callout at the foot of the document ---------- */
.legal__contact {
  margin-top: 56px;
  padding: 32px 34px;
  background: #fff;
  border: 1px solid var(--legal-line);
  border-radius: 18px;
  box-shadow: 0 12px 30px -22px rgba(26, 26, 26, 0.35);
}

.legal__contact h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--legal-ink);
  margin-bottom: 8px;
}

.legal__contact p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--legal-body);
  margin-bottom: 4px;
}

/* Inline links inside body copy (e.g. the Privacy Policy reference). */
.legal__inline-link {
  color: var(--legal-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal__inline-link:hover {
  text-decoration: none;
}

.legal__contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--legal-accent);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.legal__contact-mail:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(255, 56, 93, 0.6);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .legal__layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 40px 24px 80px;
  }
  .legal__toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .legal__hero {
    padding: 56px 20px 36px;
  }
  .legal__layout {
    padding: 32px 20px 64px;
  }
  .legal__contact {
    padding: 26px 22px;
  }
}
