/* Maalampolaskuri.fi CTA contrast lock v1 — 2026-10-06
   Loaded last on every public page to prevent dark-on-dark / light-on-light regressions. */

:root {
  --ml-cta-dark:#06142f;
  --ml-cta-dark-hover:#09265b;
  --ml-cta-white:#ffffff;
  --ml-cta-accent:#4ee3ff;
}

/* Primary actions: always dark with white text. */
html body main a.ml-open-calculator-cta-v39,
html body section a.ml-open-calculator-cta-v39,
html body main .btn-primary,
html body section .btn-primary,
html body main a.primary,
html body section a.primary,
html body main button[type="submit"],
html body section button[type="submit"],
html body main input[type="submit"],
html body section input[type="submit"] {
  background:var(--ml-cta-dark) !important;
  background-image:none !important;
  color:var(--ml-cta-white) !important;
  border-color:var(--ml-cta-dark) !important;
  text-shadow:none !important;
  -webkit-text-fill-color:var(--ml-cta-white) !important;
}

/* Calculator opener gets a visible technical accent border. */
html body main a.ml-open-calculator-cta-v39,
html body section a.ml-open-calculator-cta-v39 {
  border:1px solid rgba(78,227,255,.48) !important;
}

/* Secondary actions: always white with dark text. */
html body main .btn-secondary,
html body section .btn-secondary,
html body main a.secondary,
html body section a.secondary,
html body main .ml-hero-final-secondary,
html body section .ml-hero-final-secondary {
  background:var(--ml-cta-white) !important;
  background-image:none !important;
  color:var(--ml-cta-dark) !important;
  border-color:var(--ml-cta-white) !important;
  text-shadow:none !important;
  -webkit-text-fill-color:var(--ml-cta-dark) !important;
}

/* Hover/focus preserve readable contrast. */
html body main a.ml-open-calculator-cta-v39:hover,
html body section a.ml-open-calculator-cta-v39:hover,
html body main .btn-primary:hover,
html body section .btn-primary:hover,
html body main a.primary:hover,
html body section a.primary:hover,
html body main button[type="submit"]:hover,
html body section button[type="submit"]:hover {
  background:var(--ml-cta-dark-hover) !important;
  background-image:none !important;
  color:var(--ml-cta-white) !important;
  border-color:var(--ml-cta-accent) !important;
  -webkit-text-fill-color:var(--ml-cta-white) !important;
}

html body main .btn-secondary:hover,
html body section .btn-secondary:hover,
html body main a.secondary:hover,
html body section a.secondary:hover,
html body main .ml-hero-final-secondary:hover,
html body section .ml-hero-final-secondary:hover {
  background:#f3f7ff !important;
  color:var(--ml-cta-dark) !important;
  border-color:#f3f7ff !important;
  -webkit-text-fill-color:var(--ml-cta-dark) !important;
}

/* Keyboard focus remains visible on both variants. */
html body main a.ml-open-calculator-cta-v39:focus-visible,
html body section a.ml-open-calculator-cta-v39:focus-visible,
html body main .btn-primary:focus-visible,
html body section .btn-primary:focus-visible,
html body main .btn-secondary:focus-visible,
html body section .btn-secondary:focus-visible,
html body main a.primary:focus-visible,
html body section a.primary:focus-visible,
html body main a.secondary:focus-visible,
html body section a.secondary:focus-visible,
html body main button[type="submit"]:focus-visible,
html body section button[type="submit"]:focus-visible {
  outline:3px solid var(--ml-cta-accent) !important;
  outline-offset:3px !important;
}

/* Specificity lock: defeats legacy !important class rules without inline HTML styles. */
html body main a.ml-open-calculator-cta-v39:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section a.ml-open-calculator-cta-v39:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body main .btn-primary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section .btn-primary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body main a.primary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section a.primary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body main button[type="submit"]:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section button[type="submit"]:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body main input[type="submit"]:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section input[type="submit"]:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c){
  background:#06142f !important;
  background-image:none !important;
  color:#ffffff !important;
  border-color:#06142f !important;
  text-shadow:none !important;
  -webkit-text-fill-color:#ffffff !important;
}

html body main .btn-secondary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section .btn-secondary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body main a.secondary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section a.secondary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body main .ml-hero-final-secondary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c),
html body section .ml-hero-final-secondary:not(#ml-cta-lock-a):not(#ml-cta-lock-b):not(#ml-cta-lock-c){
  background:#ffffff !important;
  background-image:none !important;
  color:#06142f !important;
  border-color:#ffffff !important;
  text-shadow:none !important;
  -webkit-text-fill-color:#06142f !important;
}
