/* ==========================================================================
   MyLabs Ireland — core stylesheet
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --green-50:  #eefaf3;
  --green-100: #d3f2e0;
  --green-300: #7ddcac;
  --green-500: #16a34a;
  --green-600: #12833c;
  --green-700: #0d6630;

  --ink-900: #0a1710;
  --ink-800: #10241a;
  --ink-700: #1c3a2a;
  --ink-500: #4b6155;
  --ink-400: #6b8478;

  --bg:        #ffffff;
  --bg-soft:   #f5f9f6;
  --bg-card:   #ffffff;
  --border:    #e0e9e3;
  --text:      #10241a;
  --text-soft: #4b6155;
  --accent:    var(--green-600);
  --accent-soft: var(--green-50);
  --shadow-sm: 0 1px 2px rgba(10, 23, 16, .06), 0 2px 8px rgba(10, 23, 16, .04);
  --shadow-md: 0 8px 24px rgba(10, 23, 16, .08);
  --shadow-lg: 0 24px 60px rgba(10, 23, 16, .12);

  --radius:    14px;
  --radius-lg: 22px;
  --maxw:      1120px;
  --header-h:  68px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg:        #08120d;
  --bg-soft:   #0d1a13;
  --bg-card:   #101f17;
  --border:    #1d3527;
  --text:      #e7f2ea;
  --text-soft: #9db3a6;
  --accent:    #4ade80;
  --accent-soft: #10281a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p  { margin: 0 0 1em; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--soft { background: var(--bg-soft); }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.lede { font-size: 1.12rem; color: var(--text-soft); max-width: 62ch; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, var(--green-500), var(--green-700));
  display: grid; place-items: center; color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand__text { font-size: 1.08rem; }
.brand__text span { color: var(--accent); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-soft); font-size: .95rem; font-weight: 550;
  padding: 8px 12px; border-radius: 9px;
}
.nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.icon-btn:hover { background: var(--bg-soft); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 12px;
  font-weight: 650; font-size: .98rem; border: 1px solid transparent;
  cursor: pointer; transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--green-600); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { background: var(--green-700); }
[data-theme="dark"] .btn--primary { background: var(--green-500); color: #05130b; }
.btn--ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--sm { padding: 9px 16px; font-size: .9rem; border-radius: 10px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 11vw, 130px) 0 clamp(56px, 8vw, 96px); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 620px;
  background:
    radial-gradient(48% 55% at 22% 30%, rgba(22,163,74,.20), transparent 65%),
    radial-gradient(42% 50% at 82% 18%, rgba(13,102,48,.16), transparent 65%);
  filter: blur(6px); pointer-events: none;
}
.hero__grid {
  position: relative; display: grid; gap: clamp(36px, 6vw, 64px);
  grid-template-columns: 1.05fr .95fr; align-items: center;
}
.hero h1 span { color: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; }
.hero__meta div { min-width: 92px; }
.hero__meta b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.hero__meta small { color: var(--text-soft); font-size: .84rem; }

/* Phone mockup */
.phone {
  position: relative; width: min(300px, 78vw); margin-inline: auto;
  aspect-ratio: 300 / 610;
  border-radius: 42px; padding: 12px;
  background: linear-gradient(160deg, #1d3527, #08120d);
  box-shadow: var(--shadow-lg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.phone__screen {
  height: 100%; border-radius: 32px; overflow: hidden;
  background: linear-gradient(175deg, var(--green-600), var(--green-700) 60%, #06331a);
  color: #fff; padding: 34px 20px 20px; display: flex; flex-direction: column; gap: 14px;
}
.phone__notch {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 22px; border-radius: 999px; background: #08120d; z-index: 2;
}
.phone__title { font-size: 1.02rem; font-weight: 750; opacity: .96; }
.phone__q { background: rgba(255,255,255,.12); border-radius: 14px; padding: 14px; font-size: .88rem; line-height: 1.45; }
.phone__opt {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; padding: 11px 13px; font-size: .84rem;
  display: flex; align-items: center; gap: 10px; transition: background .25s ease, border-color .25s ease;
}
.phone__opt i {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.5); display: grid; place-items: center;
  font-style: normal; font-size: .7rem;
}
.phone__opt.is-correct { background: rgba(255,255,255,.26); border-color: #fff; }
.phone__opt.is-correct i { background: #fff; color: var(--green-700); border-color: #fff; }
.phone__bar { margin-top: auto; height: 6px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.phone__bar span { display: block; height: 100%; width: 0; background: #fff; border-radius: 999px; transition: width .6s ease; }
.phone__foot { font-size: .74rem; opacity: .8; text-align: center; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--green-300); }
.card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 16px;
}
.card__icon svg { width: 22px; height: 22px; }
.card p { color: var(--text-soft); margin: 0; font-size: .97rem; }

/* App feature row */
.app-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.badge-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.badge-list li { display: flex; gap: 11px; align-items: flex-start; color: var(--text-soft); }
.badge-list li::before {
  content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: .78rem; font-weight: 800; margin-top: 2px;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 56px 0 30px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 34px; }
.footer__grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-soft); }
.footer__grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer__grid a { color: var(--text-soft); font-size: .94rem; }
.footer__grid a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--text-soft); font-size: .86rem;
}

/* ==========================================================================
   Privacy policy page
   ========================================================================== */
.policy-hero { padding: clamp(48px, 7vw, 84px) 0 34px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.policy-hero .meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  font-size: .82rem; font-weight: 600; color: var(--text-soft);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 6px 13px; border-radius: 999px;
}

.policy-layout {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px); padding: 44px 0 90px; align-items: start;
}

/* Sidebar / TOC */
.toc { position: sticky; top: calc(var(--header-h) + 20px); }
.toc__search { position: relative; margin-bottom: 16px; }
.toc__search input {
  width: 100%; padding: 11px 13px 11px 38px; font: inherit; font-size: .92rem;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
}
.toc__search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-soft); pointer-events: none;
}
.toc h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .11em; color: var(--text-soft); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 58vh; overflow: auto; }
.toc a {
  display: block; padding: 7px 12px; border-radius: 9px;
  font-size: .9rem; color: var(--text-soft); border-left: 2px solid transparent;
}
.toc a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }

.progress-rail { height: 4px; background: var(--border); border-radius: 999px; margin-top: 16px; overflow: hidden; }
.progress-rail span { display: block; height: 100%; width: 0; background: var(--accent); }

/* Policy body */
.policy { max-width: 76ch; }
.policy h2 {
  font-size: 1.42rem; margin-top: 2.2em; padding-top: .3em;
  scroll-margin-top: calc(var(--header-h) + 22px);
}
.policy h2:first-of-type { margin-top: 0; }
.policy h3 { font-size: 1.06rem; margin-top: 1.7em; scroll-margin-top: calc(var(--header-h) + 22px); }
.policy p, .policy li { color: var(--text-soft); }
.policy strong { color: var(--text); font-weight: 650; }
.policy ul { padding-left: 1.15em; margin: 0 0 1.1em; }
.policy li { margin-bottom: .45em; }
.policy section { border-bottom: 1px dashed var(--border); padding-bottom: 1.6em; }
.policy section:last-child { border-bottom: 0; }
.policy .anchor {
  opacity: 0; margin-left: .35em; font-size: .75em; color: var(--text-soft);
  transition: opacity .15s ease;
}
.policy h2:hover .anchor, .policy h3:hover .anchor { opacity: 1; }

.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: var(--bg-soft); border-radius: 12px; padding: 18px 20px; margin: 0 0 1.4em;
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn { border-left-color: #d97706; }
.callout--warn .callout__title { color: #b45309; }
.callout__title { font-weight: 700; color: var(--text); margin-bottom: .35em; display: block; }

.no-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.no-list li { display: flex; gap: 10px; align-items: flex-start; }
.no-list li::before {
  content: "✕"; flex: none; width: 21px; height: 21px; border-radius: 50%;
  background: #fee2e2; color: #b91c1c; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; margin-top: 3px;
}
[data-theme="dark"] .no-list li::before { background: #3b1414; color: #fca5a5; }

.path-crumb {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-family: var(--mono); font-size: .86rem;
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 10px; color: var(--text);
}
.path-crumb em { font-style: normal; color: var(--accent); }

mark.hit { background: #fde68a; color: #422006; padding: 0 2px; border-radius: 3px; }
[data-theme="dark"] mark.hit { background: #7c5a10; color: #fff8e1; }

.search-empty {
  display: none; padding: 16px 18px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-soft);
}
.is-searching .policy section.is-hidden { display: none; }
.is-searching .toc li.is-hidden { display: none; }

.back-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: var(--shadow-md);
}
.back-to-top.is-shown { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero__grid, .app-row { grid-template-columns: 1fr; }
  .phone { order: -1; }
  .grid--3, .grid--2 { grid-template-columns: 1fr 1fr; }
  .policy-layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
  .toc ul { max-height: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .nav-toggle { display: grid; order: 3; }
  .nav {
    order: 4; width: 100%; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; box-shadow: var(--shadow-md);
    display: none;
  }
  .nav.is-open { display: flex; }
  .site-header .wrap { position: relative; }
  .nav .btn { width: 100%; margin-top: 6px; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .toc, .back-to-top, .hero__cta, .no-print { display: none !important; }
  body { font-size: 11.5pt; color: #000; background: #fff; }
  .policy-layout { display: block; padding: 0; }
  .policy { max-width: none; }
  .policy p, .policy li { color: #222; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
