/* ==========================================================================
   MONOLITH CONTACT — registry forms ([monolith_form])
   Schema-driven multi-form styling: white card, two-column grid, uppercase
   labels, muted hints, pill radios/checkboxes, accent section headings and
   accent submit button. Compact by design so a full form fits on one screen.
   Token-driven — reads monolith-theme's assets/css/tokens.css when present,
   falls back to the starter kit's own neutral defaults otherwise.
   ========================================================================== */

/* 1. Card container + two-column field grid */
.mf-form {
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
    background: var(--color-white, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-card, 12px);
    box-shadow: var(--shadow-card, 0 2px 8px rgba(51, 65, 85, 0.06));
    padding: 31px 40px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 0;
    align-items: start;
}

/* Fields span the full width by default; --half takes a single column. */
.mf-form > .mf-field,
.mf-form > .mf-section,
.mf-form > .mf-error { grid-column: 1 / -1; }
.mf-form > .mf-field--half { grid-column: auto; }

.mf-field { margin: 0 0 14px 0; }

/* 2. Section heading — accent left bar */
.mf-section {
    font-family: var(--font-heading, inherit);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary, #334155);
    border-left: 3px solid var(--color-accent, #6366f1);
    padding-left: 12px;
    margin: 6px 0 14px;
}
.mf-form > .mf-section:first-of-type { margin-top: 0; }

/* 3. Labels + required asterisk */
.mf-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--color-text, #333);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.mf-label span[aria-hidden="true"] { color: var(--color-accent-text, #4338ca); }

/* 4. Hint text */
.mf-hint {
    display: block;
    font-size: 11px;
    color: var(--color-muted, #64748b);
    line-height: 1.5;
    margin: 0 0 6px;
}

/* 5. Inputs + textareas */
.mf-input,
.mf-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bg, #fafafa);
    border: 1px solid var(--color-border, #ddd);
    border-radius: var(--radius-inner, 6px);
    color: var(--color-text, #555);
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 14px;
    padding: 10px 14px;
    transition: border-color var(--transition, 0.3s), box-shadow var(--transition, 0.3s);
}
.mf-input:focus,
.mf-textarea:focus {
    outline: none;
    border-color: var(--color-accent, #6366f1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, #6366f1) 15%, transparent);
}
.mf-input::placeholder,
.mf-textarea::placeholder { color: var(--color-muted, #64748b); }
.mf-textarea { min-height: 100px; resize: vertical; }
.mf-field--short .mf-textarea { min-height: 56px; height: 56px; }

/* 5b. Selects — strip the native control chrome so .mf-input's padding/border
   apply uniformly (Safari otherwise ignores them), then draw our own arrow.
   The data-URI stroke hardcodes --color-muted's fallback (#64748b) because
   url() cannot resolve var(). */
.mf-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

/* 6. Pill radios + checkboxes (native control hidden, label span is the pill) */
.mf-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mf-choice {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}
.mf-choice input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.mf-choice span {
    display: inline-block;
    background: var(--color-white, #ffffff);
    color: var(--color-primary, #334155);
    border: 1px solid var(--color-accent, #6366f1);
    border-radius: var(--radius-pill, 50px);
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
    transition: all 0.2s ease;
}
.mf-choice:hover span,
.mf-choice input:checked + span {
    background: var(--color-primary, #334155);
    color: var(--color-white, #ffffff);
    border-color: var(--color-primary, #334155);
}
.mf-choice input:focus-visible + span {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, #6366f1) 25%, transparent);
}

/* 7. Submit — PLACEMENT ONLY. The button's look comes from the theme's
   shared component (.btn .btn-primary .btn-lg, applied in the markup) so the
   form CTA matches every other button on the site. This rule only positions
   it inside the form grid. */
.mf-submit {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 20px;
    max-width: 100%;
    white-space: nowrap;
}

/* 8. Error + success states */
.mf-error {
    background: var(--color-error-bg, #fef2f2);
    border: 1px solid var(--color-error-border, #fca5a5);
    color: var(--color-error-text, #991b1b);
    border-radius: var(--radius-inner, 8px);
    padding: 14px 20px;
    margin-bottom: 18px;
    font-size: 14px;
}

.mf-form--success {
    display: block;
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 32px;
}
.mf-success-msg {
    font-family: var(--font-heading, inherit);
    font-size: 19px;
    line-height: 1.5;
    color: var(--color-success, #4caf50);
    margin: 14px 0 0;
}

/* 9. Honeypot — visually hidden, present for bots */
.mf-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* 10. Mobile — single column, full-width submit */
@media (max-width: 768px) {
    .mf-form {
        grid-template-columns: 1fr;
        padding: 24px 20px;
    }
    .mf-form > .mf-field--half { grid-column: 1 / -1; }
    .mf-submit {
        justify-self: stretch;
        width: 100%;
    }
}
