.legend-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-form-title {
    margin: 0 0 20px 0;
    padding: 0;
    color: #333;
    font-size: 24px;
    text-align: center;
}

.legend-form {
    margin: 0;
    padding: 0;
}

.legend-field-group {
    margin-bottom: 20px;
}

.legend-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.legend-field-group .required {
    color: #d63638;
    font-weight: bold;
}

.legend-field-group input[type="text"],
.legend-field-group input[type="email"],
.legend-field-group input[type="tel"],
.legend-field-group input[type="number"],
.legend-field-group textarea,
.legend-field-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.legend-field-group input:focus,
.legend-field-group textarea:focus,
.legend-field-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.legend-field-group textarea {
    min-height: 100px;
    resize: vertical;
}

.legend-field-group select {
    cursor: pointer;
}

.legend-form-submit {
    margin-top: 30px;
    text-align: center;
}

.legend-submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    min-width: 120px;
}

.legend-submit-btn:hover {
    background: #005a87;
}

.legend-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.legend-form-messages {
    margin-top: 20px;
    padding: 0;
}

.legend-form-messages.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
}

.legend-form-messages.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
}

.legend-form-messages p {
    margin: 0;
    padding: 0;
}

/* Required field indicator */
.legend-field-group input:required,
.legend-field-group textarea:required,
.legend-field-group select:required {
    box-shadow: none;
}

.legend-field-group input:invalid:not(:focus):not(:placeholder-shown),
.legend-field-group textarea:invalid:not(:focus):not(:placeholder-shown),
.legend-field-group select:invalid:not(:focus) {
    border-color: #dc3232;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .legend-form-container {
        margin: 10px;
        padding: 15px;
        border-radius: 0;
    }
    
    .legend-form-title {
        font-size: 20px;
    }
    
    .legend-field-group input,
    .legend-field-group textarea,
    .legend-field-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .legend-submit-btn {
        width: 100%;
        padding: 15px 20px;
    }
}

/* Form container without border (for themes that add their own styling) */
.legend-form-container.no-border {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

/* Compact form style */
.legend-form-container.compact .legend-field-group {
    margin-bottom: 15px;
}

.legend-form-container.compact .legend-field-group input,
.legend-form-container.compact .legend-field-group textarea,
.legend-form-container.compact .legend-field-group select {
    padding: 10px 12px;
}

.legend-form-container.compact .legend-submit-btn {
    padding: 12px 30px;
}