/* Form presentation only. IDs, field names, permissions and behavior stay in each module. */
.crm-form-page { width:100%; max-width:56rem; margin-inline:auto; min-width:0; }
.crm-form-heading { margin:0 0 24px; }
.crm-form-heading .crm-title { font-size:28px; letter-spacing:-.6px; line-height:1.3; text-align:start; }
.crm-form-heading p { margin-top:8px; font-size:14px; color:var(--crm-muted); line-height:1.6; }
.crm-form-page > a.crm-link { display:inline-block; margin-bottom:20px; font-size:14px; }
.crm-form-stack { display:flex; flex-direction:column; gap:20px; min-width:0; }
.crm-form-section { min-width:0; margin:0; padding:24px; background:var(--crm-surface); border:1px solid var(--crm-border); border-radius:14px; }
.crm-form-section-title { display:flex; align-items:center; gap:9px; width:100%; margin:0 0 18px; padding:0 0 14px; border-bottom:1px solid var(--crm-border); color:var(--crm-text); font-size:16px; font-weight:600; line-height:1.4; }
.crm-form-section-title .crm-icon { width:18px; height:18px; color:var(--crm-primary); }
.crm-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:18px 16px; }
.crm-form-grid > * { min-width:0; }
.crm-form-full { grid-column:1/-1; }
.crm-form-stack .crm-label, .crm-inline-form .crm-label { font-size:14px; font-weight:500; margin-bottom:6px; }
.crm-form-stack .crm-field, .crm-inline-form .crm-field { min-height:44px; border-radius:9px; font-size:14px; background:var(--crm-field-surface); }
.crm-form-stack .crm-field[readonly], .crm-form-stack .crm-field:disabled { background:var(--crm-disabled-surface); }
.crm-form-stack :is(.crm-help,.crm-error-text,.crm-alert) { font-size:14px; line-height:1.6; }
.crm-form-stack :is(.crm-alert,.crm-error-text):not(:empty) { margin-top:8px; }
.crm-form-compound { display:grid; gap:8px; align-items:start; }
.crm-form-compound-id { grid-template-columns:72px minmax(0,1fr); }
.crm-form-compound-phone { grid-template-columns:100px minmax(0,1fr); }
.crm-form-full > .grid { gap:16px; }
.crm-form-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:12px; margin-top:4px; }
.crm-form-actions .crm-button-primary { min-width:160px; }
.crm-form-actions > .crm-link, .crm-form-page > .text-center > .crm-link { display:inline-flex; justify-content:center; align-items:center; min-height:44px; padding:8px 20px; border:1px solid var(--crm-control-border); border-radius:22px; background:var(--crm-surface); color:var(--crm-text); font-size:14px; text-decoration:none; }
.crm-form-actions > .crm-link:hover, .crm-form-page > .text-center > .crm-link:hover { background:var(--crm-field-surface); }
.crm-form-page > .text-center { text-align:end; }
.crm-client-picker > legend { width:auto; padding-inline:8px; border-bottom:0; margin-bottom:0; font-size:16px; }
.crm-client-picker > :is(div,p) { margin-top:16px; }
.crm-client-picker #clientResults { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.crm-client-picker #clientResults > * { margin:0; min-width:0; }
.crm-client-picker .crm-picker-option { align-items:flex-start; border-radius:9px; }
.crm-form-content > .crm-alert { margin-block:16px; }
.crm-form-content > section.crm-form-section { margin-top:24px; }
.segments-editor:has(> .crm-form-stack) { background:transparent; border:0; padding:0; }
.segments .crm-form-stack .segments-rule-builder { padding:24px; border:1px solid var(--crm-border); }
.segments .crm-form-stack .segments-rule-builder > legend { width:auto; margin:0; padding-inline:8px; border-bottom:0; }
.segments .crm-form-stack .segments-form-fields { margin-bottom:0; }
.segments .crm-form-stack .segments-rule { padding:18px 0; }
.segments .crm-form-stack .segments-editor-actions { margin-top:0; }
.segments .crm-form-stack .segments-rule-controls { grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); }
.segments .crm-form-stack .segments-rule-controls > button { justify-self:start; }
@media(max-width:640px) {
    .crm-form-grid { grid-template-columns:minmax(0,1fr); }
    .crm-form-section { padding:20px 16px; }
    .crm-form-heading .crm-title { font-size:25px; }
    .crm-form-actions > :is(.crm-button,.crm-link) { flex:1 1 140px; }
    .crm-client-picker #clientResults { grid-template-columns:minmax(0,1fr); }
    .segments .crm-form-stack .segments-rule-controls { grid-template-columns:minmax(0,1fr); }
}
