/* Frontend Styles */

.st-custom-fields-group {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    background-color: #f9f9f9;
}

.st-custom-fields-group legend {
    padding: 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.st-custom-field {
    margin-bottom: 15px;
}

.st-custom-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.st-custom-field .required {
    color: #d32f2f;
    margin-left: 3px;
}

.st-custom-field input[type="text"],
.st-custom-field input[type="email"],
.st-custom-field input[type="number"],
.st-custom-field input[type="date"],
.st-custom-field input[type="time"],
.st-custom-field input[type="file"],
.st-custom-field select,
.st-custom-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
    box-sizing: border-box;
}

.st-custom-field input[type="text"]:focus,
.st-custom-field input[type="email"]:focus,
.st-custom-field input[type="number"]:focus,
.st-custom-field input[type="date"]:focus,
.st-custom-field input[type="time"]:focus,
.st-custom-field input[type="file"]:focus,
.st-custom-field select:focus,
.st-custom-field textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.st-custom-field textarea {
    resize: vertical;
    min-height: 100px;
}

.st-custom-field .description {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.st-field-type-radio,
.st-field-type-checkbox {
    margin-bottom: 12px;
}

.st-field-type-radio label,
.st-field-type-checkbox label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: normal;
}

.st-field-type-radio input[type="radio"],
.st-field-type-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-bottom: 0;
    cursor: pointer;
}

/* Placeholder styling */

.st-custom-field input::placeholder,
.st-custom-field textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* Error states */

.st-custom-field input:invalid,
.st-custom-field select:invalid,
.st-custom-field textarea:invalid {
    border-color: #d32f2f;
}

/* Loading animation */

.st-custom-fields-loading {
    opacity: 0.6;
    pointer-events: none;
}

.st-custom-fields-loading::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive */

@media (max-width: 768px) {
    .st-custom-fields-group {
        padding: 15px;
    }

    .st-custom-field {
        margin-bottom: 12px;
    }

    .st-custom-field input[type="text"],
    .st-custom-field input[type="email"],
    .st-custom-field input[type="number"],
    .st-custom-field input[type="date"],
    .st-custom-field input[type="time"],
    .st-custom-field select,
    .st-custom-field textarea {
        padding: 8px;
        font-size: 16px;
    }
}
