/* TVCANADA design tokens + core components.
   Source of truth for the theme (Phase 2 moves these into theme.json / the theme CSS). */

/* ---------- Font: Plus Jakarta Sans (OFL), self-hosted ---------- */
@font-face { font-family: "Jakarta"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/plus-jakarta-sans-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jakarta"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/plus-jakarta-sans-latin-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jakarta"; font-style: normal; font-weight: 800; font-display: swap;
  src: url(../fonts/plus-jakarta-sans-latin-800.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Brand */
  --brand-1: #9B54F3;  /* gradient top (decoration, large text only) */
  --brand-2: #6946CD;  /* gradient middle, links */
  --brand-3: #3438A6;  /* gradient bottom */
  --grad: linear-gradient(180deg, var(--brand-1), var(--brand-2) 50%, var(--brand-3));
  /* Buttons start a little darker than the logo gradient so white text passes WCAG AA */
  --grad-btn: linear-gradient(135deg, #7E4AE8, #3438A6);
  --grad-btn-hover: linear-gradient(135deg, #6A3BD3, #2A2E8C);

  /* Neutrals */
  --ink: #202020;
  --ink-2: #4A4658;      /* secondary text */
  --line: #E6E1F5;
  --tint: #F6F3FF;       /* lavender section background */
  --white: #FFFFFF;
  --dark: #14121F;       /* hero / footer */
  --on-dark: #F4F2FA;
  --on-dark-2: #BDB7D1;

  /* Status */
  --ok: #1F7A4D;   --ok-bg: #E8F6EE;
  --warn: #8A5A00; --warn-bg: #FFF4DC;
  --err: #B3261E;  --err-bg: #FDECEA;
  --wa: #25D366;   --wa-ink: #0A2A17;   /* WhatsApp button: green with dark text (AA) */

  /* Type scale (mobile → desktop, fluid) */
  --font: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-h4: 1.25rem;
  --fs-h3: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-h1: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
  --lh-tight: 1.15;
  --lh: 1.6;

  /* Spacing (4 px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Shape */
  --r-sm: 8px; --r: 14px; --r-lg: 22px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(20,18,31,.06), 0 8px 24px rgba(52,56,166,.08);
  --shadow-lg: 0 2px 4px rgba(20,18,31,.06), 0 16px 40px rgba(52,56,166,.16);
  --wrap: 1180px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh); color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 800; line-height: var(--lh-tight); margin: 0 0 var(--s-4); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); } h2 { font-size: var(--fs-h2); } h3 { font-size: var(--fs-h3); } h4 { font-size: var(--fs-h4); }
p { margin: 0 0 var(--s-4); }
a { color: var(--brand-2); text-underline-offset: 3px; }
a:hover { color: var(--brand-3); }
:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-5); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: 12px 24px; border-radius: var(--r-pill); font: 600 var(--fs-base)/1.2 var(--font); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 18px rgba(105,70,205,.30); }
.btn-primary:hover { background: var(--grad-btn-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--brand-2); border-color: var(--brand-2); }
.btn-secondary:hover { background: var(--tint); color: var(--brand-3); border-color: var(--brand-3); }
.btn-wa { background: var(--wa); color: var(--wa-ink); }
.btn-wa:hover { background: #1FBE5B; color: var(--wa-ink); }
.btn-lg { min-height: 56px; padding: 16px 32px; font-size: var(--fs-lg); }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; background: var(--tint); color: var(--brand-3); }
.badge-solid { background: var(--grad-btn); color: #fff; }
.badge-dark { background: rgba(255,255,255,.1); color: var(--on-dark); }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow); }
.card .icon { width: 48px; height: 48px; border-radius: var(--r); background: var(--tint); display: grid; place-items: center; margin-bottom: var(--s-4); }
.card .icon svg { width: 26px; height: 26px; stroke: var(--brand-2); }
.card h3 { font-size: var(--fs-h4); margin-bottom: var(--s-2); }
.card p { color: var(--ink-2); margin: 0; }

/* ---------- Pricing card ---------- */
.price-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6) var(--s-5); box-shadow: var(--shadow); }
.price-card.featured { border: 2px solid var(--brand-2); box-shadow: var(--shadow-lg); }
.price-card .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.price-card .plan { font-weight: 800; font-size: var(--fs-h4); margin: 0 0 var(--s-2); }
.price-card .per-month { font-size: clamp(1.75rem, 1.2rem + 1.2vw, 2.25rem); white-space: nowrap; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.price-card .per-month small { font-size: var(--fs-base); font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.price-card .total { color: var(--ink-2); font-size: var(--fs-sm); margin: var(--s-2) 0 0; }
.price-card .save { display: inline-block; align-self: flex-start; margin-top: var(--s-3); font-weight: 600; font-size: var(--fs-sm); color: var(--ok); background: var(--ok-bg); border-radius: var(--r-pill); padding: 4px 10px; }
.price-card ul { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: var(--s-3); }
.price-card li { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-base); }
.price-card li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%236946CD' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat; }
.price-card .btn { margin-top: auto; }
.price-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.price-grid .featured { margin-top: -12px; margin-bottom: -12px; padding-top: calc(var(--s-6) + 12px); }
@media (max-width: 960px) { .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .price-grid .featured { margin: 0; padding-top: var(--s-6); } }
@media (max-width: 600px) {
  .price-grid { grid-template-columns: 1fr; padding-top: var(--s-3); }
  .price-grid .featured { order: -1; }   /* 12 Months first on mobile */
}
.reassure { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3) var(--s-5); margin-top: var(--s-6); padding: 0; list-style: none; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.reassure li { display: flex; align-items: center; gap: 6px; }
.reassure svg { width: 18px; height: 18px; stroke: var(--ok); }

/* ---------- FAQ (no JS) ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-5) 0; font-weight: 600; font-size: var(--fs-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M9 12l5 5 5-5' fill='none' stroke='%236946CD' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/28px no-repeat; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq .answer { padding: 0 0 var(--s-5); color: var(--ink-2); max-width: 70ch; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.field .hint { font-size: var(--fs-sm); color: var(--ink-2); }
.input, .select { width: 100%; min-height: 48px; padding: 12px 14px; font: 400 var(--fs-base) var(--font); color: var(--ink); background: #fff; border: 1.5px solid #CFC8E6; border-radius: var(--r-sm); }
.input:focus, .select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(105,70,205,.18); }
.field.has-error .input { border-color: var(--err); }
.field .error { color: var(--err); font-size: var(--fs-sm); font-weight: 600; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--fs-sm); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand-2); }

/* ---------- Notices ---------- */
.notice { display: flex; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r); border: 1px solid; font-size: var(--fs-base); }
.notice-info { background: var(--tint); border-color: var(--line); color: var(--brand-3); }
.notice-ok { background: var(--ok-bg); border-color: #BFE6CF; color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-color: #F1D9A0; color: var(--warn); }
.notice-err { background: var(--err-bg); border-color: #F4C2BE; color: var(--err); }

/* ---------- Language switcher ---------- */
.lang { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--tint); font-weight: 600; font-size: var(--fs-sm); }
.lang a { padding: 6px 12px; border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); }
.lang a[aria-current="true"] { background: #fff; color: var(--brand-3); box-shadow: 0 1px 3px rgba(20,18,31,.12); }
.lang-dark { background: rgba(255,255,255,.1); }
.lang-dark a { color: var(--on-dark-2); }
.lang-dark a[aria-current="true"] { background: #fff; color: var(--brand-3); }

/* ---------- Sticky mobile CTA bar ---------- */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: none; gap: var(--s-2); padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(20,18,31,.08); }
.sticky-cta .btn { flex: 1; min-height: 48px; padding: 10px 12px; }
@media (max-width: 720px) { .sticky-cta { display: flex; } }
.sticky-cta.is-hidden { display: none; }
