/* Reenite Forms - Frontend Styles */

.reenite-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reenite-form-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #1e1e1e;
}

.reenite-form-description {
    font-size: 16px;
    color: #666;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.reenite-form {
    display: flex;
    flex-direction: column;
}

.reenite-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.reenite-form-field {
    display: flex;
    flex-direction: column;
}

.reenite-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1e1e1e;
}

.reenite-field-description {
    margin: 6px 0 10px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    font-style: italic;
}

.reenite-form-field .required {
    color: #d63638;
    margin-left: 3px;
}

.reenite-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.reenite-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.reenite-input::placeholder {
    color: #999;
}

textarea.reenite-input {
    resize: vertical;
    min-height: 100px;
}

select.reenite-input {
    cursor: pointer;
    background-color: #fff;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Radio and Checkbox Groups */
.reenite-radio-group,
.reenite-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reenite-radio-group.reenite-layout-horizontal,
.reenite-checkbox-group.reenite-layout-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.reenite-radio-label,
.reenite-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.reenite-radio-label input[type="radio"],
.reenite-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.reenite-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* File Upload */
input[type="file"].reenite-input {
    padding: 10px;
    cursor: pointer;
}

input[type="file"].reenite-input::-webkit-file-upload-button {
    padding: 8px 16px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

input[type="file"].reenite-input::-webkit-file-upload-button:hover {
    background: #e8e8e9;
}

/* Submit Button */
.reenite-form-submit {
    margin-top: 10px;
}

.reenite-submit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    justify-content: center;
}

.reenite-submit-button:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

.reenite-submit-button:active {
    transform: translateY(0);
}

.reenite-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.reenite-button-loader {
    display: none;
}

.reenite-button-loader .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.reenite-submit-button.loading .reenite-button-text {
    display: none;
}

.reenite-submit-button.loading .reenite-button-loader {
    display: flex;
}

/* Messages */
.reenite-form-messages {
    margin-bottom: 20px;
}

.reenite-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.reenite-message-success {
    background: #d7f0e9;
    color: #00a32a;
    border-left: 4px solid #00a32a;
}

.reenite-message-error {
    background: #f8d7da;
    color: #d63638;
    border-left: 4px solid #d63638;
}

.reenite-message-info {
    background: #e8f0fe;
    color: #2271b1;
    border-left: 4px solid #2271b1;
}

/* Field Errors */
.reenite-form-field.has-error .reenite-input {
    border-color: #d63638;
}

.reenite-form-field.has-error label {
    color: #d63638;
}

.reenite-field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #d63638;
}

/* Responsive */
@media (max-width: 768px) {
    .reenite-form-container {
        padding: 20px;
        margin: 20px 15px;
    }

    .reenite-form-title {
        font-size: 24px;
    }

    .reenite-form-description {
        font-size: 14px;
    }

    .reenite-radio-group.reenite-layout-horizontal,
    .reenite-checkbox-group.reenite-layout-horizontal {
        flex-direction: column;
        gap: 10px;
    }

    .reenite-submit-button {
        width: 100%;
    }
}

/* Accessibility */
.reenite-input:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.reenite-radio-label:focus-within,
.reenite-checkbox-label:focus-within {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading State */
.reenite-form.submitting {
    opacity: 0.6;
    pointer-events: none;
}
