.mf {
    --mf-accent: #1f5fa8;
    --mf-accent-soft: rgba(31, 95, 168, .15);
    --mf-text: #1d2530;
    --mf-label: #3a4450;
    --mf-muted: #6b7480;
    --mf-border: #c9d3dd;
    --mf-card-border: #9fc3de;
    --mf-bg: #ffffff;
    --mf-bg-alt: #f6f8fb;
    --mf-hd-bg: #3a2992;
    --mf-hd-text: #23313f;
    --mf-req: #c0392b;
    --mf-radius: 10px;
    width: 100%;
    max-width: 920px;
    margin: 0 0 20px;
    text-align: left;
    color: var(--mf-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}
.mf *, .mf *::before, .mf *::after { box-sizing: border-box; }
 
/* ---- Defensive resets: neutralise site-wide label/input/p rules ---- */
.mf label, .mf input, .mf select, .mf textarea, .mf p, .mf div {
    float: none; margin: 0; line-height: 1.35; letter-spacing: normal; text-align: left;
}
.mf label { display: block; padding: 0; width: auto; height: auto; }
.mf input[type=text], .mf input[type=tel], .mf input[type=email],
.mf select, .mf textarea {
    display: block; max-width: 100%; min-width: 0; height: auto; min-height: 38px;
    font-size: 14px !important; font-family: inherit;
}
.mf .mf-hint { margin: 0 0 18px; }
.mf .mf-card { margin: 0 0 20px; }
 
/* ---- Cards ---- */
.mf-card {
    background: var(--mf-bg);
    border: 1px solid var(--mf-card-border);
    border-radius: var(--mf-radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    margin: 0 0 20px;
    overflow: hidden;
}
.mf-card-hd {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mf-card-border);
    background: var(--mf-hd-bg);
    font-size: 15px; font-weight: 700; color: var(--mf-hd-text);
}
.mf-card-hd small { font-size: 12px; font-weight: 400; color: var(--mf-muted); }
.mf-card-bd { padding: 20px; }
.mf-card-ft {
    padding: 10px 20px;
    border-top: 1px solid var(--mf-card-border);
    background: var(--mf-hd-bg);
    font-size: 12px; font-style: italic; color: var(--mf-muted);
}
.mf-hint {
    margin: 0 0 18px; padding: 10px 14px;
    background: #f1f6fc; border-left: 3px solid var(--mf-accent); border-radius: 6px;
    font-size: 13px; line-height: 1.5; color: var(--mf-label);
}
 
/* ---- 12-column grid ---- */
.mf-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 16px; }
.mf-s2  { grid-column: span 2; }  .mf-s3 { grid-column: span 3; }
.mf-s4  { grid-column: span 4; }  .mf-s5 { grid-column: span 5; }
.mf-s6  { grid-column: span 6; }  .mf-s8 { grid-column: span 8; }
.mf-s12 { grid-column: span 12; }
 
.mf-subhd {
    grid-column: span 12;
    margin-top: 6px; padding-top: 14px;
    border-top: 1px dashed var(--mf-border);
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--mf-muted);
}
 
/* ---- Fields ---- */
.mf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mf-field > label { font-size: 13px; font-weight: 600; color: var(--mf-label); }
.mf-req > label:not(.mf-check)::after { content: " *"; color: var(--mf-req); }
 
.mf input[type=text], .mf input[type=tel], .mf input[type=email],
.mf select, .mf textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--mf-border);
    border-radius: 6px;
    background: #fff;
    color: var(--mf-text);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.mf textarea { resize: vertical; min-height: 84px; }
.mf select {
    appearance: none; -webkit-appearance: none;
    padding-right: 32px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7480' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.mf input:hover, .mf select:hover, .mf textarea:hover { border-color: #b4bfcb; }
.mf input:focus, .mf select:focus, .mf textarea:focus {
    outline: none; border-color: var(--mf-accent); box-shadow: 0 0 0 3px var(--mf-accent-soft);
}
.mf input:user-invalid, .mf select:user-invalid, .mf textarea:user-invalid { border-color: var(--mf-req); }
.mf ::placeholder { color: #a3acb7; }
 
.mf label.mf-check {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
    font-size: 13px; font-weight: 400; color: var(--mf-label); cursor: pointer;
}
.mf-check input { width: 16px; height: 16px; min-height: 0; flex: none; accent-color: var(--mf-accent); margin: 0; }
 
.mf-note { grid-column: span 12; margin: 0; font-size: 12px; color: var(--mf-muted); }
 
/* ---- Mobile: stack everything ---- */
@media (max-width: 640px) {
    .mf-grid > * { grid-column: span 12; }
    .mf-grid.mf-keep3 > .mf-field { grid-column: span 4; }   /* birthdate stays on one row */
    .mf-card-bd { padding: 16px; }
}