/*
 * linqEV — shared styling for the long-form legal pages:
 * /privacy-policy, /terms-of-service, /cookie-policy, /paia-manual
 *
 * These pages are not built from the standard Tailwind page template. They
 * carry their own typographic scale, table of contents, and ECTA supplier
 * block. Keep them visually consistent by editing this file, not the pages.
 */

:root {
  --max-w: 820px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 1.02rem;
  line-height: 1.72;
  color: #cbd5e1;
  background: #020617;
  -webkit-font-smoothing: antialiased;
}

/* Anchored headings must clear the sticky nothing — but give the browser a
   little breathing room so a jumped-to section is not flush to the viewport. */
:target { scroll-margin-top: 1.5rem; }

/* ---------- Aurora background — matches main site ---------- */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(74,222,128,0.10) 0%, transparent 60%),
    #020617;
  animation: aurora-shift 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora-bg { animation: none; }
  html { scroll-behavior: auto; }
}

.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.text-gradient {
  background: linear-gradient(to right, #4ade80, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Header ---------- */
.policy-header {
  position: relative;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  text-align: center;
  overflow: hidden;
}
.policy-header .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #86efac;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 0.35em 1em;
  border-radius: 100px;
  margin-bottom: var(--space-sm);
}
.policy-header .badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}
.policy-header h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.policy-header .subtitle {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 620px;
  margin: 0 auto;
}
.policy-header .logo-link {
  display: inline-block;
  margin-bottom: var(--space-md);
}
.policy-header .logo-link img {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 0 24px rgba(74,222,128,0.25));
}

/* ---------- Content ---------- */
.policy-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.effective-date {
  display: inline-block;
  font-size: 0.85rem;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  padding: 0.45em 0.95em;
  margin-bottom: var(--space-lg);
}
.cookie-prefs {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: #020617;
  background: linear-gradient(to right, #4ade80, #3b82f6);
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0.6em 1.4em;
  transition: opacity 0.2s ease;
}
.cookie-prefs:hover { opacity: 0.9; }
.cookie-prefs:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }

.policy-container h2 {
  font-size: 1.55rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  padding-bottom: 0.4em;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}
.policy-container h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #4ade80, #3b82f6);
  border-radius: 2px;
}

.policy-container h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: var(--space-md);
  margin-bottom: 0.5rem;
  letter-spacing: -0.005em;
}

.policy-container h4 {
  font-size: 0.98rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: var(--space-sm);
  margin-bottom: 0.35rem;
}

.policy-container p {
  margin-bottom: var(--space-sm);
  color: #cbd5e1;
}

.policy-container strong {
  color: #f1f5f9;
  font-weight: 600;
}

.policy-container ul {
  margin: 0.5rem 0 var(--space-sm) 1.4rem;
  padding: 0;
}
.policy-container ul li {
  margin-bottom: 0.5rem;
  padding-left: 0.35rem;
  color: #cbd5e1;
}
.policy-container ul li::marker {
  color: #4ade80;
}

/* Numbered clauses — used where the source document numbers its sub-clauses
   and those numbers are referred to elsewhere in the text. */
.policy-container ol.clauses {
  margin: 0.5rem 0 var(--space-sm) 1.6rem;
  padding: 0;
}
.policy-container ol.clauses li {
  margin-bottom: 0.65rem;
  padding-left: 0.35rem;
  color: #cbd5e1;
}
.policy-container ol.clauses li::marker {
  color: #4ade80;
  font-weight: 600;
}

.callout {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  border-radius: 0 10px 10px 0;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0;
  font-size: 0.97rem;
  color: #e2e8f0;
}
.callout strong { color: #93c5fd; }
.callout p:last-child { margin-bottom: 0; }

.callout-green {
  background: rgba(74, 222, 128, 0.07);
  border-left: 3px solid #4ade80;
  border-radius: 0 10px 10px 0;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0;
  font-size: 0.97rem;
  color: #e2e8f0;
}
.callout-green strong { color: #86efac; }
.callout-green p:last-child { margin-bottom: 0; }

/* Consumer Protection Act s49 attention-drawing notices. These must stand out
   on the page — the statute requires them to be conspicuous. */
.callout-attention {
  background: rgba(251, 191, 36, 0.07);
  border-left: 3px solid #fbbf24;
  border-radius: 0 10px 10px 0;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0;
  font-size: 0.97rem;
  color: #e2e8f0;
}
.callout-attention strong { color: #fcd34d; }
.callout-attention p:last-child { margin-bottom: 0; }

/* Blocks of capitalised statutory text read badly at full size. */
.legal-caps {
  font-size: 0.93rem;
  letter-spacing: 0.01em;
  color: #e2e8f0;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: var(--space-sm) 0 var(--space-md);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  -webkit-overflow-scrolling: touch;
}
.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 34rem;
}
.policy-table th,
.policy-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.policy-table thead th {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.policy-table tbody tr:last-child td { border-bottom: none; }
.policy-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.policy-table td:first-child { color: #e2e8f0; font-weight: 500; }

/* ---------- Contact / details cards ---------- */
.contact-card {
  border-radius: 16px;
  padding: var(--space-md);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}
.contact-card .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.contact-card a {
  color: #4ade80;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.contact-card a:hover {
  color: #86efac;
  text-decoration: underline;
}
.contact-card p {
  color: #e2e8f0;
  margin: 0;
  font-weight: 500;
}

/* ---------- ECTA section 43 supplier block ----------
   A statutory disclosure. It must render on every legal page — it is not
   boilerplate that can be trimmed for layout reasons. */
.ecta-block {
  border-radius: 16px;
  padding: var(--space-md);
  margin-top: var(--space-lg);
}
.ecta-block h3 {
  margin-top: 0;
  font-size: 0.98rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.ecta-block dl {
  margin: var(--space-sm) 0 0;
  display: grid;
  grid-template-columns: minmax(11rem, auto) 1fr;
  gap: 0.55rem var(--space-sm);
  font-size: 0.94rem;
}
.ecta-block dt {
  color: #64748b;
  font-weight: 500;
}
.ecta-block dd {
  color: #e2e8f0;
  margin: 0;
}
.ecta-block dd a { color: #4ade80; }

@media (max-width: 560px) {
  .ecta-block dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .ecta-block dt { margin-top: 0.6rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
}

/* ---------- Footer ---------- */
.policy-footer {
  text-align: center;
  padding: var(--space-md) var(--space-sm) var(--space-lg);
  font-size: 0.82rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  max-width: var(--max-w);
  margin: 0 auto;
}
.policy-footer a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}
.policy-footer a:hover {
  color: #4ade80;
}
.policy-footer .links {
  margin-top: 0.6rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}
/* The cookie-preferences control is a button, not a link — it reopens the
   consent banner. Style it to sit inline with the footer links. */
.policy-footer .links button {
  font: inherit;
  color: #94a3b8;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.policy-footer .links button:hover { color: #4ade80; }
.policy-footer .links button:focus-visible { outline: 2px solid #4ade80; outline-offset: 3px; border-radius: 3px; }

/* ---------- Table of Contents ---------- */
.toc {
  border-radius: 14px;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}
.toc-title {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.9rem;
  color: #94a3b8;
}
.toc ol {
  margin: 0;
  padding-left: 1.4rem;
  counter-reset: toc-counter;
  list-style: none;
}
.toc ol li {
  margin-bottom: 0.5rem;
  counter-increment: toc-counter;
  position: relative;
}
.toc ol li::before {
  content: counter(toc-counter, decimal-leading-zero);
  position: absolute;
  left: -1.6rem;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 500;
  top: 0.18rem;
}
/* Un-numbered trailing entries, e.g. "Annexure A". */
.toc ol li.toc-extra {
  counter-increment: none;
  margin-top: 0.85rem;
}
.toc ol li.toc-extra::before { content: '—'; }
.toc a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.18s ease;
}
.toc a:hover {
  color: #4ade80;
}

a {
  color: #4ade80;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .policy-container { padding: var(--space-md) var(--space-sm) var(--space-lg); }
  .policy-header { padding: var(--space-lg) var(--space-sm) var(--space-md); }
  .contact-card { gap: var(--space-sm); }
}
