@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Cotrawell — Shared stylesheet for legal/policy pages
   (Terms & Conditions, Privacy Policy, Cookie Policy, Disclaimer, Refund Policy)
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

:root {
  --bg: #faf8f2;
  --surface: #181c27;
  --border: #252a38;
  --accent: #4f8ef7;
  --accent-dim: rgba(79, 142, 247, 0.12);
  --green: #4fd17a;
  --green-dim: rgba(79, 209, 122, 0.1);
  --red: #f74f4f;
  --red-dim: rgba(247, 79, 79, 0.1);
  --yellow: #f7c94f;
  --yellow-dim: rgba(247, 201, 79, 0.1);
  --warn: #f7a94f;
  --warn-dim: rgba(247, 169, 79, 0.1);

  /* Text colors — sourced from the app's --foreground / --muted-foreground */
  --text-primary: oklch(0.141 0.005 285.823);
  --text-secondary: oklch(0.552 0.016 285.938);
  --text-muted: #555c72;

  /* Heading color — sourced from the app's --primary */
  --heading-color: oklch(27.161% 0.05147 264.454);

  --font-sans: "Poppins", system-ui, -apple-system, sans-serif;
  --radius: 10px;

  /* Height of the sticky topbar + breathing room, used for scroll offsets */
  --topbar-offset: 88px;
}

body {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;

  background-color: var(--bg);
  background-image:
    /* Main sky-blue glow */
    radial-gradient(
      ellipse 70% 65% at 28% 42%,
      rgba(125, 211, 252, 0.62) 0%,
      rgba(147, 224, 250, 0.44) 30%,
      rgba(186, 230, 253, 0.24) 55%,
      transparent 75%
    ),
    /* Right-side sky-blue glow */
    radial-gradient(
        ellipse 60% 70% at 76% 55%,
        rgba(96, 190, 239, 0.48) 0%,
        rgba(147, 211, 244, 0.32) 35%,
        rgba(186, 230, 253, 0.16) 58%,
        transparent 78%
      ),
    /* Soft center highlight */
    radial-gradient(
        ellipse 35% 40% at 27% 40%,
        rgba(224, 242, 254, 0.72) 0%,
        rgba(186, 230, 253, 0.24) 40%,
        transparent 72%
      ),
    /* Secondary blue bubble */
    radial-gradient(
        ellipse 40% 45% at 74% 57%,
        rgba(125, 211, 252, 0.52) 0%,
        rgba(147, 211, 244, 0.32) 38%,
        transparent 72%
      ),
    /* Overall atmospheric wash */
    linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(186, 230, 253, 0.12) 40%,
        transparent 60%,
        rgba(125, 211, 252, 0.18) 100%
      );
  background-attachment: fixed;
  background-size: cover;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(238, 238, 238, 0.9);
  padding: 0 max(2rem, calc((100% - 1100px) / 2 + 2rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 56px;
}
.topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--heading-color);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.topbar-logo:hover {
  text-decoration: none;
  border: 0;
  outline: 0;
}
.topbar-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.topbar-logo span {
  color: var(--accent);
}
.topbar-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid rgba(15, 17, 23, 0.15);
  border-radius: 4px;
  padding: 2px 8px;
}
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  color: var(--heading-color);
}
.language-switcher select {
  width: auto;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
}
.language-switcher-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}
.language-switcher select:focus-visible {
  outline-offset: 2px;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  gap: 4rem;
}

/* Sidebar TOC */
.toc {
  position: sticky;
  top: 80px;
  height: fit-content;
}
.toc-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.toc a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--border);
  transition:
    color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    padding-left 0.15s;
  line-height: 1.4;
}
.toc a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 16px;
}
.toc a:active {
  color: var(--accent);
  border-left-color: var(--accent);
  transform: scale(0.98);
}

/* Content */
.content {
  min-width: 0;
}

.page-header {
  margin-bottom: 3rem;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
}
.page-header .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.page-header .meta span {
  color: var(--accent);
  font-weight: 600;
}

.notice {
  background: var(--accent-dim);
  border: 1px solid rgba(79, 142, 247, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  line-height: 1.6;
}

/* Disclaimer-only warning notice */
.warn-box {
  background: var(--warn-dim);
  border: 1px solid rgba(247, 169, 79, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.84rem;
  color: #c9a46a;
  margin-bottom: 3rem;
  line-height: 1.6;
}

section {
  margin-bottom: 3rem;
  /* Keeps the section's heading clear of the sticky topbar when a TOC
     link (or any #anchor) jumps to it, instead of landing right under it. */
  scroll-margin-top: var(--topbar-offset);
  border-radius: var(--radius);
}

/* Briefly highlights the section that was just scrolled to, so the jump
   from a TOC click (or a direct #anchor link) is easy to spot. */
section:target {
  animation: section-highlight 1.6s ease-out;
}

@keyframes section-highlight {
  0% {
    background-color: var(--accent-dim);
    box-shadow: 0 0 0 1px rgba(79, 142, 247, 0.25);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 1.25rem 0 0.5rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}
p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}
li {
  margin-bottom: 0.4rem;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Terms & Conditions — highlight box */
.highlight-box {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* Privacy Policy — pill list (rights list) */
.pill-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.pill-list li {
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* Cookie Policy — cookie cards & badges */
.cookie-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.cookie-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.cookie-card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--heading-color);
}
.badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.badge-required {
  background: rgba(79, 142, 247, 0.15);
  color: var(--accent);
  border: 1px solid rgba(79, 142, 247, 0.3);
}
.badge-optional {
  background: rgba(139, 146, 168, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.cookie-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Refund Policy — tier cards & step list */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.tier-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid;
}
.tier-card.green {
  background: var(--green-dim);
  border-color: rgba(79, 209, 122, 0.25);
}
.tier-card.yellow {
  background: var(--yellow-dim);
  border-color: rgba(247, 201, 79, 0.25);
}
.tier-card.red {
  background: var(--red-dim);
  border-color: rgba(247, 79, 79, 0.25);
}
.tier-card .tier-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.tier-card.green .tier-label {
  color: var(--green);
}
.tier-card.yellow .tier-label {
  color: var(--yellow);
}
.tier-card.red .tier-label {
  color: var(--red);
}
.tier-card .tier-amount {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.tier-card .tier-window {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.step-list {
  counter-reset: steps;
  list-style: none;
  padding: 0;
}
.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}
.step-list li::before {
  content: counter(steps);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(79, 142, 247, 0.3);
  border-radius: 50%;
  min-width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.step-list li p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Data tables (Privacy, Cookie, Refund policies) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.84rem;
}
.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}
.data-table tr:last-child td {
  border-bottom: none;
}

.contact-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}
.contact-block strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .toc {
    display: none;
  }
  .page-header h1 {
    font-size: 1.5rem;
  }
  .tier-grid {
    grid-template-columns: 1fr;
  }
}
