/* MegaForm Calculator Widget — Styles */

/* Container
   [Agnostic 2026-07-28] The widget dissolves into whatever form hosts it: it inherits font
   and colour, paints no background of its own, and only manages spacing. The old card
   (border + gradient + shadow) survives as .mf-wg-calc--chrome and is applied ONLY when the
   calculator renders input fields of its own — the one case where it needs to read as a
   distinct block. Fixed colours here would clash with a flat, a dark, or a corporate form. */
.mf-wg-calc{font-family:inherit;color:inherit;background:transparent;border:0;box-shadow:none;padding:0}
.mf-wg-calc--chrome{border:1px solid rgba(0,0,0,.08);border-radius:14px;padding:16px;background:linear-gradient(135deg,#fafbff 0%,#f8f9fc 100%);box-shadow:0 1px 3px rgba(0,0,0,.04)}

/* Silent mode — the field exists in the DOM (it still submits its value) but nothing paints.
   .mf-calc-host-hidden is put on the surrounding field group at runtime so the label and the
   field chrome go with it; the builder canvas is deliberately left visible. */
.mf-wg-calc--hidden,.mf-wg-calc--headless{display:none!important}
.mf-calc-host-hidden{display:none!important}

/* Mode: input mimicry — .mf-input already carries the form's border/radius/focus ring, so
   only the read-only affordance is added here. */
.mf-wg-calc-native{margin:0}
.mf-wg-calc-native-label{display:block;font-family:inherit;font-size:inherit;color:inherit;opacity:.8;margin-bottom:6px}
.mf-wg-calc-native-input[readonly]{width:100%;box-sizing:border-box;font-family:inherit;font-size:inherit;color:inherit;font-weight:700;background-color:rgba(0,0,0,.02);cursor:not-allowed}
.mf-wg-calc-native + .mf-wg-calc-native{margin-top:10px}

/* Mode: inline native text — nothing but type. */
.mf-wg-calc-inline{font-family:inherit;font-size:1em;color:inherit;margin:8px 0}
.mf-wg-calc-inline-label{opacity:.8}
.mf-wg-calc-inline-value{font-size:1.15em;color:var(--mf-primary,var(--primary-color,currentColor))}

/* Mode: neutral callout — a translucent grey reads correctly on light and dark alike. */
.mf-wg-calc-callout{margin-top:12px;padding:12px 14px;border-radius:10px;background:rgba(127,127,127,.08);font-family:inherit;color:inherit}
.mf-wg-calc-callout .mf-wg-calc-results{margin-top:0}

/* Variables Grid */
.mf-wg-calc-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:12px}
.mf-wg-calc-item{background:#fff;border-radius:12px;padding:12px;border:1px solid #e8ecf0}
.mf-wg-calc-item-full{grid-column:span 2}

/* Labels & Inputs */
.mf-wg-calc-label{display:block;font-size:13px;font-weight:600;color:#334155;margin-bottom:6px}
.mf-wg-calc-input{width:100%;padding:8px 12px;border:1px solid #d0d5dd;border-radius:10px;font-size:14px;transition:border-color .2s,box-shadow .2s;box-sizing:border-box}
.mf-wg-calc-input:focus{border-color:#818cf8;box-shadow:0 0 0 3px rgba(129,140,248,.15);outline:none}

/* Range Slider */
.mf-wg-calc-range{display:flex;align-items:center;gap:10px}
.mf-wg-calc-range-input{flex:1;-webkit-appearance:none;height:6px;border-radius:3px;background:linear-gradient(to right,#818cf8,#c4b5fd);outline:none;border:none;padding:0}
.mf-wg-calc-range-input::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:50%;background:#fff;border:2px solid #818cf8;box-shadow:0 2px 4px rgba(0,0,0,.15);cursor:pointer}
.mf-wg-calc-range-input::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:#fff;border:2px solid #818cf8;box-shadow:0 2px 4px rgba(0,0,0,.15);cursor:pointer}
.mf-wg-calc-range-value{min-width:36px;text-align:center;font-size:13px;font-weight:600;color:#4f46e5;background:#eef2ff;padding:3px 8px;border-radius:20px}

/* Checkbox Sum */
.mf-wg-calc-checks{display:flex;flex-direction:column;gap:6px}
.mf-wg-calc-check{display:flex;align-items:center;gap:8px;font-size:13px;padding:6px 8px;border-radius:8px;cursor:pointer;transition:background .15s}
.mf-wg-calc-check:hover{background:#f0f0ff}
.mf-wg-calc-check input[type="checkbox"]{width:16px;height:16px;accent-color:#6366f1}

/* Results — sizes are relative (em) and colours inherit, so a row reads correctly on a dark
   theme as well as a light one. The only accent is the form's own primary colour. */
.mf-wg-calc-results{margin-top:14px}
.mf-wg-calc-result-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-bottom:1px dashed rgba(127,127,127,.25)}
.mf-wg-calc-result-row:last-child{border-bottom:none}
.mf-wg-calc-result-label{font-size:.8em;text-transform:uppercase;letter-spacing:.3px;color:inherit;opacity:.7;font-weight:600}
.mf-wg-calc-result-number{font-size:1.05em;font-weight:700;color:inherit}
.mf-wg-calc-result-prefix,.mf-wg-calc-result-suffix{font-size:.9em;color:inherit;opacity:.7;font-weight:500}
.mf-wg-calc-result-number.is-error{color:#dc2626;opacity:1}

/* Highlighted Total */
.mf-wg-calc-result-highlight{background:rgba(127,127,127,.06);border-radius:12px;padding:12px 14px;margin-top:8px;border:none !important}
.mf-wg-calc-result-highlight .mf-wg-calc-result-label{font-size:.9em;opacity:.85}
.mf-wg-calc-result-highlight .mf-wg-calc-result-number{font-size:1.5em;color:var(--mf-primary,var(--primary-color,currentColor))}
.mf-wg-calc-result-highlight .mf-wg-calc-result-prefix,.mf-wg-calc-result-highlight .mf-wg-calc-result-suffix{font-size:1em;color:var(--mf-primary,var(--primary-color,currentColor));opacity:.75}

/* Breakdown */
.mf-wg-calc-breakdown{margin-top:12px;border:1px dashed #cbd5e1;border-radius:12px;padding:12px;background:#f8fafc}
.mf-wg-calc-breakdown-title{font-size:11px;font-weight:700;text-transform:uppercase;color:#94a3b8;margin-bottom:6px}
.mf-wg-calc-breakdown-pre{font-family:'Courier New',monospace;font-size:11px;color:#64748b;white-space:pre-wrap;margin:0}

/* Responsive */
@media(max-width:600px){
    .mf-wg-calc-grid{grid-template-columns:1fr}
    .mf-wg-calc-item-full{grid-column:span 1}
    .mf-wg-calc-result-highlight .mf-wg-calc-result-number{font-size:20px}
}
