/* ================================================================================================
 *  mc-calc-form.css -- a legacy calculator's input form, hosted INSIDE the dashboard pane.
 *
 *  The form markup comes from FormCreator (via api/calculator_form.php) and is the same markup
 *  the standalone page renders, styled there by sccss.css. Only the rules that markup needs are
 *  reproduced here, scoped under .mc-calc-form and expressed in the dashboard's tokens so the
 *  form reads as part of the dashboard (and follows its dark theme) rather than as a transplant.
 *
 *  Layout vocabulary (from FormCreator): .section.group is a float-cleared row, .col floats,
 *  .span_1_of_N sets the column width. Kept as floats on purpose: the widths are inline styles
 *  on the markup (e.g. style="width:30%"), and a flex rewrite would fight them.
 * ============================================================================================= */

.mc-calc-form { margin: 0 0 18px; }

.mc-calc-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mc-calc-form-head h3 { margin: 0; font-size: 1.15em; font-weight: 600; }
.mc-calc-form-head .mc-calc-form-crumb { font-size: 0.8em; color: #70757a; letter-spacing: 0.04em; text-transform: uppercase; }
/* a quiet caption, not an alert: the only thing worth the eye here is the "try another" link */
.mc-calc-form-note { font-size: 0.78em; color: var(--text-muted, #70757a); margin: 2px 0 10px; display: inline-flex; gap: 6px; align-items: center; }
.mc-calc-form-note button { border: 0; background: transparent; color: var(--primary, #1a73e8); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; padding: 0; }
.mc-calc-form-note em { font-style: normal; }

.mc-calc-form .form-gathering-data { border: 1px solid var(--border, #dadce0); border-radius: 10px; padding: 16px 20px 6px; background: var(--bg, #f8f9fa); }

/* the float grid */
.mc-calc-form .section { clear: both; padding: 0; margin: 8px 0; }
.mc-calc-form .group::before, .mc-calc-form .group::after { content: ""; display: table; }
.mc-calc-form .group::after { clear: both; }
.mc-calc-form .col { display: block; float: left; vertical-align: middle; margin: 1% 0 1% 1.6%; }
.mc-calc-form .col:first-child { margin-left: 0; }
.mc-calc-form .span_1_of_2 { width: 49.2%; }
.mc-calc-form .span_1_of_3 { width: 32.2%; }
.mc-calc-form .span_1_of_4 { width: 23.8%; }
.mc-calc-form .select-input { margin: 8px 0 12px; }

/* controls */
.mc-calc-form input[type="text"], .mc-calc-form textarea, .mc-calc-form select {
    font: inherit; font-size: 15px; color: inherit;
    background: white; border: 1px solid var(--border, #dadce0); border-radius: 6px;
    padding: 7px 10px; width: 100%; max-width: 100%; box-sizing: border-box;
}
.mc-calc-form select { width: auto !important; display: inline-block; padding-right: 26px; }
.mc-calc-form input[type="text"]:focus, .mc-calc-form select:focus { outline: 2px solid var(--primary, #1a73e8); outline-offset: 1px; border-color: transparent; }
.mc-calc-form .input-bullet-icon { color: var(--primary, #1a73e8) !important; }

/* the submit is the dashboard's primary action, not the legacy grey button */
.mc-calc-form .submit-button {
    display: inline-block; margin: 14px 0 12px; padding: 10px 24px;
    background: var(--primary, #1a73e8); color: #fff; border: 0; border-radius: 8px;
    font: inherit; font-weight: 600; cursor: pointer;
}
.mc-calc-form .submit-button:hover { filter: brightness(1.06); }
.mc-calc-form .submit-button:disabled { opacity: 0.6; cursor: default; }

/* FormCreator::echo_general_button -- the "2x2 3x3 4x4 5x5" size pickers above the matrix
   forms. They carry INLINE legacy styles (line-height:8px, beige background, hover handlers
   that rewrite the background), hence !important: in the pane they become a chip row. */
.mc-calc-form-body > button[onclick] {
    line-height: 1.4 !important; background: var(--card-bg, #fff) !important; color: inherit;
    border: 1px solid var(--border, #dadce0); border-radius: 999px; padding: 6px 14px; margin: 0 6px 12px 0;
    font: inherit; font-size: 0.92em; font-weight: 500; cursor: pointer;
}
.mc-calc-form-body > button[onclick]:hover { border-color: var(--primary, #1a73e8); color: var(--primary, #1a73e8); }

/* MathQuill fields: the legacy stylesheet gives them the page's input look; in the pane they
   take the same box as the text inputs above. */
.mc-calc-form .mq-editable-field { background: white; border: 1px solid var(--border, #dadce0) !important; border-radius: 6px; padding: 6px 10px; min-width: 120px; font-size: 1.05em; }
.mc-calc-form .mq-editable-field.mq-focused { outline: 2px solid var(--primary, #1a73e8); outline-offset: 1px; box-shadow: none !important; }

/* dark theme: the dashboard stamps data-theme="dark" (see dark-theme-guide) */
[data-theme="dark"] .mc-calc-form .mq-editable-field { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18) !important; color: inherit; }
[data-theme="dark"] .mc-calc-form .form-gathering-data { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.14); }
[data-theme="dark"] .mc-calc-form input[type="text"], [data-theme="dark"] .mc-calc-form textarea, [data-theme="dark"] .mc-calc-form select { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); color: inherit; }
[data-theme="dark"] .mc-calc-form-note { color: rgba(255,255,255,0.55); }

/* phone: every column full width, as sccss.css does at its own breakpoint */
@media (max-width: 720px) {
    .mc-calc-form .col { margin: 1% 0; width: 100% !important; }
    .mc-calc-form .col[style] { width: 100% !important; line-height: 1.6 !important; }
}
