
/* ============================================================
   SENSTECH — FORMS
   ============================================================ */

.st-form {
    display: grid;
    gap: var(--st-space-5, 20px);
}

.st-field {
    display: flex;
    flex-direction: column;
    gap: var(--st-space-2, 8px);
}

.st-label {
    color: var(--st-text, #0B1220);
    font-size: var(--st-text-sm, 0.875rem);
    font-weight: 600;
}

.st-required {
    color: var(--st-danger, #DC2626);
}

.st-input,
.st-select,
.st-textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;

    color: var(--st-text, #0B1220);
    background: #FFFFFF;
    border: 1px solid var(--st-border-strong, #CBD5E1);
    border-radius: var(--st-radius-md, 12px);

    font-family: var(--st-font-body, 'Inter', sans-serif);
    font-size: var(--st-text-sm, 0.875rem);
    line-height: 1.5;

    outline: none;
    transition:
        border-color var(--st-transition, 180ms ease),
        box-shadow var(--st-transition, 180ms ease),
        background-color var(--st-transition, 180ms ease);
}

.st-input::placeholder,
.st-textarea::placeholder {
    color: var(--st-slate-400, #94A3B8);
}

.st-input:hover,
.st-select:hover,
.st-textarea:hover {
    border-color: var(--st-slate-400, #94A3B8);
}

.st-input:focus,
.st-select:focus,
.st-textarea:focus {
    border-color: var(--st-secondary, #14B8A6);
    box-shadow: 0 0 0 3px var(--st-focus-ring, rgba(20, 184, 166, .24));
}

.st-textarea {
    min-height: 120px;
    resize: vertical;
}

.st-input:disabled,
.st-select:disabled,
.st-textarea:disabled {
    color: var(--st-text-disabled, #94A3B8);
    background: var(--st-surface-muted, #F1F5F9);
    cursor: not-allowed;
}

.st-input-error,
.st-input[aria-invalid="true"] {
    border-color: var(--st-danger, #DC2626);
}

.st-input-error:focus,
.st-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.st-input-success {
    border-color: var(--st-success, #15803D);
}

.st-help {
    color: var(--st-text-muted, #64748B);
    font-size: var(--st-text-xs, 0.75rem);
}

.st-error {
    color: var(--st-danger, #DC2626);
    font-size: var(--st-text-xs, 0.75rem);
}

.st-success-message {
    color: var(--st-success, #15803D);
    font-size: var(--st-text-xs, 0.75rem);
}

/* Input group */

.st-input-group {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.st-input-group .st-input {
    min-width: 0;
    border-radius: var(--st-radius-md, 12px) 0 0 var(--st-radius-md, 12px);
}

.st-input-addon {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;

    color: var(--st-text-secondary, #334155);
    background: var(--st-surface-muted, #F1F5F9);
    border: 1px solid var(--st-border-strong, #CBD5E1);
    border-left: 0;
    border-radius: 0 var(--st-radius-md, 12px) var(--st-radius-md, 12px) 0;

    font-size: var(--st-text-sm, 0.875rem);
}

/* Checkbox and radio */

.st-check,
.st-radio {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--st-text-secondary, #334155);
    font-size: var(--st-text-sm, 0.875rem);
}

.st-check input,
.st-radio input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: var(--st-primary, #0F6A4A);
}

/* Switch */

.st-switch {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
}

.st-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.st-switch-track {
    position: absolute;
    inset: 0;

    background: var(--st-slate-300, #CBD5E1);
    border-radius: var(--st-radius-full, 9999px);

    cursor: pointer;
    transition: background var(--st-transition, 180ms ease);
}

.st-switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: var(--st-shadow-xs, 0 1px 2px rgba(11, 18, 32, .04));

    transition: transform var(--st-transition, 180ms ease);
}

.st-switch input:checked + .st-switch-track {
    background: var(--st-secondary, #14B8A6);
}

.st-switch input:checked + .st-switch-track::before {
    transform: translateX(18px);
}

.st-switch input:focus-visible + .st-switch-track {
    outline: 3px solid var(--st-focus-ring, rgba(20, 184, 166, .24));
    outline-offset: 2px;
}
