/* Campos y formularios */
.sc-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--sc-space-4);
}

.sc-field { grid-column: span 12; min-width: 0; }
.sc-field--half { grid-column: span 6; }
.sc-field--third { grid-column: span 4; }

.sc-field__label {
    display: flex;
    justify-content: space-between;
    gap: var(--sc-space-2);
    margin-bottom: var(--sc-space-2);
    color: var(--sc-color-text);
    font-family: var(--sc-font-body);
    font-size: var(--sc-font-size-xs);
    font-weight: var(--sc-font-weight-semibold);
}

.sc-field__required { color: var(--sc-color-danger); }
.sc-field__optional { color: var(--sc-color-text-muted); font-weight: var(--sc-font-weight-regular); }

.sc-input,
.sc-select,
.sc-textarea {
    display: block;
    width: 100%;
    min-height: var(--sc-control-height-md);
    padding: var(--sc-space-2) var(--sc-space-3);
    color: var(--sc-color-text);
    background: var(--sc-color-surface);
    border: var(--sc-border-width) solid var(--sc-color-border);
    border-radius: var(--sc-radius-control);
    font-family: var(--sc-font-body);
    font-size: var(--sc-font-size-sm);
    line-height: var(--sc-line-height-body);
    transition: border-color var(--sc-duration-normal) var(--sc-ease-standard), box-shadow var(--sc-duration-normal) var(--sc-ease-standard), background-color var(--sc-duration-normal) var(--sc-ease-standard);
}

.sc-select { padding-right: 2.25rem; }
.sc-textarea { min-height: 96px; resize: vertical; }
.sc-input::placeholder, .sc-textarea::placeholder { color: var(--sc-color-ink-400); }
.sc-input:hover, .sc-select:hover, .sc-textarea:hover { border-color: var(--sc-color-ink-300); }
.sc-input:focus, .sc-select:focus, .sc-textarea:focus { outline: none; border-color: var(--sc-color-focus); box-shadow: var(--sc-focus-ring); }
.sc-input:disabled, .sc-select:disabled, .sc-textarea:disabled { color: var(--sc-color-text-muted); background: var(--sc-color-ink-100); cursor: not-allowed; }

.sc-field__message {
    display: flex;
    align-items: flex-start;
    gap: var(--sc-space-1);
    margin: var(--sc-space-1) 0 0;
    color: var(--sc-color-text-muted);
    font-family: var(--sc-font-body);
    font-size: var(--sc-font-size-2xs);
    line-height: 1.4;
}

.sc-field--error .sc-input, .sc-field--error .sc-select, .sc-field--error .sc-textarea { border-color: var(--sc-color-danger); }
.sc-field--error .sc-field__message { color: var(--sc-color-danger); }
.sc-field--success .sc-input, .sc-field--success .sc-select, .sc-field--success .sc-textarea { border-color: var(--sc-color-success); }
.sc-field--success .sc-field__message { color: var(--sc-color-success); }

.sc-input-group { display: flex; width: 100%; }
.sc-input-group__addon {
    display: inline-flex;
    align-items: center;
    min-height: var(--sc-control-height-md);
    padding-inline: var(--sc-space-3);
    color: var(--sc-color-text-muted);
    background: var(--sc-color-ink-50);
    border: var(--sc-border-width) solid var(--sc-color-border);
    font-family: var(--sc-font-body);
    font-size: var(--sc-font-size-sm);
}
.sc-input-group__addon:first-child { border-right: 0; border-radius: var(--sc-radius-control) 0 0 var(--sc-radius-control); }
.sc-input-group__addon:last-child { border-left: 0; border-radius: 0 var(--sc-radius-control) var(--sc-radius-control) 0; }
.sc-input-group .sc-input { border-radius: 0 var(--sc-radius-control) var(--sc-radius-control) 0; }
.sc-input-group .sc-input:not(:last-child) { border-radius: 0; }

.sc-choice { display: inline-flex; align-items: flex-start; gap: var(--sc-space-2); color: var(--sc-color-text); font: var(--sc-font-weight-regular) var(--sc-font-size-sm)/1.4 var(--sc-font-body); cursor: pointer; }
.sc-choice input { position: absolute; opacity: 0; pointer-events: none; }
.sc-choice__control { display: grid; flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; place-items: center; color: transparent; background: var(--sc-color-surface); border: 1.5px solid var(--sc-color-ink-300); border-radius: var(--sc-radius-xs); }
.sc-choice--radio .sc-choice__control { border-radius: 50%; }
.sc-choice input:checked + .sc-choice__control { color: var(--sc-color-white); background: var(--sc-color-brand-500); border-color: var(--sc-color-brand-500); }
.sc-choice--radio input:checked + .sc-choice__control { background: var(--sc-color-surface); border: 5px solid var(--sc-color-brand-500); }
.sc-choice input:focus-visible + .sc-choice__control { box-shadow: var(--sc-focus-ring); }
.sc-choice input:disabled ~ * { opacity: .48; cursor: not-allowed; }

.sc-switch { display: inline-flex; align-items: center; gap: var(--sc-space-2); color: var(--sc-color-text); font: var(--sc-font-weight-medium) var(--sc-font-size-sm)/1.4 var(--sc-font-body); cursor: pointer; }
.sc-switch input { position: absolute; opacity: 0; }
.sc-switch__track { position: relative; width: 40px; height: 22px; background: var(--sc-color-ink-300); border-radius: var(--sc-radius-pill); transition: background var(--sc-duration-normal) var(--sc-ease-standard); }
.sc-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--sc-color-white); border-radius: 50%; box-shadow: var(--sc-shadow-xs); transition: transform var(--sc-duration-normal) var(--sc-ease-standard); }
.sc-switch input:checked + .sc-switch__track { background: var(--sc-color-brand-500); }
.sc-switch input:checked + .sc-switch__track::after { transform: translateX(18px); }
.sc-switch input:focus-visible + .sc-switch__track { box-shadow: var(--sc-focus-ring); }

.sc-file {
    display: grid;
    justify-items: center;
    gap: var(--sc-space-1);
    padding: var(--sc-space-6);
    color: var(--sc-color-text-muted);
    text-align: center;
    background: var(--sc-color-surface);
    border: 1px dashed var(--sc-color-ink-300);
    border-radius: var(--sc-radius-control);
    font-family: var(--sc-font-body);
    cursor: pointer;
}
.sc-file:hover { color: var(--sc-color-text); border-color: var(--sc-color-brand-500); background: var(--sc-color-brand-50); }
.sc-file > i { color: var(--sc-color-brand-500); font-size: 1.5rem; }
.sc-file strong { color: var(--sc-color-text); font-size: var(--sc-font-size-sm); }
.sc-file small { font-size: var(--sc-font-size-2xs); }
.sc-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.sc-field .select2-container--bootstrap-5 .select2-selection {
    min-height: var(--sc-control-height-md);
    border-color: var(--sc-color-border);
    border-radius: var(--sc-radius-control);
    font-family: var(--sc-font-body);
    font-size: var(--sc-font-size-sm);
}
.sc-field .select2-container--bootstrap-5.select2-container--focus .select2-selection,
.sc-field .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--sc-color-focus);
    box-shadow: var(--sc-focus-ring);
}

@media (max-width: 767.98px) {
    .sc-field--half, .sc-field--third { grid-column: span 12; }
}
