/* ==========================================================================
   VMprepare homepage (index.php), hm- classes
   Loaded after css/style.css. Broadcom palette: white and light grey,
   black text and cards, Broadcom red for actions and accents.
   ========================================================================== */
.hm { background: var(--surface); }
.hm-i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hm h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.035em; }

/* Small red label above headings */
.hm-kicker { display: inline-block; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--accent); font-size: 13px; font-weight: 700; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* ---------- Hero ---------- */
.hm-hero {
  position: relative; overflow: hidden;
  padding: 64px 0 72px;
  background: var(--bg);
}
/* Red angled panel behind the tracks card */
.hm-hero::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 38%;
  background: var(--accent);
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}
.hm-hero::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 38%;
  background: linear-gradient(135deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 100%) 0 0 / 28px 28px;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .6;
}
.hm-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 56px; align-items: center; }
.hm-hero h1 { max-width: 700px; font-size: clamp(38px, 5vw, 62px); font-weight: 800; line-height: 1.02; letter-spacing: -.045em; color: var(--ink); }
.hm-lead { max-width: 560px; margin-top: 20px; font-size: 18px; line-height: 1.6; color: var(--text); }

.hm-search { display: flex; max-width: 580px; margin-top: 30px; background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r-sm); }
.hm-search:focus-within { box-shadow: 0 0 0 3px rgba(204, 9, 47, .25); border-color: var(--accent); }
.hm-search label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; padding-left: 16px; color: var(--muted); }
.hm-search input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.hm-search input::placeholder { color: #8a8a8a; }
.hm-search button { flex: none; margin: -1px -1px -1px 0; padding: 0 28px; border: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: background-color .15s; }
.hm-search button:hover { background: var(--accent-ink); }

.hm-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.hm-popular span { margin-right: 4px; font-weight: 600; white-space: nowrap; }
.hm-popular a { padding: 5px 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--ink); }
.hm-popular a:hover { border-color: var(--accent); color: var(--accent); }

.hm-ticks { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 28px; }
.hm-ticks li { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--ink); }
.hm-ticks .hm-i { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--ink); color: #fff; stroke-width: 3; }
.hm-ticks--stack { flex-direction: column; }

/* Certification tracks card */
.hm-tracks { background: var(--night); color: var(--on-night-muted); border-radius: var(--r-lg); box-shadow: 0 30px 60px rgba(0, 0, 0, .28); overflow: hidden; }
.hm-tracks-head { padding: 24px 26px 18px; border-bottom: 1px solid var(--night-line); }
.hm-tracks-head span { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.hm .hm-tracks-head h2 { margin-top: 6px; font-size: 22px; letter-spacing: -.02em; color: #fff; }
.hm-tracks ul { padding: 6px 0; }
.hm-tracks a { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 26px; color: var(--on-night-muted); transition: background-color .15s; }
.hm-tracks a:hover { background: var(--night-2); color: #fff; }
.hm-tracks-badge { display: grid; place-items: center; height: 30px; border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--r-sm); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #fff; }
.hm-tracks a:hover .hm-tracks-badge { background: var(--accent); border-color: var(--accent); }
.hm-tracks-name { min-width: 0; }
.hm-tracks-name b { display: block; font-size: 15px; color: #fff; }
.hm-tracks-name small { display: block; overflow: hidden; font-size: 13px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.hm-tracks-n { font-size: 13px; white-space: nowrap; }
.hm-tracks .hm-i { width: 18px; height: 18px; color: var(--sky); transition: transform .15s; }
.hm-tracks a:hover .hm-i { transform: translateX(3px); }
.hm-tracks-foot { display: flex; gap: 24px; padding: 16px 26px; background: #000; font-size: 14px; }
.hm-tracks-foot b { font-size: 18px; font-weight: 800; color: #fff; }

/* Products strip */
.hm-products { background: var(--surface); border-bottom: 1px solid var(--line); }
.hm-products .container { display: flex; align-items: center; gap: 28px; min-height: 64px; overflow-x: auto; scrollbar-width: none; }
.hm-products .container::-webkit-scrollbar { display: none; }
.hm-products span { flex: none; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hm-products ul { display: flex; gap: 32px; }
.hm-products li { flex: none; font-size: 16px; font-weight: 700; letter-spacing: -.02em; color: #4a4a4a; white-space: nowrap; }

/* ---------- Sections ---------- */
.hm-section { padding: 88px 0; }
.hm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.hm-head p { max-width: 560px; margin-top: 12px; font-size: 17px; color: var(--muted); }
.hm-head--center { justify-content: center; text-align: center; }
.hm-head--center .hm-kicker { padding: 0; border: 0; }

/* Exam catalog */
.hm-filter { display: flex; align-items: center; gap: 10px; width: min(380px, 100%); height: 50px; margin: 0; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.hm-filter:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.hm-filter input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.hm-count { font-size: 13px; white-space: nowrap; }

.hm-levels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.hm-levels button { padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.hm-levels button span { margin-left: 4px; font-weight: 500; color: var(--muted); }
.hm-levels button:hover { border-color: var(--ink); }
.hm-levels button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.hm-levels button[aria-pressed="true"] span { color: #bdbdbd; }

.hm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hm-card { position: relative; display: flex; flex-direction: column; padding: 22px 22px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, box-shadow .15s; }
.hm-card::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 3px; border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.hm-card:hover { border-color: var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
.hm-card:hover::after { transform: scaleX(1); }
.hm-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hm-card-code { font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--accent); overflow-wrap: anywhere; }
.hm-card-level { flex: none; padding: 2px 8px; background: var(--bg); border-radius: var(--r-sm); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.hm-card h3 { margin-top: 10px; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.hm-card h3 a { color: var(--ink); }
.hm-card h3 a::before { content: ""; position: absolute; inset: 0; }   /* whole card is clickable */
.hm-card h3 a:hover { color: var(--accent); }
.hm-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.hm-card-meta .hm-i { width: 16px; height: 16px; }
.hm-card-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 14px 0 16px; border-top: 1px solid var(--line); }
.hm-card-go { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--accent); }
.hm-card-go .hm-i { width: 16px; height: 16px; transition: transform .15s; }
.hm-card:hover .hm-card-go .hm-i { transform: translateX(3px); }
.hm-card-mock { position: relative; z-index: 1; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.hm-card-mock:hover { color: var(--ink); text-decoration-color: currentColor; }
.hm-empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* Try a question */
.hm-try-band { background: var(--bg); }
.hm-try-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.hm-try-copy p { max-width: 480px; margin-top: 16px; font-size: 17px; color: var(--text); }
.hm-try { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); }
.hm-try-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hm-try-bar span:first-child { color: var(--ink); }
.hm-try-body { margin: 0; padding: 22px 22px 10px; border: 0; min-width: 0; }
.hm-try-body legend { float: left; width: 100%; margin-bottom: 16px; padding: 0; font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.hm-opt { position: relative; clear: both; display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 15px; line-height: 1.4; cursor: pointer; transition: border-color .15s, background-color .15s; }
.hm-opt input { position: absolute; opacity: 0; pointer-events: none; }
.hm-opt:hover { border-color: var(--ink); }
.hm-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-opt-key { display: grid; place-items: center; flex: none; width: 28px; height: 28px; background: var(--bg); border-radius: var(--r-sm); font-size: 13px; font-weight: 700; color: var(--ink); }
.hm-try.is-answered .hm-opt { cursor: default; }
.hm-try.is-answered .hm-opt:not(.is-right):not(.is-wrong) { opacity: .55; }
.hm-opt.is-right { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); }
.hm-opt.is-right .hm-opt-key { background: var(--ok); color: #fff; }
.hm-opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.hm-opt.is-wrong .hm-opt-key { background: var(--bad); color: #fff; }
.hm-try-result { padding: 4px 22px 24px; font-size: 15px; line-height: 1.6; }
.hm-try-verdict { margin-bottom: 6px; font-weight: 700; }
.hm-try-verdict.is-ok { color: var(--ok); }
.hm-try-verdict.is-bad { color: var(--bad); }
.hm-try-next { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 700; color: var(--accent); }
.hm-try-next:hover { color: var(--ink); }
.hm-try-next .hm-i { width: 16px; height: 16px; }
.hm-try-result:not([hidden]) { animation: hm-reveal .25s ease-out; }
@keyframes hm-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Why */
.hm-why-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.hm-why-grid li { padding: 32px 28px 36px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hm-why-grid .hm-i { width: 30px; height: 30px; margin-bottom: 20px; color: var(--accent); stroke-width: 1.6; }
.hm-why-grid h3 { margin-bottom: 8px; font-size: 19px; letter-spacing: -.02em; }
.hm-why-grid p { font-size: 15px; color: var(--muted); }

/* How it works */
.hm-how { padding-top: 0; }
.hm-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; counter-reset: step; }
.hm-steps li { position: relative; padding: 28px 24px 30px; background: var(--bg); border-radius: var(--r-lg); counter-increment: step; }
.hm-steps li::before { content: "0" counter(step); display: block; margin-bottom: 18px; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--accent); }
.hm-steps li:last-child { background: var(--night); }
.hm-steps li:last-child b { color: #fff; }
.hm-steps li:last-child span { color: var(--on-night-muted); }
.hm-steps b { display: block; margin-bottom: 6px; font-size: 18px; line-height: 1.25; color: var(--ink); }
.hm-steps span { font-size: 15px; color: var(--muted); }

/* CTA */
.hm-cta { position: relative; overflow: hidden; padding: 64px 0; background: var(--accent); color: rgba(255, 255, 255, .9); }
.hm-cta::before { content: ""; position: absolute; top: 0; bottom: 0; right: -6%; width: 34%; background: rgba(0, 0, 0, .14); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
.hm-cta-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.hm-cta h2 { max-width: 640px; color: #fff; font-size: clamp(26px, 3.2vw, 40px); }
.hm-cta p { margin-top: 10px; font-size: 17px; }
.hm-cta-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 30px; background: #fff; border-radius: var(--r-sm); font-size: 16px; font-weight: 700; color: var(--ink); transition: background-color .15s, color .15s; }
.hm-cta-btn:hover { background: var(--ink); color: #fff; }

/* ---------- Tablets ---------- */
@media (max-width: 1099px) {
  .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .hm-hero { padding: 48px 0 0; }
  .hm-hero::before, .hm-hero::after { top: auto; width: 100%; height: 300px; clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%); }
  .hm-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hm-hero h1 { max-width: none; }
  .hm-tracks { margin-bottom: 40px; }
  .hm-try-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
  .hm-hero { padding-top: 32px; }
  .hm-hero::before, .hm-hero::after { height: 240px; }
  .hm-kicker { margin-bottom: 10px; font-size: 12px; }
  .hm-hero h1 { font-size: 34px; line-height: 1.06; }
  .hm-kicker { letter-spacing: .06em; }
  .hm-lead { margin-top: 14px; font-size: 16px; }
  .hm-search { margin-top: 22px; }
  .hm-search input { height: 52px; font-size: 16px; }   /* 16px: no zoom on iPhone */
  .hm-search button { padding: 0 18px; }
  .hm-search label .hm-i { display: none; }
  .hm-search label { padding-left: 14px; }
  .hm-popular { flex-wrap: nowrap; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
  .hm-popular::-webkit-scrollbar { display: none; }
  .hm-popular a { flex: none; }
  .hm-ticks { gap: 8px 16px; margin-top: 20px; }
  .hm-ticks li { font-size: 14px; }
  .hm-tracks { margin: 0 -8px 28px; }
  .hm-tracks-head { padding: 18px 18px 14px; }
  .hm .hm-tracks-head h2 { font-size: 19px; }
  .hm-tracks a { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px; }
  .hm-tracks a .hm-i { display: none; }
  .hm-tracks-name small { display: none; }
  .hm-tracks-foot { padding: 14px 18px; }

  .hm-products .container { gap: 20px; min-height: 54px; }
  .hm-products ul { gap: 22px; }
  .hm-products li { font-size: 15px; }

  .hm-section { padding: 56px 0; }
  .hm h2 { font-size: 28px; }
  .hm-head { margin-bottom: 22px; }
  .hm-head p { font-size: 16px; }
  .hm-filter { width: 100%; }
  .hm-levels { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 20px; padding: 0 20px; scrollbar-width: none; }
  .hm-levels::-webkit-scrollbar { display: none; }
  .hm-levels button { flex: none; }
  .hm-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hm-card { padding: 16px 16px 0; }
  .hm-card h3 { margin-top: 6px; font-size: 16px; }
  .hm-card-meta { margin: 4px 0 12px; font-size: 13px; }
  .hm-card-foot { padding: 10px 0 12px; }

  .hm-try-body { padding: 18px 16px 8px; }
  .hm-try-bar { padding: 12px 16px; font-size: 12px; }
  .hm-try-body legend { font-size: 16px; }
  .hm-opt { min-height: 50px; }
  .hm-try-result { padding: 4px 16px 20px; }

  .hm-why-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-why-grid li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; padding: 22px 18px; }
  .hm-why-grid .hm-i { grid-row: span 2; width: 26px; height: 26px; margin: 2px 0 0; }
  .hm-why-grid h3 { margin-bottom: 4px; font-size: 17px; }

  .hm-how { padding-top: 0; }
  .hm-steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hm-steps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 12px; padding: 20px 18px; }
  .hm-steps li::before { grid-row: span 2; margin: 0; font-size: 30px; }

  .hm-cta { padding: 48px 0; }
  .hm-cta::before { display: none; }
  .hm-cta-btn { width: 100%; }
}
