/* V38: readable tables + calculator/forms.
   Site-wide content readability fix. Do not create page-specific table styles. */

/* ---------- TABLES ---------- */

main table,
section table,
article table,
.ml-price-table,
.price-table,
.table,
[class*="price"] table,
[class*="hinta"] table{
  width:100% !important;
  border-collapse:collapse !important;
  border-spacing:0 !important;
  background:#06142f !important;
  color:#ffffff !important;
  border:1px solid rgba(255,255,255,.18) !important;
  margin:22px 0 !important;
  overflow:hidden !important;
  border-radius:0 !important;
  box-shadow:0 22px 70px rgba(0,0,0,.22) !important;
}

main table thead,
section table thead,
article table thead{
  background:#09265b !important;
  color:#ffffff !important;
}

main table th,
section table th,
article table th{
  background:#09265b !important;
  color:#ffffff !important;
  border:1px solid rgba(255,255,255,.18) !important;
  padding:16px 16px !important;
  text-align:left !important;
  font-size:14px !important;
  line-height:1.35 !important;
  font-weight:950 !important;
  letter-spacing:.01em !important;
  vertical-align:top !important;
}

main table td,
section table td,
article table td{
  background:rgba(255,255,255,.055) !important;
  color:rgba(255,255,255,.88) !important;
  border:1px solid rgba(255,255,255,.14) !important;
  padding:15px 16px !important;
  text-align:left !important;
  font-size:15px !important;
  line-height:1.45 !important;
  font-weight:700 !important;
  vertical-align:top !important;
}

main table tbody tr:nth-child(even) td,
section table tbody tr:nth-child(even) td,
article table tbody tr:nth-child(even) td{
  background:rgba(255,255,255,.085) !important;
}

main table strong,
main table b,
section table strong,
section table b,
article table strong,
article table b{
  color:#ffffff !important;
  font-weight:950 !important;
}

main table a,
section table a,
article table a{
  color:#4ee3ff !important;
  text-decoration:none !important;
  font-weight:950 !important;
}

main table caption,
section table caption,
article table caption{
  color:rgba(255,255,255,.78) !important;
  padding:0 0 10px !important;
  text-align:left !important;
  font-weight:850 !important;
}

/* If a table sits inside a white/bright section, force readable dark island. */
main table *,
section table *,
article table *{
  text-shadow:none !important;
}

/* Mobile table behavior */
@media(max-width:760px){
  main table,
  section table,
  article table{
    display:block !important;
    width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }

  main table th,
  section table th,
  article table th,
  main table td,
  section table td,
  article table td{
    min-width:170px !important;
    padding:13px 14px !important;
    font-size:14px !important;
  }
}

/* ---------- CALCULATOR / FORMS / "AVAA LASKURI" ---------- */

/* Calculator sections must be dark, not white-on-white. */
#maalampo-laskuri-lomake,
#laskuri,
#calculator,
.ml-calculator,
.maalampo-calculator,
.calculator,
.calculator-section,
.calculator-card,
.laskuri,
.laskuri-section,
.laskuri-card,
[class*="calculator"],
[class*="laskuri-lomake"]{
  background:#06142f !important;
  background-image:linear-gradient(135deg,#06142f 0%,#09265b 100%) !important;
  color:#ffffff !important;
  border-color:rgba(255,255,255,.18) !important;
  border-radius:0 !important;
}

/* Calculator text */
#maalampo-laskuri-lomake h1,
#maalampo-laskuri-lomake h2,
#maalampo-laskuri-lomake h3,
#maalampo-laskuri-lomake label,
#maalampo-laskuri-lomake p,
#maalampo-laskuri-lomake span,
#laskuri h1,
#laskuri h2,
#laskuri h3,
#laskuri label,
#laskuri p,
#laskuri span,
.calculator h1,
.calculator h2,
.calculator h3,
.calculator label,
.calculator p,
.calculator span,
.laskuri h1,
.laskuri h2,
.laskuri h3,
.laskuri label,
.laskuri p,
.laskuri span{
  color:#ffffff !important;
}

/* Form fields: white background is OK, but text must be dark. */
main input,
main select,
main textarea,
section input,
section select,
section textarea{
  background:#ffffff !important;
  color:#06142f !important;
  border:1px solid rgba(6,20,47,.28) !important;
  border-radius:0 !important;
  box-shadow:none !important;
}

main input::placeholder,
main textarea::placeholder,
section input::placeholder,
section textarea::placeholder{
  color:rgba(6,20,47,.58) !important;
}

/* Form labels and helper texts inside dark calculator areas. */
main form label,
section form label,
main form .help,
section form .help,
main form small,
section form small{
  color:rgba(255,255,255,.86) !important;
}

/* Main content buttons/CTA: prevent white text on white background. */
main button,
section button,
main input[type="submit"],
section input[type="submit"],
main a[href*="maalampo-laskuri"],
section a[href*="maalampo-laskuri"],
main a[href*="#laskuri"],
section a[href*="#laskuri"],
main a[href*="#maalampo-laskuri-lomake"],
section a[href*="#maalampo-laskuri-lomake"]{
  border-radius:0 !important;
}

/* Buttons with white background must have dark text. */
main button,
section button,
main input[type="submit"],
section input[type="submit"]{
  color:#06142f !important;
  background:#ffffff !important;
  border:1px solid #ffffff !important;
  font-weight:950 !important;
}

/* Dark CTA alternative stays readable. */
main .secondary,
section .secondary,
main .btn-secondary,
section .btn-secondary{
  color:#ffffff !important;
  background:rgba(255,255,255,.07) !important;
  border-color:rgba(255,255,255,.18) !important;
}

/* Specific visible calculator opener text. */
main a,
section a{
  text-underline-offset:3px !important;
}

main a:where([href*="maalampo-laskuri"], [href*="#laskuri"], [href*="#maalampo-laskuri-lomake"]),
section a:where([href*="maalampo-laskuri"], [href*="#laskuri"], [href*="#maalampo-laskuri-lomake"]){
  font-weight:950 !important;
}

/* If an "Avaa laskuri" link/button is styled as white CTA, force dark text via common classes. */
main .cta,
main .btn,
main .button,
main [class*="cta"],
section .cta,
section .btn,
section .button,
section [class*="cta"]{
  text-shadow:none !important;
}

/* White CTA classes must not have white text. */
main .cta:not(.secondary),
main .btn:not(.secondary),
main .button:not(.secondary),
section .cta:not(.secondary),
section .btn:not(.secondary),
section .button:not(.secondary){
  color:#06142f !important;
}

/* Keep header menu untouched. */
header.ml-menu-master-v28 button,
header.ml-menu-master-v28 a,
header.ml-menu-master-v28 input,
header.ml-menu-master-v28 select,
header.ml-menu-master-v28 textarea{
  all:revert-layer;
}
