/* =========================================================
   UNITAXI VIP — Legal pages (privacy, terms, cookies)
   Self-contained: defines any variables not in style.css
   ========================================================= */

/* ---------- Fallback variables (already in style.css, but
   kept here so legal pages render even if loaded alone) ---------- */
:root {
  --line-soft: #eaf1f8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(0, 102, 204, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 102, 204, 0.15);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --transition: 0.18s ease;
  --amber: #a47720;
  --amber-soft: #f8edd1;
  --red: #b94d43;
  --red-soft: #f7e5e2;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* =========================================================
   HERO
   ========================================================= */
.legal-hero {
  padding: 60px 0 40px;
  background:
    radial-gradient(
      circle at 12% 20%,
      rgba(0, 179, 126, 0.1) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 88% 80%,
      rgba(0, 102, 204, 0.1) 0%,
      transparent 45%
    ),
    var(--cream);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.legal-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-deep);
  margin-bottom: 10px;
}

.legal-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--blue-deep);
  line-height: 1.05;
}

.legal-lead {
  margin: 0 0 24px;
  max-width: 680px;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.55;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.legal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.legal-meta-item svg {
  width: 14px;
  height: 14px;
  color: var(--blue);
  flex-shrink: 0;
}

/* =========================================================
   LAYOUT
   ========================================================= */
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 60px;
  padding: 50px 0 80px;
  align-items: start;
}

/* =========================================================
   TABLE OF CONTENTS
   ========================================================= */
.legal-toc {
  position: sticky;
  top: 100px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.legal-toc h3 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-left: 2px solid transparent;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.legal-toc a:hover {
  background: var(--blue-soft);
  color: var(--blue-deep);
  border-left-color: var(--blue);
}

/* =========================================================
   CONTENT
   ========================================================= */
.legal-content {
  min-width: 0;
  max-width: 760px;
}

.legal-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line-soft);
}

.legal-section:first-child {
  padding-top: 0;
}
.legal-section:last-of-type {
  border-bottom: 0;
}

/* ---------- Section heading ----------
   FIRST span = number circle
   SECOND span = title text (no styling)  */
.legal-section h2 {
  display: flex;
  align-items: flex-start; /* FIX: number aligns with first line */
  gap: 14px;
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--blue-deep);
  scroll-margin-top: 100px;
}

/* Number circle — first span only */
.legal-section h2 > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
  margin-top: 1px; /* FIX: align with text cap-height */
}

/* Title span — reset any accidental styling */
.legal-section h2 > span:last-child {
  display: inline;
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  flex: 1;
  min-width: 0;
}

/* ---------- Sub-headings ---------- */
.legal-section h3 {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--blue-deep);
}

.legal-section h4 {
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

/* ---------- Paragraphs ---------- */
.legal-section p {
  margin: 0 0 14px;
  font-size: 15px;
  color: #475569;
  line-height: 1.7;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section p a,
.legal-section li a {
  color: var(--blue);
  font-weight: 700;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--transition);
}

.legal-section p a:hover,
.legal-section li a:hover {
  border-bottom-color: var(--blue);
}

/* ---------- Numbered list (counter) ---------- */
.legal-list {
  margin: 0;
  padding-left: 0;
  counter-reset: legal-counter;
  list-style: none;
}

.legal-list > li {
  position: relative;
  padding: 12px 0 12px 44px;
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
  counter-increment: legal-counter;
}

.legal-list > li::before {
  content: counter(legal-counter);
  position: absolute;
  left: 0;
  top: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 900;
}

.legal-list > li > ul {
  margin: 8px 0 0;
  padding-left: 20px;
  list-style: none;
}

.legal-list > li > ul > li {
  position: relative;
  padding-left: 18px;
  margin: 6px 0;
  font-size: 14.5px;
  color: #475569;
  line-height: 1.65;
}

.legal-list > li > ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* ---------- Simple bullet list ---------- */
.legal-list-simple {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}

.legal-list-simple li {
  position: relative;
  padding: 8px 0 8px 24px;
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
}

.legal-list-simple li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 179, 126, 0.15);
}

/* ---------- Intro / note ---------- */
.legal-intro {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--muted);
}

.legal-note {
  margin: 12px 0;
  padding: 14px 16px;
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--blue-deep);
  line-height: 1.6;
}

/* ---------- Callout (mobile apps table) ---------- */
.legal-callout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  padding: 8px 20px;
  margin: 20px 0;
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}

.legal-callout > div {
  color: #475569;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  min-height: 44px;
}

.legal-callout > div:nth-child(odd) {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-right: 12px;
}

.legal-callout > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

/* ---------- Link chip grid ---------- */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.legal-links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-deep);
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.legal-links a:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

/* ---------- Contact cards ---------- */
.legal-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}

.legal-contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform 0.1s ease;
}

.legal-contact-item:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 22px rgba(0, 102, 204, 0.1);
}

.legal-contact-item:active {
  transform: scale(0.98);
}

.legal-contact-static {
  cursor: default;
}

.legal-contact-static:hover {
  border-color: var(--line);
  box-shadow: none;
}

.legal-contact-item svg {
  width: 22px;
  height: 22px;
  color: var(--blue);
  flex-shrink: 0;
  padding: 10px;
  background: var(--blue-soft);
  border-radius: 50%;
  box-sizing: content-box;
}

.legal-contact-item > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.legal-contact-item small {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-contact-item strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--blue-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Back button row ---------- */
.legal-back {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
}

/* =========================================================
   TABLE (cookie list)
   ========================================================= */
.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 14px;
}

.legal-table thead {
  background: #fafcff;
}

.legal-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.legal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: #475569;
  vertical-align: top;
  line-height: 1.55;
}

.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

.legal-table td strong {
  color: var(--blue-deep);
  font-weight: 800;
}

.legal-table code {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   RESPONSIVE — TABLET (≤900px)
   ========================================================= */
@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 30px 0 60px;
  }

  .legal-toc {
    position: static;
    padding: 16px;
  }

  .legal-toc nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 4px;
  }

  .legal-toc a {
    padding: 7px 10px;
    font-size: 12.5px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .legal-toc a:hover {
    border-left-color: transparent;
    border-bottom-color: var(--blue);
  }
}

/* =========================================================
   RESPONSIVE — MOBILE (≤560px)
   ========================================================= */
@media (max-width: 560px) {
  .legal-hero {
    padding: 40px 0 28px;
  }

  .legal-hero h1 {
    font-size: 30px;
  }

  .legal-lead {
    font-size: 15px;
  }

  .legal-meta {
    flex-direction: column;
    gap: 8px;
  }

  .legal-layout {
    padding: 20px 0 50px;
  }

  .legal-section {
    padding: 24px 0;
  }

  /* FIX: tighter number circle, aligned with first line */
  .legal-section h2 {
    font-size: 18px;
    gap: 10px;
    margin-bottom: 16px;
  }

  .legal-section h2 > span:first-child {
    width: 26px;
    height: 26px;
    font-size: 12px;
    margin-top: 2px;
  }

  .legal-section p {
    font-size: 14.5px;
  }

  .legal-list > li {
    padding: 10px 0 10px 36px;
    font-size: 14.5px;
  }

  .legal-list > li::before {
    width: 24px;
    height: 24px;
    font-size: 11px;
    top: 10px;
  }

  .legal-list-simple li {
    font-size: 14.5px;
  }

  /* Callout becomes single column */
  .legal-callout {
    grid-template-columns: 1fr;
    padding: 12px 16px;
    gap: 0;
  }

  .legal-callout > div {
    padding: 6px 0;
    min-height: 0;
    border-bottom: 0;
  }

  .legal-callout > div:nth-child(odd) {
    padding-top: 12px;
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .legal-callout > div:nth-child(even) {
    padding-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
  }

  .legal-callout > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .legal-contact {
    grid-template-columns: 1fr;
  }

  .legal-table {
    font-size: 13px;
  }

  .legal-table th,
  .legal-table td {
    padding: 10px 12px;
  }

  .legal-table code {
    font-size: 11px;
    padding: 2px 6px;
  }
}

/* =========================================================
   EXTRA NARROW (< 380px)
   ========================================================= */
@media (max-width: 380px) {
  .legal-hero h1 {
    font-size: 26px;
  }

  .legal-section h2 {
    font-size: 17px;
  }

  .legal-section h2 > span:first-child {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .legal-toc nav {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PRINT (nice touch for legal pages)
   ========================================================= */
@media print {
  .topbar,
  .nav,
  footer,
  .legal-toc,
  .legal-back,
  .cookie-banner,
  .cookie-overlay {
    display: none !important;
  }

  .legal-hero {
    background: none;
    padding: 0 0 20px;
    border-bottom: 2px solid #000;
  }

  .legal-layout {
    display: block;
    padding: 20px 0;
  }

  .legal-content {
    max-width: 100%;
  }

  .legal-section {
    padding: 16px 0;
    page-break-inside: avoid;
  }

  .legal-section h2 > span:first-child {
    background: #333 !important;
    box-shadow: none !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
}
